From fe9b5cfd0bc76e48ff59266c599b6a971ddab847 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Wed, 22 Mar 2006 21:30:00 +0000 Subject: [PATCH] Fixed the links to the question review script. --- mod/quiz/review.php | 2 ++ mod/quiz/reviewquestion.php | 2 ++ question/questiontypes/questiontype.php | 25 +++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/mod/quiz/review.php b/mod/quiz/review.php index a73fa1ef77..6dea7c363a 100644 --- a/mod/quiz/review.php +++ b/mod/quiz/review.php @@ -230,6 +230,8 @@ $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 "
\n"; diff --git a/mod/quiz/reviewquestion.php b/mod/quiz/reviewquestion.php index 43fbd1ad2d..be9c077e3b 100644 --- a/mod/quiz/reviewquestion.php +++ b/mod/quiz/reviewquestion.php @@ -108,6 +108,8 @@ $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"); diff --git a/question/questiontypes/questiontype.php b/question/questiontypes/questiontype.php index 745b3ecf2c..84cf838f34 100644 --- a/question/questiontypes/questiontype.php +++ b/question/questiontypes/questiontype.php @@ -474,6 +474,17 @@ class default_questiontype { $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') { @@ -501,8 +512,18 @@ class default_questiontype { foreach ($states as $st) { $b = ($state->id == $st->id) ? '' : ''; $be = ($state->id == $st->id) ? '' : ''; + if ($state->id == $st->id) { + $link = ''.$st->seq_number.''; + } 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) ? ''.$st->seq_number.'' : 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, @@ -514,7 +535,7 @@ class default_questiontype { $history = make_table($table); } } - include "$CFG->dirroot/question/questiontypes/question.html"; + return $history; } -- 2.39.5