Improve error messages.
authortjhunt <tjhunt>
Thu, 13 Dec 2007 17:24:54 +0000 (17:24 +0000)
committertjhunt <tjhunt>
Thu, 13 Dec 2007 17:24:54 +0000 (17:24 +0000)
question/type/calculated/questiontype.php
question/type/numerical/questiontype.php
question/type/shortanswer/questiontype.php
question/type/truefalse/questiontype.php

index 31e3a8738b906cb5b84467966ced46db8b5d57ca..6ff0637b938ece19a721974c7c97f571a6e79f42 100644 (file)
@@ -28,7 +28,7 @@ class question_calculated_qtype extends question_dataset_dependent_questiontype
                                 "WHERE a.question = $question->id " .
                                 "AND   a.id = c.answer ".
                                 "ORDER BY a.id ASC")) {
-            notify('Error: Missing question answer!');
+            notify('Error: Missing question answer for calculated question ' . $question->id . '!');
             return false;
         }
 
index f4449591dcd42e9e92920dbd888f0179f4fdd57a..0cfd258649e4113088c0e45585b65278da35dd25 100644 (file)
@@ -39,7 +39,7 @@ class question_numerical_qtype extends question_shortanswer_qtype {
                                 "WHERE a.question = $question->id " .
                                 "    AND   a.id = n.answer " .
                                 "ORDER BY a.id ASC")) {
-            notify('Error: Missing question answer!');
+            notify('Error: Missing question answer for numerical question ' . $question->id . '!');
             return false;
         }
         $this->get_numerical_units($question);
index 913b1e7bbb30b9e5d8c67aaf38dfa9804f301450..ac999b95a5e92a2b574d733e362b886ed1ccf2f6 100644 (file)
@@ -32,7 +32,7 @@ class question_shortanswer_qtype extends default_questiontype {
 
         if (!$question->options->answers = get_records('question_answers', 'question',
                 $question->id, 'id ASC')) {
-            notify('Error: Missing question answers!');
+            notify('Error: Missing question answers for shortanswer question ' . $question->id . '!');
             return false;
         }
         return true;
index 1877b83cf73710ad1e7da56b050057c9dadc1a1d..a45bdc56ad5dcc8b39ebc3bf8031db026e5c3e6d 100644 (file)
@@ -107,7 +107,7 @@ class question_truefalse_qtype extends default_questiontype {
         }
         // Load the answers
         if (!$question->options->answers = get_records('question_answers', 'question', $question->id, 'id ASC')) {
-           notify('Error: Missing question answers!');
+           notify('Error: Missing question answers for truefalse question ' . $question->id . '!');
            return false;
         }