当前位置: 首页>>代码示例>>PHP>>正文


PHP test_question_maker::initialise_question_form_data方法代码示例

本文整理汇总了PHP中test_question_maker::initialise_question_form_data方法的典型用法代码示例。如果您正苦于以下问题:PHP test_question_maker::initialise_question_form_data方法的具体用法?PHP test_question_maker::initialise_question_form_data怎么用?PHP test_question_maker::initialise_question_form_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在test_question_maker的用法示例。


在下文中一共展示了test_question_maker::initialise_question_form_data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_multianswer_question_form_data_twosubq

    /**
     * Makes a multianswer question about completing two blanks in some text.
     * @return object the question definition data, as it might be returned from
     *      the question editing form.
     */
    public function get_multianswer_question_form_data_twosubq() {
        $formdata = new stdClass();
        test_question_maker::initialise_question_form_data($formdata);

        $formdata->name = 'Simple multianswer';
        $formdata->questiontext = 'Complete this opening line of verse: "The ' .
                '{1:SHORTANSWER:Dog#Wrong, silly!~=Owl#Well done!~*#Wrong answer} ' .
                'and the {1:MULTICHOICE:Bow-wow#You seem to have a dog obsessions!' .
                '~Wiggly worm#Now you are just being ridiculous!~=Pussy-cat#Well done!}' .
                ' went to sea".';
        $formdata->generalfeedback = 'General feedback: It\'s from "The Owl and the Pussy-cat" ' .
                'by Lear: "The owl and the pussycat went to sea';

        $formdata->hint = array(
            0 => array('text' => 'Hint 1', 'format' => FORMAT_HTML, 'itemid' => 0),
            1 => array('text' => 'Hint 2', 'format' => FORMAT_HTML, 'itemid' => 0),
        );

        return $formdata;
    }
开发者ID:numbas,项目名称:moodle,代码行数:25,代码来源:helper.php

示例2: get_shortanswer_question_form_data_frogtoad

    /**
     * Gets the question data for a shortanswer question with with correct
     * ansewer 'frog', partially correct answer 'toad' and defaultmark 1.
     * This question also has a '*' match anything answer.
     * @return stdClass
     */
    public function get_shortanswer_question_form_data_frogtoad() {
        $fromform = new stdClass();
        test_question_maker::initialise_question_form_data($fromform);

        $fromform->qtype = 'shortanswer';
        $fromform->name = 'Short answer question';
        $fromform->questiontext = array('text' => 'Name an amphibian: __________', 'format' => FORMAT_HTML);
        $fromform->generalfeedback = array('text' => 'Generalfeedback: frog or toad would have been OK.', 'format' => FORMAT_HTML);
        $fromform->usecase = false;
        $fromform->answer = array('frog', 'toad', '*');
        $fromform->fraction = array(1.0, 0.8, 0.0);
        $fromform->feedback = array(
            array('text' => 'Frog is a very good answer.', 'format' => FORMAT_HTML),
            array('text' => 'Toad is an OK good answer.', 'format' => FORMAT_HTML),
            array('text' => 'That is a bad answer.', 'format' => FORMAT_HTML),
        );

        return $fromform;
    }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:25,代码来源:helper.php


注:本文中的test_question_maker::initialise_question_form_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。