protected function get_course_gradetopass($courseid) {
        if (!isset($this->coursesgradetopass[$courseid])) {
            // Get course grade_item.
            $courseitem = \grade_item::fetch_course_item($courseid);

            $ci = array();
            $ci['courseitemid'] = $courseitem->id;

            if ($courseitem->gradetype == GRADE_TYPE_VALUE && grade_floats_different($courseitem->gradepass, 0.0)) {
                $ci['gradetopass'] = $courseitem->gradepass;
            } else {
                $ci['gradetopass'] = null;
            }
            $this->coursesgradetopass[$courseid] = $ci;
        }

        return $this->coursesgradetopass[$courseid];
    }
protected function get_course_gradetopass($courseid) {
        if (!isset($this->coursesgradetopass[$courseid])) {
            // Get course grade_item.
            $courseitem = \grade_item::fetch_course_item($courseid);

            $ci = array();
            $ci['courseitemid'] = $courseitem->id;

            if ($courseitem->gradetype == GRADE_TYPE_VALUE && grade_floats_different($courseitem->gradepass, 0.0)) {
                $ci['gradetopass'] = $courseitem->gradepass;
            } else {
                $ci['gradetopass'] = null;
            }
            $this->coursesgradetopass[$courseid] = $ci;
        }

        return $this->coursesgradetopass[$courseid];
    }
protected function get_course_gradetopass ( $ courseid ) { if ( ! isset ( $ this -> coursesgradetopass [ $ courseid ] ) ) { // Get course grade_item. $ courseitem = \ grade_item :: fetch_course_item ( $ courseid ) ; $ ci = array ( ) ; $ ci [ 'courseitemid' ] = $ courseitem -> id ; if ( $ courseitem -> gradetype == GRADE_TYPE_VALUE && grade_floats_different ( $ courseitem -> gradepass , 0.0 ) ) { $ ci [ 'gradetopass' ] = $ courseitem -> gradepass ; } else { $ ci [ 'gradetopass' ] = null ; } $ this -> coursesgradetopass [ $ courseid ] = $ ci ; } return $ this -> coursesgradetopass [ $ courseid ] ; }
Returns the grade to pass a course.

Save the value in $coursesgradetopass array to prevent new accesses to the database.

@param int $courseid The course id.
@return array The courseitem id and the required grade to pass the course.
Returns the grade to pass a course .