original_string: public function question_setup($reporturl, $questiondata, $s, $responseanalysis) {
          $this->questiondata = $questiondata;
          $this->s = $s;
  
          $this->define_baseurl($reporturl->out());
          $this->collapsible(false);
          $this->set_attribute('class', 'generaltable generalbox boxaligncenter quizresponseanalysis');
  
          // Define the table columns.
          $columns = array();
          $headers = array();
  
          if ($responseanalysis->has_subparts()) {
              $columns[] = 'part';
              $headers[] = get_string('partofquestion', 'quiz_statistics');
          }
  
          if ($responseanalysis->has_multiple_response_classes()) {
              $columns[] = 'responseclass';
              $headers[] = get_string('modelresponse', 'quiz_statistics');
  
              if ($responseanalysis->has_actual_responses()) {
                  $columns[] = 'response';
                  $headers[] = get_string('actualresponse', 'quiz_statistics');
              }
  
          } else {
              $columns[] = 'response';
              $headers[] = get_string('response', 'quiz_statistics');
          }
  
          $columns[] = 'fraction';
          $headers[] = get_string('optiongrade', 'quiz_statistics');
  
          if (!$responseanalysis->has_multiple_tries_data()) {
              $columns[] = 'totalcount';
              $headers[] = get_string('count', 'quiz_statistics');
          } else {
              $countcolumns = range(1, $responseanalysis->get_maximum_tries());
              foreach ($countcolumns as $countcolumn) {
                  $columns[] = 'trycount'.$countcolumn;
                  $headers[] = get_string('counttryno', 'quiz_statistics', $countcolumn);
              }
          }
  
          $columns[] = 'frequency';
          $headers[] = get_string('frequency', 'quiz_statistics');
  
          $this->define_columns($columns);
          $this->define_headers($headers);
          $this->sortable(false);
  
          $this->column_class('fraction', 'numcol');
          $this->column_class('count', 'numcol');
          $this->column_class('frequency', 'numcol');
  
          $this->column_suppress('part');
          $this->column_suppress('responseclass');
  
          parent::setup();
      }
code: public function question_setup($reporturl, $questiondata, $s, $responseanalysis) {
          $this->questiondata = $questiondata;
          $this->s = $s;
  
          $this->define_baseurl($reporturl->out());
          $this->collapsible(false);
          $this->set_attribute('class', 'generaltable generalbox boxaligncenter quizresponseanalysis');
  
          // Define the table columns.
          $columns = array();
          $headers = array();
  
          if ($responseanalysis->has_subparts()) {
              $columns[] = 'part';
              $headers[] = get_string('partofquestion', 'quiz_statistics');
          }
  
          if ($responseanalysis->has_multiple_response_classes()) {
              $columns[] = 'responseclass';
              $headers[] = get_string('modelresponse', 'quiz_statistics');
  
              if ($responseanalysis->has_actual_responses()) {
                  $columns[] = 'response';
                  $headers[] = get_string('actualresponse', 'quiz_statistics');
              }
  
          } else {
              $columns[] = 'response';
              $headers[] = get_string('response', 'quiz_statistics');
          }
  
          $columns[] = 'fraction';
          $headers[] = get_string('optiongrade', 'quiz_statistics');
  
          if (!$responseanalysis->has_multiple_tries_data()) {
              $columns[] = 'totalcount';
              $headers[] = get_string('count', 'quiz_statistics');
          } else {
              $countcolumns = range(1, $responseanalysis->get_maximum_tries());
              foreach ($countcolumns as $countcolumn) {
                  $columns[] = 'trycount'.$countcolumn;
                  $headers[] = get_string('counttryno', 'quiz_statistics', $countcolumn);
              }
          }
  
          $columns[] = 'frequency';
          $headers[] = get_string('frequency', 'quiz_statistics');
  
          $this->define_columns($columns);
          $this->define_headers($headers);
          $this->sortable(false);
  
          $this->column_class('fraction', 'numcol');
          $this->column_class('count', 'numcol');
          $this->column_class('frequency', 'numcol');
  
          $this->column_suppress('part');
          $this->column_suppress('responseclass');
  
          parent::setup();
      }
code_tokens: public function question_setup ( $ reporturl , $ questiondata , $ s , $ responseanalysis ) { $ this -> questiondata = $ questiondata ; $ this -> s = $ s ; $ this -> define_baseurl ( $ reporturl -> out ( ) ) ; $ this -> collapsible ( false ) ; $ this -> set_attribute ( 'class' , 'generaltable generalbox boxaligncenter quizresponseanalysis' ) ; // Define the table columns. $ columns = array ( ) ; $ headers = array ( ) ; if ( $ responseanalysis -> has_subparts ( ) ) { $ columns [ ] = 'part' ; $ headers [ ] = get_string ( 'partofquestion' , 'quiz_statistics' ) ; } if ( $ responseanalysis -> has_multiple_response_classes ( ) ) { $ columns [ ] = 'responseclass' ; $ headers [ ] = get_string ( 'modelresponse' , 'quiz_statistics' ) ; if ( $ responseanalysis -> has_actual_responses ( ) ) { $ columns [ ] = 'response' ; $ headers [ ] = get_string ( 'actualresponse' , 'quiz_statistics' ) ; } } else { $ columns [ ] = 'response' ; $ headers [ ] = get_string ( 'response' , 'quiz_statistics' ) ; } $ columns [ ] = 'fraction' ; $ headers [ ] = get_string ( 'optiongrade' , 'quiz_statistics' ) ; if ( ! $ responseanalysis -> has_multiple_tries_data ( ) ) { $ columns [ ] = 'totalcount' ; $ headers [ ] = get_string ( 'count' , 'quiz_statistics' ) ; } else { $ countcolumns = range ( 1 , $ responseanalysis -> get_maximum_tries ( ) ) ; foreach ( $ countcolumns as $ countcolumn ) { $ columns [ ] = 'trycount' . $ countcolumn ; $ headers [ ] = get_string ( 'counttryno' , 'quiz_statistics' , $ countcolumn ) ; } } $ columns [ ] = 'frequency' ; $ headers [ ] = get_string ( 'frequency' , 'quiz_statistics' ) ; $ this -> define_columns ( $ columns ) ; $ this -> define_headers ( $ headers ) ; $ this -> sortable ( false ) ; $ this -> column_class ( 'fraction' , 'numcol' ) ; $ this -> column_class ( 'count' , 'numcol' ) ; $ this -> column_class ( 'frequency' , 'numcol' ) ; $ this -> column_suppress ( 'part' ) ; $ this -> column_suppress ( 'responseclass' ) ; parent :: setup ( ) ; }
docstring: Set up columns and column names and other table settings.
  
  @param moodle_url $reporturl
  @param object     $questiondata
  @param integer    $s             number of attempts on this question.
  @param \core_question\statistics\responses\analysis_for_question $responseanalysis
docstring_tokens: Set up columns and column names and other table settings .