public function validate_manual_mark($currentmark) {
        if ($currentmark === null || $currentmark === '') {
            return '';
        }

        $mark = question_utils::clean_param_mark($currentmark);
        if ($mark === null) {
            return get_string('manualgradeinvalidformat', 'question');
        }

        $maxmark = $this->get_max_mark();
        if ($mark > $maxmark * $this->get_max_fraction() || $mark < $maxmark * $this->get_min_fraction()) {
            return get_string('manualgradeoutofrange', 'question');
        }

        return '';
    }
public function validate_manual_mark($currentmark) {
        if ($currentmark === null || $currentmark === '') {
            return '';
        }

        $mark = question_utils::clean_param_mark($currentmark);
        if ($mark === null) {
            return get_string('manualgradeinvalidformat', 'question');
        }

        $maxmark = $this->get_max_mark();
        if ($mark > $maxmark * $this->get_max_fraction() || $mark < $maxmark * $this->get_min_fraction()) {
            return get_string('manualgradeoutofrange', 'question');
        }

        return '';
    }
public function validate_manual_mark ( $ currentmark ) { if ( $ currentmark === null || $ currentmark === '' ) { return '' ; } $ mark = question_utils :: clean_param_mark ( $ currentmark ) ; if ( $ mark === null ) { return get_string ( 'manualgradeinvalidformat' , 'question' ) ; } $ maxmark = $ this -> get_max_mark ( ) ; if ( $ mark > $ maxmark * $ this -> get_max_fraction ( ) || $ mark < $ maxmark * $ this -> get_min_fraction ( ) ) { return get_string ( 'manualgradeoutofrange' , 'question' ) ; } return '' ; }
Validate the manual mark for a question.
@param string $currentmark the user input (e.g. '1,0', '1,0' or 'invalid'.
@return string any errors with the value, or '' if it is OK.
Validate the manual mark for a question .