original_string: public static function fetch_grade_items($courseid) {
          $gradeitems = null;
          if ($allgradeitems = grade_item::fetch_all(array('courseid' => $courseid))) {
              foreach ($allgradeitems as $gradeitem) {
                  // Skip course type and category type.
                  if ($gradeitem->itemtype == 'course' || $gradeitem->itemtype == 'category') {
                      continue;
                  }
  
                  $displaystring = null;
                  if (!empty($gradeitem->itemmodule)) {
                      $displaystring = get_string('modulename', $gradeitem->itemmodule).get_string('labelsep', 'langconfig')
                              .$gradeitem->get_name();
                  } else {
                      $displaystring = $gradeitem->get_name();
                  }
                  $gradeitems[$gradeitem->id] = $displaystring;
              }
          }
          return $gradeitems;
      }
code: public static function fetch_grade_items($courseid) {
          $gradeitems = null;
          if ($allgradeitems = grade_item::fetch_all(array('courseid' => $courseid))) {
              foreach ($allgradeitems as $gradeitem) {
                  // Skip course type and category type.
                  if ($gradeitem->itemtype == 'course' || $gradeitem->itemtype == 'category') {
                      continue;
                  }
  
                  $displaystring = null;
                  if (!empty($gradeitem->itemmodule)) {
                      $displaystring = get_string('modulename', $gradeitem->itemmodule).get_string('labelsep', 'langconfig')
                              .$gradeitem->get_name();
                  } else {
                      $displaystring = $gradeitem->get_name();
                  }
                  $gradeitems[$gradeitem->id] = $displaystring;
              }
          }
          return $gradeitems;
      }
code_tokens: public static function fetch_grade_items ( $ courseid ) { $ gradeitems = null ; if ( $ allgradeitems = grade_item :: fetch_all ( array ( 'courseid' => $ courseid ) ) ) { foreach ( $ allgradeitems as $ gradeitem ) { // Skip course type and category type. if ( $ gradeitem -> itemtype == 'course' || $ gradeitem -> itemtype == 'category' ) { continue ; } $ displaystring = null ; if ( ! empty ( $ gradeitem -> itemmodule ) ) { $ displaystring = get_string ( 'modulename' , $ gradeitem -> itemmodule ) . get_string ( 'labelsep' , 'langconfig' ) . $ gradeitem -> get_name ( ) ; } else { $ displaystring = $ gradeitem -> get_name ( ) ; } $ gradeitems [ $ gradeitem -> id ] = $ displaystring ; } } return $ gradeitems ; }
docstring: Gets all of the grade items in this course.
  
  @param int $courseid Course id;
  @return array An array of grade items for the course.
docstring_tokens: Gets all of the grade items in this course .