MDL-32438 choice: fix fatal error on making choice
[moodle.git] / mod / choice / lib.php
index 4736529..2b37b38 100644 (file)
@@ -295,7 +295,7 @@ WHERE
             $DB->update_record("choice_answers", $newanswer);
             add_to_log($course->id, "choice", "choose again", "view.php?id=$cm->id", $choice->id, $cm->id);
         } else {
-            $newanswer = stdClass();
+            $newanswer = new stdClass();
             $newanswer->choiceid = $choice->id;
             $newanswer->userid = $userid;
             $newanswer->optionid = $formanswer;