Skip to content

Commit

Permalink
MDL-54666 modedit: use default values when modgrade element is frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed May 21, 2016
1 parent 973641f commit 4ca17b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/form/modgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,12 @@ public function onQuickFormEvent($event, $arg, &$caller) {
'[modgrade_rescalegrades]', 'eq', '');

// A constant value should be given as an int.
// The default value should be an int and should really be $CFG->gradepointdefault.
// The default value should be an int and be either $CFG->gradepointdefault or whatever was set in set_data().
$value = $this->_findValue($caller->_constantValues);
if (null === $value) {
if ($caller->isSubmitted()) {
if ($caller->isSubmitted() && $this->_findValue($caller->_submitValues) !== null) {
// Submitted values are array, one value for each individual element in this group.
// When there is submitted data let parent::onQuickFormEvent() process it.
break;
}
$value = $this->_findValue($caller->_defaultValues);
Expand Down

0 comments on commit 4ca17b6

Please sign in to comment.