Commit fe93ba83 authored by tjhunt's avatar tjhunt
Browse files

MDL-12133 - Errors calling parent::validation in a moodle form subclass...

MDL-12133 - Errors calling parent::validation in a moodle form subclass because the base class method signature was changed. This patch fixes all calls to parent::validation in the question editing forms. Merged from MOODLE_19_STABLE.
parent 828f84cf
......@@ -171,8 +171,8 @@ class question_edit_calculated_form extends question_edit_form {
return 'calculated';
}
function validation($data){
$errors = parent::validation($data);
function validation($data, $files){
$errors = parent::validation($data, $files);
//verifying for errors in {=...} in question text;
$qtext = "";
$qtextremaining = $data['questiontext'] ;
......
......@@ -70,8 +70,8 @@ class question_edit_match_form extends question_edit_form {
return 'match';
}
function validation($data){
$errors = parent::validation($data);
function validation($data, $files){
$errors = parent::validation($data, $files);
$answers = $data['subanswers'];
$questions = $data['subquestions'];
$questioncount = 0;
......
......@@ -66,8 +66,8 @@ class question_edit_missingtype_form extends question_edit_form {
return 'missingtype';
}
function validation($data){
$errors = parent::validation($data);
function validation($data, $files){
$errors = parent::validation($data, $files);
$answers = $data['answer'];
$answercount = 0;
......
......@@ -190,10 +190,10 @@ class question_edit_multianswer_form extends question_edit_form {
parent::set_data($question);
}
function validation($data){
function validation($data, $files){
$errors =array();
$parenterrors = parent::validation($data,'');
$parenterrors = parent::validation($data, $files);
if (is_array($parenterrors) && count($parenterrors)) {
if (is_array($errors)) {
$errors = array_merge($errors,$parenterrors);
......
......@@ -107,8 +107,8 @@ class question_edit_multichoice_form extends question_edit_form {
return 'multichoice';
}
function validation($data){
$errors = parent::validation($data);
function validation($data, $files){
$errors = parent::validation($data, $files);
$answers = $data['answer'];
$answercount = 0;
......
......@@ -107,8 +107,8 @@ class question_edit_numerical_form extends question_edit_form {
}
parent::set_data($question);
}
function validation($data){
$errors = parent::validation($data);
function validation($data, $files){
$errors = parent::validation($data, $files);
// Check the answers.
$answercount = 0;
......
......@@ -47,9 +47,9 @@ class question_edit_randomsamatch_form extends question_edit_form {
return 'randomsamatch';
}
function validation($data){
function validation($data, $files){
global $QTYPES;
$errors = parent::validation($data);
$errors = parent::validation($data, $files);
$saquestions = $QTYPES['randomsamatch']->get_sa_candidates($data['category']);
$numberavailable = count($saquestions);
if ($saquestions === false){
......
......@@ -69,8 +69,8 @@ class question_edit_shortanswer_form extends question_edit_form {
}
parent::set_data($question);
}
function validation($data){
$errors = parent::validation($data);
function validation($data, $files){
$errors = parent::validation($data, $files);
$answers = $data['answer'];
$answercount = 0;
$maxgrade = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment