Permalink
Browse files

MDL-13110 - Manually grading random questions does not work. Fix than…

…ks to Ken Burres.
  • Loading branch information...
1 parent 5ed379d commit 2519a70a191c6998b847f39e4d973b835d670b7b tjhunt committed Jan 30, 2008
Showing with 3 additions and 1 deletion.
  1. +2 −1 question/type/questiontype.php
  2. +1 −0 question/type/random/questiontype.php
@@ -478,7 +478,8 @@ function print_question(&$question, &$state, $number, $cmoptions, $options) {
$commentlink = '';
if (isset($options->questioncommentlink)) {
$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>';
}
@@ -212,6 +212,7 @@ function get_actual_response(&$question, &$state){
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);
}

0 comments on commit 2519a70

Please sign in to comment.