original_string: public function get_left_avg_row($rows=array(), $colspan=1, $groupavg=false) {
          if (!$this->canviewhidden) {
              // totals might be affected by hiding, if user can not see hidden grades the aggregations might be altered
              // better not show them at all if user can not see all hideen grades
              return $rows;
          }
  
          $showaverages = $this->get_pref('showaverages');
          $showaveragesgroup = $this->currentgroup && $showaverages;
          $straveragegroup = get_string('groupavg', 'grades');
  
          if ($groupavg) {
              if ($showaveragesgroup) {
                  $groupavgrow = new html_table_row();
                  $groupavgrow->attributes['class'] = 'groupavg r'.$this->rowcount++;
                  $groupavgcell = new html_table_cell();
                  $groupavgcell->attributes['class'] = 'header range';
                  $groupavgcell->colspan = $colspan;
                  $groupavgcell->header = true;
                  $groupavgcell->scope = 'row';
                  $groupavgcell->text = $straveragegroup;
                  $groupavgrow->cells[] = $groupavgcell;
                  $rows[] = $groupavgrow;
              }
          } else {
              $straverage = get_string('overallaverage', 'grades');
  
              if ($showaverages) {
                  $avgrow = new html_table_row();
                  $avgrow->attributes['class'] = 'avg r'.$this->rowcount++;
                  $avgcell = new html_table_cell();
                  $avgcell->attributes['class'] = 'header range';
                  $avgcell->colspan = $colspan;
                  $avgcell->header = true;
                  $avgcell->scope = 'row';
                  $avgcell->text = $straverage;
                  $avgrow->cells[] = $avgcell;
                  $rows[] = $avgrow;
              }
          }
  
          return $rows;
      }
code: public function get_left_avg_row($rows=array(), $colspan=1, $groupavg=false) {
          if (!$this->canviewhidden) {
              // totals might be affected by hiding, if user can not see hidden grades the aggregations might be altered
              // better not show them at all if user can not see all hideen grades
              return $rows;
          }
  
          $showaverages = $this->get_pref('showaverages');
          $showaveragesgroup = $this->currentgroup && $showaverages;
          $straveragegroup = get_string('groupavg', 'grades');
  
          if ($groupavg) {
              if ($showaveragesgroup) {
                  $groupavgrow = new html_table_row();
                  $groupavgrow->attributes['class'] = 'groupavg r'.$this->rowcount++;
                  $groupavgcell = new html_table_cell();
                  $groupavgcell->attributes['class'] = 'header range';
                  $groupavgcell->colspan = $colspan;
                  $groupavgcell->header = true;
                  $groupavgcell->scope = 'row';
                  $groupavgcell->text = $straveragegroup;
                  $groupavgrow->cells[] = $groupavgcell;
                  $rows[] = $groupavgrow;
              }
          } else {
              $straverage = get_string('overallaverage', 'grades');
  
              if ($showaverages) {
                  $avgrow = new html_table_row();
                  $avgrow->attributes['class'] = 'avg r'.$this->rowcount++;
                  $avgcell = new html_table_cell();
                  $avgcell->attributes['class'] = 'header range';
                  $avgcell->colspan = $colspan;
                  $avgcell->header = true;
                  $avgcell->scope = 'row';
                  $avgcell->text = $straverage;
                  $avgrow->cells[] = $avgcell;
                  $rows[] = $avgrow;
              }
          }
  
          return $rows;
      }
code_tokens: public function get_left_avg_row ( $ rows = array ( ) , $ colspan = 1 , $ groupavg = false ) { if ( ! $ this -> canviewhidden ) { // totals might be affected by hiding, if user can not see hidden grades the aggregations might be altered // better not show them at all if user can not see all hideen grades return $ rows ; } $ showaverages = $ this -> get_pref ( 'showaverages' ) ; $ showaveragesgroup = $ this -> currentgroup && $ showaverages ; $ straveragegroup = get_string ( 'groupavg' , 'grades' ) ; if ( $ groupavg ) { if ( $ showaveragesgroup ) { $ groupavgrow = new html_table_row ( ) ; $ groupavgrow -> attributes [ 'class' ] = 'groupavg r' . $ this -> rowcount ++ ; $ groupavgcell = new html_table_cell ( ) ; $ groupavgcell -> attributes [ 'class' ] = 'header range' ; $ groupavgcell -> colspan = $ colspan ; $ groupavgcell -> header = true ; $ groupavgcell -> scope = 'row' ; $ groupavgcell -> text = $ straveragegroup ; $ groupavgrow -> cells [ ] = $ groupavgcell ; $ rows [ ] = $ groupavgrow ; } } else { $ straverage = get_string ( 'overallaverage' , 'grades' ) ; if ( $ showaverages ) { $ avgrow = new html_table_row ( ) ; $ avgrow -> attributes [ 'class' ] = 'avg r' . $ this -> rowcount ++ ; $ avgcell = new html_table_cell ( ) ; $ avgcell -> attributes [ 'class' ] = 'header range' ; $ avgcell -> colspan = $ colspan ; $ avgcell -> header = true ; $ avgcell -> scope = 'row' ; $ avgcell -> text = $ straverage ; $ avgrow -> cells [ ] = $ avgcell ; $ rows [ ] = $ avgrow ; } } return $ rows ; }
docstring: Builds and return the headers for the rows of averages, for the left part of the grader report.
  @param array $rows The Array of rows for the left part of the report
  @param int $colspan The number of columns this cell has to span
  @param bool $groupavg If true, returns the row for group averages, otherwise for overall averages
  @return array Array of rows for the left part of the report
docstring_tokens: Builds and return the headers for the rows of averages for the left part of the grader report .