better validation of null answers MDL-8475 merged from HEAD
This commit is contained in:
@@ -126,6 +126,11 @@ class question_edit_numerical_form extends question_edit_form {
|
||||
if ($data['fraction'][$key] == 1) {
|
||||
$maxgrade = true;
|
||||
}
|
||||
} else {
|
||||
if ($data['fraction'][$key] !=0 || trim($data['feedback'][$key]) != ''){
|
||||
$errors["answer[$key]"] = get_string('answermustbenumberorstar', 'qtype_numerical');
|
||||
$answercount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($answercount==0){
|
||||
|
||||
Reference in New Issue
Block a user