Permalink
Browse files

Merge branch 'MDL-26324_19' of git://github.com/timhunt/moodle into M…

…OODLE_19_STABLE
  • Loading branch information...
2 parents f483e32 + 83f22aa commit cddf3e16790cf3ca690f154f0319c125cdfdb2bf @stronk7 stronk7 committed Mar 7, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 mod/quiz/mod_form.php
@@ -282,6 +282,14 @@ function data_preprocessing(&$default_values){
$key = 0;
foreach ($this->_feedbacks as $feedback){
$default_values['feedbacktext['.$key.']'] = $feedback->feedbacktext;
+ if ($default_values['grade'] == 0) {
+ // When a quiz is un-graded, there can only be one lot of
+ // feedback. If the quiz previously had a maximum grade and
+ // several lots of feedback, we must now avoid putting text
+ // into input boxes that are disabled, but which the
+ // validation will insist are blank.
+ break;
+ }
if ($feedback->mingrade > 0) {
$default_values['feedbackboundaries['.$key.']'] = (100.0 * $feedback->mingrade / $default_values['grade']) . '%';
}

0 comments on commit cddf3e1

Please sign in to comment.