Skip to content

Commit

Permalink
MDL-46148 qtype_calculated: removed unused method.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Jul 9, 2014
1 parent db5a6e6 commit 770d3ce
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions question/type/calculated/questiontype.php
Expand Up @@ -346,49 +346,6 @@ protected function initialise_question_instance(question_definition $question, $
$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:<br />";
foreach ($calculatedmessages as $msg) {
$errorstring .= $msg . '<br />';
}
print_error($errorstring);
}

break;
default:
return parent::validate_form($form);
break;
}
return true;
}
public function finished_edit_wizard($form) {
return isset($form->savechanges);
}
Expand Down

0 comments on commit 770d3ce

Please sign in to comment.