mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'MDL-67218-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
ec99ffd352
@ -285,10 +285,18 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_group {
|
||||
protected function process_value($type='none', $scale=null, $point=null, $rescalegrades=null) {
|
||||
global $COURSE;
|
||||
$val = 0;
|
||||
if ($this->isupdate && $this->hasgrades && $this->canrescale && $this->currentgradetype == 'point' && empty($rescalegrades)) {
|
||||
// If the maxgrade field is disabled with javascript, no value is sent with the form and mform assumes the default.
|
||||
|
||||
// If the maxgrade field is disabled with javascript, no value is sent with the form and mform assumes the default.
|
||||
if ($this->isupdate && $this->hasgrades && $this->currentgradetype == 'point') {
|
||||
// If the user cannot rescale, then return the original.
|
||||
$returnoriginal = !$this->canrescale;
|
||||
|
||||
// If the user was forced to choose a rescale option - and they haven't - prevent any changes to the max grade.
|
||||
return (string)unformat_float($this->currentgrade);
|
||||
$returnoriginal = $returnoriginal || ($this->canrescale && empty($rescalegrades));
|
||||
|
||||
if ($returnoriginal) {
|
||||
return (string)unformat_float($this->currentgrade);
|
||||
}
|
||||
}
|
||||
switch ($type) {
|
||||
case 'point':
|
||||
|
Loading…
x
Reference in New Issue
Block a user