From 6a8d442b0f2f62fbc300d34d912bcb4e1fa3c91e Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 9 Jul 2014 12:56:18 +0100 Subject: [PATCH] MDL-46148 qtype_calculated: removed unused method. --- question/type/calculated/questiontype.php | 43 ----------------------- 1 file changed, 43 deletions(-) diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php index fb0ed991c78..9ae35362780 100644 --- a/question/type/calculated/questiontype.php +++ b/question/type/calculated/questiontype.php @@ -346,49 +346,6 @@ class qtype_calculated extends question_type { $question->datasetloader = new qtype_calculated_dataset_loader($questiondata->id); } - public function validate_form($form) { - switch($form->wizardpage) { - case 'question': - $calculatedmessages = array(); - if (empty($form->name)) { - $calculatedmessages[] = get_string('missingname', 'qtype_calculated'); - } - if (empty($form->questiontext)) { - $calculatedmessages[] = get_string('missingquestiontext', 'qtype_calculated'); - } - // Verify formulas. - foreach ($form->answers as $key => $answer) { - if ('' === trim($answer)) { - $calculatedmessages[] = get_string( - 'missingformula', 'qtype_calculated'); - } - if ($formulaerrors = qtype_calculated_find_formula_errors($answer)) { - $calculatedmessages[] = $formulaerrors; - } - if (! isset($form->tolerance[$key])) { - $form->tolerance[$key] = 0.0; - } - if (! is_numeric($form->tolerance[$key])) { - $calculatedmessages[] = get_string('xmustbenumeric', 'qtype_numerical', - get_string('tolerance', 'qtype_calculated')); - } - } - - if (!empty($calculatedmessages)) { - $errorstring = "The following errors were found:
"; - foreach ($calculatedmessages as $msg) { - $errorstring .= $msg . '
'; - } - print_error($errorstring); - } - - break; - default: - return parent::validate_form($form); - break; - } - return true; - } public function finished_edit_wizard($form) { return isset($form->savechanges); }