Skip to content

Commit

Permalink
MDL-36076 qtype multichoice: validation fails on '0' answer.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Oct 17, 2012
1 parent ecfe814 commit 16c7457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions question/type/multichoice/edit_multichoice_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit 16c7457

Please sign in to comment.