MDL-13110 - Manually grading random questions does not work. Fix thanks to Ken Burres.
This commit is contained in:
@@ -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.'&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.'&question='.$question_to_comment,
|
||||
'commentquestion', $strcomment, 450, 650, $strcomment, 'none', true).'</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user