Skip to content

Commit 770d3ce

Browse files
committed
MDL-46148 qtype_calculated: removed unused method.
1 parent db5a6e6 commit 770d3ce

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

Diff for: question/type/calculated/questiontype.php

-43
Original file line numberDiff line numberDiff line change
@@ -346,49 +346,6 @@ protected function initialise_question_instance(question_definition $question, $
346346
$question->datasetloader = new qtype_calculated_dataset_loader($questiondata->id);
347347
}
348348

349-
public function validate_form($form) {
350-
switch($form->wizardpage) {
351-
case 'question':
352-
$calculatedmessages = array();
353-
if (empty($form->name)) {
354-
$calculatedmessages[] = get_string('missingname', 'qtype_calculated');
355-
}
356-
if (empty($form->questiontext)) {
357-
$calculatedmessages[] = get_string('missingquestiontext', 'qtype_calculated');
358-
}
359-
// Verify formulas.
360-
foreach ($form->answers as $key => $answer) {
361-
if ('' === trim($answer)) {
362-
$calculatedmessages[] = get_string(
363-
'missingformula', 'qtype_calculated');
364-
}
365-
if ($formulaerrors = qtype_calculated_find_formula_errors($answer)) {
366-
$calculatedmessages[] = $formulaerrors;
367-
}
368-
if (! isset($form->tolerance[$key])) {
369-
$form->tolerance[$key] = 0.0;
370-
}
371-
if (! is_numeric($form->tolerance[$key])) {
372-
$calculatedmessages[] = get_string('xmustbenumeric', 'qtype_numerical',
373-
get_string('tolerance', 'qtype_calculated'));
374-
}
375-
}
376-
377-
if (!empty($calculatedmessages)) {
378-
$errorstring = "The following errors were found:<br />";
379-
foreach ($calculatedmessages as $msg) {
380-
$errorstring .= $msg . '<br />';
381-
}
382-
print_error($errorstring);
383-
}
384-
385-
break;
386-
default:
387-
return parent::validate_form($form);
388-
break;
389-
}
390-
return true;
391-
}
392349
public function finished_edit_wizard($form) {
393350
return isset($form->savechanges);
394351
}

0 commit comments

Comments
 (0)