MDL-32438 choice: fix fatal error on making choice
authorMichael Aherne <michael.aherne@strath.ac.uk>
Fri, 13 Apr 2012 14:09:31 +0000 (15:09 +0100)
committerMichael Aherne <michael.aherne@strath.ac.uk>
Fri, 13 Apr 2012 14:16:12 +0000 (15:16 +0100)
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;