Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug that was pointed out by Tom Cat:

The reuse of old quiz_answers records for question type multianswer/embedded did not work properly.
  • Loading branch information...
commit 175462491693534dfc8bfa94549f3537611da798 1 parent 640cb17
kaipe authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 mod/quiz/lib.php
View
8 mod/quiz/lib.php
@@ -2255,8 +2255,8 @@ function quiz_save_multianswer_alternatives
// otherwise the ids of the answers.
if (empty($oldalternativeids)
- or $oldalternatives =
- get_records_list('quiz_answers', 'id', $oldalternativeids))
+ or !($oldalternatives =
+ get_records_list('quiz_answers', 'id', $oldalternativeids)))
{
$oldalternatives = array();
}
@@ -2280,7 +2280,7 @@ function quiz_save_multianswer_alternatives
$alt->answer = $altdata->answer;
$alt->fraction = $altdata->fraction;
$alt->feedback = $altdata->feedback;
- if (! $alt->id = insert_record("quiz_answers", $alt)) {
+ if (!($alt->id = insert_record("quiz_answers", $alt))) {
return false;
}
}
@@ -2319,7 +2319,7 @@ function quiz_save_multianswer_alternatives
delete_records("quiz_answers", "id", $altobsolete->id);
// Possibly obsolute numerical options are also to be deleted:
- delete_records("quiz_numerical", 'answer', $alt->id);
+ delete_records("quiz_numerical", 'answer', $altobsolete->id);
}
// Common alternative options and removal of obsolete options
Please sign in to comment.
Something went wrong with that request. Please try again.