original_string: public function col_itemname(\stdClass $history) {
          // Make sure grade item is still present and link it to the module if possible.
          $itemid = $history->itemid;
          if (!empty($this->gradeitems[$itemid])) {
              if ($history->itemtype === 'mod' && !$this->is_downloading()) {
                  if (!empty($this->cms->instances[$history->itemmodule][$history->iteminstance])) {
                      $cm = $this->cms->instances[$history->itemmodule][$history->iteminstance];
                      $url = new \moodle_url('/mod/' . $history->itemmodule . '/view.php', array('id' => $cm->id));
                      return \html_writer::link($url, $this->gradeitems[$itemid]->get_name());
                  }
              }
              return $this->gradeitems[$itemid]->get_name();
          }
          return get_string('deleteditemid', 'gradereport_history', $history->itemid);
      }
code: public function col_itemname(\stdClass $history) {
          // Make sure grade item is still present and link it to the module if possible.
          $itemid = $history->itemid;
          if (!empty($this->gradeitems[$itemid])) {
              if ($history->itemtype === 'mod' && !$this->is_downloading()) {
                  if (!empty($this->cms->instances[$history->itemmodule][$history->iteminstance])) {
                      $cm = $this->cms->instances[$history->itemmodule][$history->iteminstance];
                      $url = new \moodle_url('/mod/' . $history->itemmodule . '/view.php', array('id' => $cm->id));
                      return \html_writer::link($url, $this->gradeitems[$itemid]->get_name());
                  }
              }
              return $this->gradeitems[$itemid]->get_name();
          }
          return get_string('deleteditemid', 'gradereport_history', $history->itemid);
      }
code_tokens: public function col_itemname ( \ stdClass $ history ) { // Make sure grade item is still present and link it to the module if possible. $ itemid = $ history -> itemid ; if ( ! empty ( $ this -> gradeitems [ $ itemid ] ) ) { if ( $ history -> itemtype === 'mod' && ! $ this -> is_downloading ( ) ) { if ( ! empty ( $ this -> cms -> instances [ $ history -> itemmodule ] [ $ history -> iteminstance ] ) ) { $ cm = $ this -> cms -> instances [ $ history -> itemmodule ] [ $ history -> iteminstance ] ; $ url = new \ moodle_url ( '/mod/' . $ history -> itemmodule . '/view.php' , array ( 'id' => $ cm -> id ) ) ; return \ html_writer :: link ( $ url , $ this -> gradeitems [ $ itemid ] -> get_name ( ) ) ; } } return $ this -> gradeitems [ $ itemid ] -> get_name ( ) ; } return get_string ( 'deleteditemid' , 'gradereport_history' , $ history -> itemid ) ; }
docstring: Method to display column itemname.
  
  @param \stdClass $history an entry of history record.
  
  @return string HTML to display
docstring_tokens: Method to display column itemname .