original_string: public function format_definition($line, $grade) {
          foreach ($this->definition() as $i => $field) {
              // Table tab index.
              $tab = ($i * $this->total) + $this->index;
              $classname = '\\gradereport_singleview\\local\\ui\\' . $field;
              $html = new $classname($grade, $tab);
  
              if ($field == 'finalgrade' and !empty($this->structure)) {
                  $html .= $this->structure->get_grade_analysis_icon($grade);
              }
  
              // Singleview users without proper permissions should be presented
              // disabled checkboxes for the Exclude grade attribute.
              if ($field == 'exclude' && !has_capability('moodle/grade:manage', $this->context)){
                  $html->disabled = true;
              }
  
              $line[] = $html;
          }
          return $line;
      }
code: public function format_definition($line, $grade) {
          foreach ($this->definition() as $i => $field) {
              // Table tab index.
              $tab = ($i * $this->total) + $this->index;
              $classname = '\\gradereport_singleview\\local\\ui\\' . $field;
              $html = new $classname($grade, $tab);
  
              if ($field == 'finalgrade' and !empty($this->structure)) {
                  $html .= $this->structure->get_grade_analysis_icon($grade);
              }
  
              // Singleview users without proper permissions should be presented
              // disabled checkboxes for the Exclude grade attribute.
              if ($field == 'exclude' && !has_capability('moodle/grade:manage', $this->context)){
                  $html->disabled = true;
              }
  
              $line[] = $html;
          }
          return $line;
      }
code_tokens: public function format_definition ( $ line , $ grade ) { foreach ( $ this -> definition ( ) as $ i => $ field ) { // Table tab index. $ tab = ( $ i * $ this -> total ) + $ this -> index ; $ classname = '\\gradereport_singleview\\local\\ui\\' . $ field ; $ html = new $ classname ( $ grade , $ tab ) ; if ( $ field == 'finalgrade' and ! empty ( $ this -> structure ) ) { $ html .= $ this -> structure -> get_grade_analysis_icon ( $ grade ) ; } // Singleview users without proper permissions should be presented // disabled checkboxes for the Exclude grade attribute. if ( $ field == 'exclude' && ! has_capability ( 'moodle/grade:manage' , $ this -> context ) ) { $ html -> disabled = true ; } $ line [ ] = $ html ; } return $ line ; }
docstring: Get a element to generate the HTML for this table row
  @param array $line This is a list of lines in the table (modified)
  @param grade_grade $grade The grade.
  @return string
docstring_tokens: Get a element to generate the HTML for this table row