Permalink
Browse files

MDL-34259 Lesson: True/false questions don't break on missing answer

  • Loading branch information...
FMCorz committed Jul 26, 2012
1 parent 02814bf commit 6ce946c561670d33bae68829fdf3f5c54be95f68
Showing with 2 additions and 3 deletions.
  1. +2 −3 mod/lesson/pagetypes/truefalse.php
@@ -76,12 +76,11 @@ public function check_answer() {
$result = parent::check_answer();
- $answerid = $data->answerid;
- if ($answerid === false) {
+ if (empty($data->answerid)) {
$result->noanswer = true;
return $result;
}
- $result->answerid = $answerid;
+ $result->answerid = $data->answerid;
$answer = $DB->get_record("lesson_answers", array("id" => $result->answerid), '*', MUST_EXIST);
if ($this->lesson->jumpto_is_correct($this->properties->id, $answer->jumpto)) {
$result->correctanswer = true;

0 comments on commit 6ce946c

Please sign in to comment.