protected function validate_scale($val) {
        global $COURSE;
        $scales = get_scales_menu($COURSE->id);
        return (!empty($val) && isset($scales[(int)$val])) ? true : false;
    }
protected function validate_scale($val) {
        global $COURSE;
        $scales = get_scales_menu($COURSE->id);
        return (!empty($val) && isset($scales[(int)$val])) ? true : false;
    }
protected function validate_scale ( $ val ) { global $ COURSE ; $ scales = get_scales_menu ( $ COURSE -> id ) ; return ( ! empty ( $ val ) && isset ( $ scales [ ( int ) $ val ] ) ) ? true : false ; }
Determines whether a given value is a valid scale selection.

@param string|int $val The value to test.
@return bool Valid or invalid
Determines whether a given value is a valid scale selection .