當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。