Permalink
Browse files

question state loading MDL-9327 and MDL-19114 fix loading the state o…

…f 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
  • Loading branch information...
1 parent 3570713 commit b6be82811d12d0dc49e87b2e309451e92bd944e7 @timhunt timhunt committed Feb 5, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/questionlib.php
  2. +1 −1 mod/quiz/report/reportlib.php
View
@@ -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)) {
@@ -19,7 +19,7 @@ function quiz_get_newgraded_states($attemptids, $idxattemptq = true, $fields='qs
"{$CFG->prefix}question_sessions qns, " .
"{$CFG->prefix}question_states qs " .
"WHERE qns.attemptid IN ($attemptidlist) AND " .
- "qns.newgraded = qs.id";
+ "qns.newest = qs.id";
$gradedstates = get_records_sql($gradedstatesql);
if ($idxattemptq){
$gradedstatesbyattempt = array();

0 comments on commit b6be828

Please sign in to comment.