mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-36076 qtype multichoice: validation fails on '0' answer.
This commit is contained in:
parent
6738413b33
commit
db05d59534
1 changed files with 2 additions and 2 deletions
|
@ -110,10 +110,10 @@ class qtype_multichoice_edit_form extends question_edit_form {
|
||||||
//check no of choices
|
//check no of choices
|
||||||
$trimmedanswer = trim($answer['text']);
|
$trimmedanswer = trim($answer['text']);
|
||||||
$fraction = (float) $data['fraction'][$key];
|
$fraction = (float) $data['fraction'][$key];
|
||||||
if (empty($trimmedanswer) && empty($fraction)) {
|
if ($trimmedanswer === '' && empty($fraction)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (empty($trimmedanswer)) {
|
if ($trimmedanswer === '') {
|
||||||
$errors['fraction['.$key.']'] = get_string('errgradesetanswerblank', 'qtype_multichoice');
|
$errors['fraction['.$key.']'] = get_string('errgradesetanswerblank', 'qtype_multichoice');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue