From df06c4bb88d1192c94e1dfca93be5684609752e9 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 13 Dec 2007 17:24:54 +0000 Subject: [PATCH] Improve error messages. --- question/type/calculated/questiontype.php | 2 +- question/type/numerical/questiontype.php | 2 +- question/type/shortanswer/questiontype.php | 2 +- question/type/truefalse/questiontype.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php index 31e3a8738b..6ff0637b93 100644 --- a/question/type/calculated/questiontype.php +++ b/question/type/calculated/questiontype.php @@ -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; } diff --git a/question/type/numerical/questiontype.php b/question/type/numerical/questiontype.php index f4449591dc..0cfd258649 100644 --- a/question/type/numerical/questiontype.php +++ b/question/type/numerical/questiontype.php @@ -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); diff --git a/question/type/shortanswer/questiontype.php b/question/type/shortanswer/questiontype.php index 913b1e7bbb..ac999b95a5 100644 --- a/question/type/shortanswer/questiontype.php +++ b/question/type/shortanswer/questiontype.php @@ -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; diff --git a/question/type/truefalse/questiontype.php b/question/type/truefalse/questiontype.php index 1877b83cf7..a45bdc56ad 100644 --- a/question/type/truefalse/questiontype.php +++ b/question/type/truefalse/questiontype.php @@ -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; } -- 2.39.5