本文整理汇总了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;
}
示例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;
}