original_string: public function get_data() {
          global $CFG;
          $data = parent::get_data();
          if ($data && $this->_customdata['multipledisplaytypes']) {
              if (count(array_filter($data->display)) == 0) {
                  // Ensure that a value was selected as the export plugins expect at least one value.
                  if ($CFG->grade_export_displaytype == GRADE_DISPLAY_TYPE_LETTER) {
                      $data->display['letter'] = GRADE_DISPLAY_TYPE_LETTER;
                  } else if ($CFG->grade_export_displaytype == GRADE_DISPLAY_TYPE_PERCENTAGE) {
                      $data->display['percentage'] = GRADE_DISPLAY_TYPE_PERCENTAGE;
                  } else {
                      $data->display['real'] = GRADE_DISPLAY_TYPE_REAL;
                  }
              }
          }
          return $data;
      }
code: public function get_data() {
          global $CFG;
          $data = parent::get_data();
          if ($data && $this->_customdata['multipledisplaytypes']) {
              if (count(array_filter($data->display)) == 0) {
                  // Ensure that a value was selected as the export plugins expect at least one value.
                  if ($CFG->grade_export_displaytype == GRADE_DISPLAY_TYPE_LETTER) {
                      $data->display['letter'] = GRADE_DISPLAY_TYPE_LETTER;
                  } else if ($CFG->grade_export_displaytype == GRADE_DISPLAY_TYPE_PERCENTAGE) {
                      $data->display['percentage'] = GRADE_DISPLAY_TYPE_PERCENTAGE;
                  } else {
                      $data->display['real'] = GRADE_DISPLAY_TYPE_REAL;
                  }
              }
          }
          return $data;
      }
code_tokens: public function get_data ( ) { global $ CFG ; $ data = parent :: get_data ( ) ; if ( $ data && $ this -> _customdata [ 'multipledisplaytypes' ] ) { if ( count ( array_filter ( $ data -> display ) ) == 0 ) { // Ensure that a value was selected as the export plugins expect at least one value. if ( $ CFG -> grade_export_displaytype == GRADE_DISPLAY_TYPE_LETTER ) { $ data -> display [ 'letter' ] = GRADE_DISPLAY_TYPE_LETTER ; } else if ( $ CFG -> grade_export_displaytype == GRADE_DISPLAY_TYPE_PERCENTAGE ) { $ data -> display [ 'percentage' ] = GRADE_DISPLAY_TYPE_PERCENTAGE ; } else { $ data -> display [ 'real' ] = GRADE_DISPLAY_TYPE_REAL ; } } } return $ data ; }
docstring: Overrides the mform get_data method.
  
  Created to force a value since the validation method does not work with multiple checkbox.
  
  @return stdClass form data object.
docstring_tokens: Overrides the mform get_data method .