本文整理汇总了PHP中question_attempt::start方法的典型用法代码示例。如果您正苦于以下问题:PHP question_attempt::start方法的具体用法?PHP question_attempt::start怎么用?PHP question_attempt::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类question_attempt
的用法示例。
在下文中一共展示了question_attempt::start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: make_blocked_question_placeholder
/**
* Create a fake question to be displayed in place of a question that is blocked
* until the previous question has been answered.
*
* @param int $slot int slot number of the question to replace.
* @return question_definition the placeholde question.
*/
protected function make_blocked_question_placeholder($slot)
{
$replacedquestion = $this->get_question_attempt($slot)->get_question();
question_bank::load_question_definition_classes('description');
$question = new qtype_description_question();
$question->id = $replacedquestion->id;
$question->category = null;
$question->parent = 0;
$question->qtype = question_bank::get_qtype('description');
$question->name = '';
$question->questiontext = get_string('questiondependsonprevious', 'quiz');
$question->questiontextformat = FORMAT_HTML;
$question->generalfeedback = '';
$question->defaultmark = $this->quba->get_question_max_mark($slot);
$question->length = $replacedquestion->length;
$question->penalty = 0;
$question->stamp = '';
$question->version = 0;
$question->hidden = 0;
$question->timecreated = null;
$question->timemodified = null;
$question->createdby = null;
$question->modifiedby = null;
$placeholderqa = new question_attempt($question, $this->quba->get_id(), null, $this->quba->get_question_max_mark($slot));
$placeholderqa->set_slot($slot);
$placeholderqa->start($this->get_quiz()->preferredbehaviour, 1);
$placeholderqa->set_flagged($this->is_question_flagged($slot));
return $placeholderqa;
}