mirror of
https://github.com/moodle/moodle.git
synced 2025-03-13 20:26:32 +01:00
better validation of null answers MDL-8475
This commit is contained in:
parent
91472e08ba
commit
f7443920c8
@ -124,6 +124,14 @@ 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 (trim($data['feedback'][$key]) != ''){
|
||||
$errors["feedback[$key]"]=get_string('feedback','quiz').'='.htmlspecialchars(trim($data['feedback'][$key]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($answercount==0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user