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 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);
        }
        switch ($type) {
            case 'point':
                if ($this->validate_point($point) === true) {
                    $val = (int)$point;
                }
                break;

            case 'scale':
                if ($this->validate_scale($scale)) {
                    $val = (int)(-$scale);
                }
                break;
        }
        return $val;
    }