MDL-46148 qtype_calculatedsimple: fix notice

... when adding a dataset with a formula error.
This commit is contained in:
Tim Hunt
2014-07-09 14:11:43 +01:00
committed by Dan Poltawski
parent 7bf7ef3919
commit 20af9d3c0f
+5 -1
View File
@@ -1061,10 +1061,14 @@ class qtype_calculated extends question_type {
}
$answers = fullclone($answers);
$errors = '';
$delimiter = ': ';
$virtualqtype = $qtypeobj->get_virtual_qtype();
foreach ($answers as $key => $answer) {
$error = qtype_calculated_find_formula_errors($answer->answer);
if ($error) {
$comment->stranswers[$key] = $error;
continue;
}
$formula = $this->substitute_variables($answer->answer, $data);
$formattedanswer = qtype_calculated_calculate_answer(
$answer->answer, $data, $answer->tolerance,