$options = quiz_get_reviewoptions($quiz, $attempt, $isteacher);
$options->validation = QUESTION_EVENTVALIDATE === $states[$i]->event;
$options->history = ($isteacher and !$attempt->preview) ? 'all' : 'graded';
+ // Provide the links to the question review script
+ $options->questionreviewlink = '/mod/quiz/reviewquestion.php';
// Print the question
if ($i > 0) {
echo "<br />\n";
$options = quiz_get_reviewoptions($quiz, $attempt, $isteacher);
$options->validation = ($state->event == QUESTION_EVENTVALIDATE);
$options->history = 'all';
+ // Provide the links to this question review script
+ $options->questionreviewlink = '/mod/quiz/reviewquestion.php';
/// Print infobox
$table->align = array("right", "left");
$grade .= $question->maxgrade;
}
+ $history = $this->history($question, $state, $number, $cmoptions, $options);
+
+ include "$CFG->dirroot/question/questiontypes/question.html";
+ }
+
+ /*
+ * Print history of responses
+ *
+ * Used by print_question()
+ */
+ function history($question, $state, $number, $cmoptions, $options) {
$history = '';
if(isset($options->history) and $options->history) {
if ($options->history == 'all') {
foreach ($states as $st) {
$b = ($state->id == $st->id) ? '<b>' : '';
$be = ($state->id == $st->id) ? '</b>' : '';
+ if ($state->id == $st->id) {
+ $link = '<b>'.$st->seq_number.'</b>';
+ } else {
+ if(isset($options->questionreviewlink)) {
+ $link = link_to_popup_window ($options->questionreviewlink.'?state='.$st->id.'&number='.$number,
+ 'reviewquestion', $st->seq_number, 450, 650, $strreviewquestion, 'none', true);
+ } else {
+ $link = $st->seq_number;
+ }
+ }
$table->data[] = array (
- ($state->id == $st->id) ? '<b>'.$st->seq_number.'</b>' : link_to_popup_window ('/question/reviewquestion.php?state='.$st->id.'&number='.$number, 'reviewquestion', $st->seq_number, 450, 650, $strreviewquestion, 'none', true),
+ $link,
$b.get_string('event'.$st->event, 'quiz').$be,
$b.$this->response_summary($st).$be,
$b.userdate($st->timestamp, get_string('timestr', 'quiz')).$be,
$history = make_table($table);
}
}
- include "$CFG->dirroot/question/questiontypes/question.html";
+ return $history;
}