From: tjhunt Date: Wed, 28 Jun 2006 11:45:11 +0000 (+0000) Subject: Bug #5922 - comment from manualgraded questions lost during regrade. Thanks to Jean... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=82b5d7cd8ee9e80a28da95aed9c40f8dc73a25d5;p=moodle.git Bug #5922 - comment from manualgraded questions lost during regrade. Thanks to Jean-Michel Vedrine for the fix. Merged from MOODLE_16_STABLE. --- diff --git a/lib/questionlib.php b/lib/questionlib.php index 113af9c17a..554ca2001b 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -837,6 +837,8 @@ function regrade_question_in_attempt($question, $attempt, $cmoptions, $verbose=f // Initialise the replaystate $state = clone($states[0]); + $state->comment = get_field('question_sessions', 'comment', 'attemptid', + $attempt->uniqueid, 'questionid', $question->id); restore_question_state($question, $state); $state->sumpenalty = 0.0; $replaystate = clone($state); @@ -861,7 +863,7 @@ function regrade_question_in_attempt($question, $attempt, $cmoptions, $verbose=f } if ($action->event == QUESTION_EVENTMANUALGRADE) { - question_process_comment($question, $replaystate, $attempt, $states[$j]->comment, $states[$j]->grade); + question_process_comment($question, $replaystate, $attempt, $replaystate->comment, $states[$j]->grade); } else { // Reprocess (regrade) responses