Skip to content
Browse files

Merge branch 'MDL-29818-master' of git://git.luns.net.uk/moodle

  • Loading branch information...
2 parents 7e4b098 + 5a6084c commit c11ccbfd8b650fdfc37b77c8a09e0074d010c4bd @nebgor nebgor committed Oct 24, 2011
View
6 question/type/multichoice/edit_multichoice_form.php
@@ -109,9 +109,13 @@ public function validation($data, $files) {
foreach ($answers as $key => $answer) {
//check no of choices
$trimmedanswer = trim($answer['text']);
- if (empty($trimmedanswer)) {
+ $fraction = (float) $data['fraction'][$key];
+ if (empty($trimmedanswer) && empty($fraction)) {
continue;
}
+ if (empty($trimmedanswer)) {
+ $errors['fraction['.$key.']'] = get_string('errgradesetanswerblank', 'qtype_multichoice');
+ }
$answercount++;
View
1 question/type/multichoice/lang/en/qtype_multichoice.php
@@ -41,6 +41,7 @@
$string['correctansweris'] = 'The correct answer is: {$a}.';
$string['correctfeedback'] = 'For any correct response';
$string['editingmultichoice'] = 'Editing a Multiple choice question';
+$string['errgradesetanswerblank'] = 'Grade set, but the Answer is blank';
$string['errfractionsaddwrong'] = 'The positive grades you have chosen do not add up to 100%<br />Instead, they add up to {$a}%';
$string['errfractionsnomax'] = 'One of the choices should be 100%, so that it is<br />possible to get a full grade for this question.';
$string['feedback'] = 'Feedback';

0 comments on commit c11ccbf

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