question state loading MDL-9327 and MDL-19114 fix loading the state of ungraded essay questions

In two situations, the correct state was not being loaded for essay questions that had
not yet been manually graded:
1. When starting a subsequent attempt in each attempt builds on last mode.
2. In the quiz reports.

This commit fixes the problem. It has one other side-effect. When viewing the individual
question grades in the overview report for an attempt that is still in progress, the
information displayed will be slightly different. This only affects adaptive mode quizzes,
and will acutally cause the report to show slighly more up-to-date information.

Interestingly, the reportlib.php change had already been made in HEAD, as part of MDL 16529
This commit is contained in:
Tim Hunt
2010-02-05 16:36:59 +00:00
parent 3570713828
commit b6be82811d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -861,7 +861,7 @@ function get_question_states(&$questions, $cmoptions, $attempt, $lastattemptid =
$sql = "SELECT $statefields".
" FROM {$CFG->prefix}question_states s,".
" {$CFG->prefix}question_sessions n".
" WHERE s.id = n.newgraded".
" WHERE s.id = n.newest".
" AND n.attemptid = '$lastattemptid'".
" AND n.questionid = '$i'";
if (!$laststate = get_record_sql($sql)) {