Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-29818-MOODLE_21_STABLE' of git://git.luns.net.uk/mo…

…odle into MOODLE_21_STABLE
  • Loading branch information...
commit b35dc1beb7c699aa0b96ae5286fa285dd84041dd 2 parents e4f1b4d + 73ebb5d
Aparup Banerjee nebgor authored
6 question/type/multichoice/edit_multichoice_form.php
@@ -109,9 +109,13 @@ public function validation($data, $files) {
109 109 foreach ($answers as $key => $answer) {
110 110 //check no of choices
111 111 $trimmedanswer = trim($answer['text']);
112   - if (empty($trimmedanswer)) {
  112 + $fraction = (float) $data['fraction'][$key];
  113 + if (empty($trimmedanswer) && empty($fraction)) {
113 114 continue;
114 115 }
  116 + if (empty($trimmedanswer)) {
  117 + $errors['fraction['.$key.']'] = get_string('errgradesetanswerblank', 'qtype_multichoice');
  118 + }
115 119
116 120 $answercount++;
117 121
1  question/type/multichoice/lang/en/qtype_multichoice.php
@@ -41,6 +41,7 @@
41 41 $string['correctansweris'] = 'The correct answer is: {$a}.';
42 42 $string['correctfeedback'] = 'For any correct response';
43 43 $string['editingmultichoice'] = 'Editing a Multiple choice question';
  44 +$string['errgradesetanswerblank'] = 'Grade set, but the Answer is blank';
44 45 $string['errfractionsaddwrong'] = 'The positive grades you have chosen do not add up to 100%<br />Instead, they add up to {$a}%';
45 46 $string['errfractionsnomax'] = 'One of the choices should be 100%, so that it is<br />possible to get a full grade for this question.';
46 47 $string['feedback'] = 'Feedback';

0 comments on commit b35dc1b

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