Improve error messages.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user