original_string: 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];
      }
code: 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];
      }
code_tokens: 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 ] ; }
docstring: 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.
docstring_tokens: Returns the grade to pass a course .