original_string: public static function is_manual_grade_in_range($qubaid, $slot) {
          $prefix = 'q' . $qubaid . ':' . $slot . '_';
          $mark = question_utils::optional_param_mark($prefix . '-mark');
          $maxmark = optional_param($prefix . '-maxmark', null, PARAM_FLOAT);
          $minfraction = optional_param($prefix . ':minfraction', null, PARAM_FLOAT);
          $maxfraction = optional_param($prefix . ':maxfraction', null, PARAM_FLOAT);
          return $mark === '' ||
                  ($mark !== null && $mark >= $minfraction * $maxmark && $mark <= $maxfraction * $maxmark) ||
                  ($mark === null && $maxmark === null);
      }
code: public static function is_manual_grade_in_range($qubaid, $slot) {
          $prefix = 'q' . $qubaid . ':' . $slot . '_';
          $mark = question_utils::optional_param_mark($prefix . '-mark');
          $maxmark = optional_param($prefix . '-maxmark', null, PARAM_FLOAT);
          $minfraction = optional_param($prefix . ':minfraction', null, PARAM_FLOAT);
          $maxfraction = optional_param($prefix . ':maxfraction', null, PARAM_FLOAT);
          return $mark === '' ||
                  ($mark !== null && $mark >= $minfraction * $maxmark && $mark <= $maxfraction * $maxmark) ||
                  ($mark === null && $maxmark === null);
      }
code_tokens: public static function is_manual_grade_in_range ( $ qubaid , $ slot ) { $ prefix = 'q' . $ qubaid . ':' . $ slot . '_' ; $ mark = question_utils :: optional_param_mark ( $ prefix . '-mark' ) ; $ maxmark = optional_param ( $ prefix . '-maxmark' , null , PARAM_FLOAT ) ; $ minfraction = optional_param ( $ prefix . ':minfraction' , null , PARAM_FLOAT ) ; $ maxfraction = optional_param ( $ prefix . ':maxfraction' , null , PARAM_FLOAT ) ; return $ mark === '' || ( $ mark !== null && $ mark >= $ minfraction * $ maxmark && $ mark <= $ maxfraction * $ maxmark ) || ( $ mark === null && $ maxmark === null ) ; }
docstring: Validate that the manual grade submitted for a particular question is in range.
  @param int $qubaid the question_usage id.
  @param int $slot the slot number within the usage.
  @return bool whether the submitted data is in range.
docstring_tokens: Validate that the manual grade submitted for a particular question is in range .