Skip to content

Commit

Permalink
Fixing bug where quizzes from 1.4 will lose their answers when upgrad…
Browse files Browse the repository at this point in the history
…ed to later versions.

Fixes MDL-8207.
  • Loading branch information
mchurch committed Jan 16, 2007
1 parent f470cf4 commit 8b4a8f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mod/quiz/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,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;
Expand Down

0 comments on commit 8b4a8f6

Please sign in to comment.