Skip to content
Browse files

MDL-36076 qtype multichoice: validation fails on '0' answer.

  • Loading branch information...
1 parent f4b03cf commit 91a307c91878d35a07af6cca84dff9ba174d60ab @timhunt timhunt committed Oct 17, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 question/type/multichoice/edit_multichoice_form.php
View
4 question/type/multichoice/edit_multichoice_form.php
@@ -110,10 +110,10 @@ public function validation($data, $files) {
//check no of choices
$trimmedanswer = trim($answer['text']);
$fraction = (float) $data['fraction'][$key];
- if (empty($trimmedanswer) && empty($fraction)) {
+ if ($trimmedanswer === '' && empty($fraction)) {
continue;
}
- if (empty($trimmedanswer)) {
+ if ($trimmedanswer === '') {
$errors['fraction['.$key.']'] = get_string('errgradesetanswerblank', 'qtype_multichoice');
}

0 comments on commit 91a307c

Please sign in to comment.
Something went wrong with that request. Please try again.