本文整理汇总了PHP中question_attempt::get_step方法的典型用法代码示例。如果您正苦于以下问题:PHP question_attempt::get_step方法的具体用法?PHP question_attempt::get_step怎么用?PHP question_attempt::get_step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类question_attempt
的用法示例。
在下文中一共展示了question_attempt::get_step方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formulation_and_controls
public function formulation_and_controls(question_attempt $qa, question_display_options $options)
{
global $PAGE;
$question = $qa->get_question();
if ($question->answerdisplay == "dragdrop") {
$PAGE->requires->js('/question/type/gapfill/jquery/jquery-1.4.2.js');
$PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.core.min.js');
$PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.widget.min.js');
$PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.mouse.min.js');
$PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.draggable.min.js');
$PAGE->requires->js('/question/type/gapfill/jquery/ui/jquery.ui.droppable.min.js');
$PAGE->requires->js('/question/type/gapfill/dragdrop.js');
}
$answers = $qa->get_step(0)->get_qt_var('_allanswers');
$output = '';
if ($question->answerdisplay == "dragdrop") {
$ddclass = " draggable answers ";
$answers = $this->get_answers('dragdrop', $answers);
foreach ($answers as $value) {
$output .= '<span class="' . $ddclass . '">' . $value . "</span> ";
}
$output .= "</br></br>";
}
$marked_gaps = $question->get_marked_gaps($qa, $options);
foreach ($question->textfragments as $place => $fragment) {
if ($place > 0) {
$output .= $this->embedded_element($qa, $place, $options, $marked_gaps);
}
/* format the non entry field parts of the question text, this will also
ensure images get displayed */
$output .= $question->format_text($fragment, $question->questiontextformat, $qa, 'question', 'questiontext', $question->id);
}
print "<br/>";
if ($qa->get_state() == question_state::$invalid) {
$output .= html_writer::nonempty_tag('div', $question->get_validation_error(array('answer' => $output)), array('class' => 'validationerror'));
}
return $output;
}
示例2: init_order
protected function init_order(question_attempt $qa)
{
if (is_null($this->order)) {
$this->order = explode(',', $qa->get_step(0)->get_qt_var('_order'));
}
}
示例3: notify_metadata_modified
public function notify_metadata_modified(question_attempt $qa, $name)
{
if (array_key_exists($qa->get_slot(), $this->attemptsadded)) {
return;
}
if ($this->is_step_added($qa->get_step(0)) !== false) {
return;
}
if (isset($this->metadataadded[$qa->get_slot()][$name])) {
return;
}
if (isset($this->metadatamodified[$qa->get_slot()][$name])) {
return;
}
$this->metadatamodified[$qa->get_slot()][$name] = $qa;
}