]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13110 - Manually grading random questions does not work. Fix thanks to Ken Burres.
authortjhunt <tjhunt>
Wed, 30 Jan 2008 18:18:36 +0000 (18:18 +0000)
committertjhunt <tjhunt>
Wed, 30 Jan 2008 18:18:36 +0000 (18:18 +0000)
question/type/questiontype.php
question/type/random/questiontype.php

index 079a6226967ece2b8e57ab266670921ed59d28eb..8f5ad1c75e05b8fb1d2f9a3470aa7287ae9d8e1d 100644 (file)
@@ -852,7 +852,8 @@ class default_questiontype {
 
         if (isset($options->questioncommentlink) && $context && has_capability('mod/quiz:grade', $context)) {
             $strcomment = get_string('commentorgrade', 'quiz');
-            $commentlink = '<div class="commentlink">'.link_to_popup_window ($options->questioncommentlink.'?attempt='.$state->attempt.'&amp;question='.$question->id,
+            $question_to_comment = isset($question->randomquestionid) ? $question->randomquestionid : $question->id;
+            $commentlink = '<div class="commentlink">'.link_to_popup_window ($options->questioncommentlink.'?attempt='.$state->attempt.'&amp;question='.$question_to_comment,
                              'commentquestion', $strcomment, 450, 650, $strcomment, 'none', true).'</div>';
         }
 
index 6aaef2dc1d609fe97dd718018fa7e6653024e6c5..17f80e22a53db98f5ed519f34e5cb96ea1b0a992 100644 (file)
@@ -258,6 +258,7 @@ class random_qtype extends default_questiontype {
     function print_question(&$question, &$state, &$number, $cmoptions, $options) {
         global $QTYPES;
         $wrappedquestion = &$state->options->question;
+        $wrappedquestion->randomquestionid = $question->id;
         $QTYPES[$wrappedquestion->qtype]
          ->print_question($wrappedquestion, $state, $number, $cmoptions, $options);
     }