Skip to content

Commit

Permalink
MDL-13110 - Manually grading random questions does not work. Fix than…
Browse files Browse the repository at this point in the history
…ks to Ken Burres.
  • Loading branch information
tjhunt committed Jan 30, 2008
1 parent 203b990 commit df6447e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion question/type/questiontype.php
Expand Up @@ -631,7 +631,8 @@ function print_question(&$question, &$state, $number, $cmoptions, $options) {

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>';
}

Expand Down
1 change: 1 addition & 0 deletions question/type/random/questiontype.php
Expand Up @@ -218,6 +218,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);
}
Expand Down

0 comments on commit df6447e

Please sign in to comment.