Skip to content

Commit

Permalink
Merge branch 'MDL-48146_27' of git://github.com/timhunt/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_27_STABLE
  • Loading branch information
danpoltawski committed Nov 18, 2014
2 parents b734d64 + 00102db commit c2aac9f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mod/quiz/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ protected function definition() {
$this->standard_grading_coursemodule_elements();

$mform->removeElement('grade');
$mform->addElement('hidden', 'grade', $quizconfig->maximumgrade);
if (property_exists($this->current, 'grade')) {
$currentgrade = $this->current->grade;
} else {
$currentgrade = $quizconfig->maximumgrade;
}
$mform->addElement('hidden', 'grade', $currentgrade);
$mform->setType('grade', PARAM_FLOAT);

// Number of attempts.
Expand Down Expand Up @@ -487,7 +492,7 @@ public function data_preprocessing(&$toform) {

if ($feedback->mingrade > 0) {
$toform['feedbackboundaries['.$key.']'] =
(100.0 * $feedback->mingrade / $toform['grade']) . '%';
round(100.0 * $feedback->mingrade / $toform['grade'], 6) . '%';
}
$key++;
}
Expand Down

0 comments on commit c2aac9f

Please sign in to comment.