MDL-13110 - Manually grading random questions does not work. Fix thanks to Ken Burres.

This commit is contained in:
tjhunt
2008-01-30 18:18:36 +00:00
parent 99aa575df8
commit 8bb3fac17c
2 changed files with 3 additions and 1 deletions
+2 -1
View 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>';
}
+1
View 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);
}