Skip to content

Commit

Permalink
MDL-7428 - Quiz regrade removes student answers from essay questions …
Browse files Browse the repository at this point in the history
…that have been graded. Merged from MOODLE_16_STABLE.
  • Loading branch information
tjhunt committed Nov 15, 2006
1 parent a4d79b0 commit 84bf852
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/questionlib.php
Expand Up @@ -1207,17 +1207,19 @@ function question_process_comment($question, &$state, &$attempt, $comment, $grad
// to set the $state->changed flag.
if (abs($state->last_graded->grade - $grade) > 0.002 ||
$state->last_graded->event != QUESTION_EVENTMANUALGRADE) {

// We want to update existing state (rather than creating new one) if it
// was itself created by a manual grading event.
$state->update = ($state->event == QUESTION_EVENTMANUALGRADE) ? 1 : 0;

// Update the other parts of the state object.
$state->raw_grade = $grade;
$state->grade = $grade;
$state->penalty = 0;
$state->timestamp = time();
$state->seq_number++;
$state->event = QUESTION_EVENTMANUALGRADE;

// We want to update existing state (rather than creating new one) if it
// was itself created by a manual grading event.
$state->update = ($state->event == QUESTION_EVENTMANUALGRADE) ? 1 : 0;

// Update the last graded state (don't simplify!)
unset($state->last_graded);
$state->last_graded = clone($state);
Expand Down

0 comments on commit 84bf852

Please sign in to comment.