Permalink
Browse files

Fixing bug where quizzes from 1.4 will lose their answers when upgrad…

…ed to later versions.

Fixes MDL-8207.
  • Loading branch information...
1 parent ab6803a commit 7c4b621a2051fc5bdc769f2372a468411e65150e mchurch committed Jan 16, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/quiz/locallib.php
View
@@ -587,11 +587,11 @@ function quiz_upgrade_states($attempt) {
// Actually we only do this for states whose question is actually listed in $attempt->layout.
// We do not do it for states associated to wrapped questions like for example the questions
// used by a RANDOM question
- $newest->attemptid = $attempt->uniqueid;
+ $session = new stdClass;
+ $session->attemptid = $attempt->uniqueid;
$questionlist = quiz_questions_in_quiz($attempt->layout);
if ($questionlist and $states = get_records_select('question_states', "attempt = '$attempt->uniqueid' AND question IN ($questionlist)")) {
foreach ($states as $state) {
- $session = new stdClass;
$session->newgraded = $state->id;
$session->newest = $state->id;
$session->questionid = $state->question;

0 comments on commit 7c4b621

Please sign in to comment.