MDL-20636 Start supporting different response formats in essay. #216
[moodle.git] / question / type / essay / questiontype.php
index 4ec4fba..bd663ab 100644 (file)
@@ -52,6 +52,7 @@ class qtype_essay extends question_type {
         $options = $DB->get_record('qtype_essay_options', array('questionid' => $formdata->id));
         if (!$options) {
             $options = new stdClass();
         $options = $DB->get_record('qtype_essay_options', array('questionid' => $formdata->id));
         if (!$options) {
             $options = new stdClass();
+            $options->questionid = $formdata->id;
             $options->id = $DB->insert_record('qtype_essay_options', $options);
         }
 
             $options->id = $DB->insert_record('qtype_essay_options', $options);
         }