Permalink
Browse files

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

  • Loading branch information...
1 parent 6738413 commit db05d5953493cf9b1a3bff717acdd65a237c9397 @timhunt timhunt committed Oct 17, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 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 db05d59

Please sign in to comment.