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:47 +01:00
committed by Dan Poltawski
parent b46ec69145
commit 0509827f7e
+5 -1
View File
@@ -1064,10 +1064,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,