original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Process the value for the group based on the selected grade type, and the input for the scale and point elements.
  
  @param  string $type The value of the grade type select box. Can be 'none', 'scale', or 'point'
  @param  string|int $scale The value of the scale select box.
  @param  string|int $point The value of the point grade textbox.
  @param  string $rescalegrades The value of the rescalegrades select.
  @return int The resulting value
docstring_tokens: Process the value for the group based on the selected grade type and the input for the scale and point elements .