Ejemplo n.º 1
0
 /**
  * Initialise the JS etc. required by one question.
  * @param integer $questionid the question id.
  */
 public function get_question_html_head_contributions($questionid)
 {
     question_get_html_head_contributions(array($questionid), $this->questions, $this->states);
 }
Ejemplo n.º 2
0
        }
    }
} else {
    $submitted = false;
    $curstate =& $states[$historylength][$id];
}
// TODO: should not use quiz-specific function here
$options = quiz_get_renderoptions($quiz, $attempt, $context, $curstate);
$options->noeditlink = true;
// Fill in the correct responses (unless the question is in readonly mode)
if ($fillcorrect && !$options->readonly) {
    $curstate->responses = $QTYPES[$questions[$id]->qtype]->get_correct_responses($questions[$id], $curstate);
}
$strpreview = get_string('preview', 'quiz') . ' ' . format_string($questions[$id]->name);
$questionlist = array($id);
question_get_html_head_contributions($questionlist, $questions, $states[$historylength]);
$PAGE->set_title($strpreview);
$PAGE->set_heading($COURSE->fullname);
echo $OUTPUT->header();
if (!empty($quizid)) {
    echo '<p class="quemodname">' . get_string('modulename', 'quiz') . ': ';
    p(format_string($quiz->name));
    echo "</p>\n";
}
$number = 1;
echo '<form method="post" action="' . $url->out_omit_querystring() . '" enctype="multipart/form-data" id="responseform">', "\n";
$PAGE->requires->js_init_call('M.core_question_engine.init_form', array('#responseform'));
print_question($questions[$id], $curstate, $number, $quiz, $options, $context);
echo '<div class="controls">';
echo html_writer::input_hidden_params($url);
// Print the mark and finish attempt buttons