original_string: public function output_html($data, $query='') {
          global $OUTPUT;
  
          $value  = $data['value'];
  
          $default = $this->get_defaultsetting();
          if (!is_null($default)) {
              $defaultinfo = array();
              if (isset($this->choices[$default['value']])) {
                  $defaultinfo[] = $this->choices[$default['value']];
              }
              if (!empty($default['forced'])) {
                  $defaultinfo[] = get_string('force');
              }
              if (!empty($default['adv'])) {
                  $defaultinfo[] = get_string('advanced');
              }
              $defaultinfo = implode(', ', $defaultinfo);
  
          } else {
              $defaultinfo = NULL;
          }
  
          $options = $this->choices;
          $context = (object) [
              'id' => $this->get_id(),
              'name' => $this->get_full_name(),
              'forced' => !empty($data['forced']),
              'advanced' => !empty($data['adv']),
              'options' => array_map(function($option) use ($options, $value) {
                  return [
                      'value' => $option,
                      'name' => $options[$option],
                      'selected' => $option == $value
                  ];
              }, array_keys($options)),
          ];
  
          $element = $OUTPUT->render_from_template('core_admin/setting_gradecat_combo', $context);
  
          return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $defaultinfo, $query);
      }
code: public function output_html($data, $query='') {
          global $OUTPUT;
  
          $value  = $data['value'];
  
          $default = $this->get_defaultsetting();
          if (!is_null($default)) {
              $defaultinfo = array();
              if (isset($this->choices[$default['value']])) {
                  $defaultinfo[] = $this->choices[$default['value']];
              }
              if (!empty($default['forced'])) {
                  $defaultinfo[] = get_string('force');
              }
              if (!empty($default['adv'])) {
                  $defaultinfo[] = get_string('advanced');
              }
              $defaultinfo = implode(', ', $defaultinfo);
  
          } else {
              $defaultinfo = NULL;
          }
  
          $options = $this->choices;
          $context = (object) [
              'id' => $this->get_id(),
              'name' => $this->get_full_name(),
              'forced' => !empty($data['forced']),
              'advanced' => !empty($data['adv']),
              'options' => array_map(function($option) use ($options, $value) {
                  return [
                      'value' => $option,
                      'name' => $options[$option],
                      'selected' => $option == $value
                  ];
              }, array_keys($options)),
          ];
  
          $element = $OUTPUT->render_from_template('core_admin/setting_gradecat_combo', $context);
  
          return format_admin_setting($this, $this->visiblename, $element, $this->description, true, '', $defaultinfo, $query);
      }
code_tokens: public function output_html ( $ data , $ query = '' ) { global $ OUTPUT ; $ value = $ data [ 'value' ] ; $ default = $ this -> get_defaultsetting ( ) ; if ( ! is_null ( $ default ) ) { $ defaultinfo = array ( ) ; if ( isset ( $ this -> choices [ $ default [ 'value' ] ] ) ) { $ defaultinfo [ ] = $ this -> choices [ $ default [ 'value' ] ] ; } if ( ! empty ( $ default [ 'forced' ] ) ) { $ defaultinfo [ ] = get_string ( 'force' ) ; } if ( ! empty ( $ default [ 'adv' ] ) ) { $ defaultinfo [ ] = get_string ( 'advanced' ) ; } $ defaultinfo = implode ( ', ' , $ defaultinfo ) ; } else { $ defaultinfo = NULL ; } $ options = $ this -> choices ; $ context = ( object ) [ 'id' => $ this -> get_id ( ) , 'name' => $ this -> get_full_name ( ) , 'forced' => ! empty ( $ data [ 'forced' ] ) , 'advanced' => ! empty ( $ data [ 'adv' ] ) , 'options' => array_map ( function ( $ option ) use ( $ options , $ value ) { return [ 'value' => $ option , 'name' => $ options [ $ option ] , 'selected' => $ option == $ value ] ; } , array_keys ( $ options ) ) , ] ; $ element = $ OUTPUT -> render_from_template ( 'core_admin/setting_gradecat_combo' , $ context ) ; return format_admin_setting ( $ this , $ this -> visiblename , $ element , $ this -> description , true , '' , $ defaultinfo , $ query ) ; }
docstring: Return XHTML to display the field and wrapping div
  
  @todo Add vartype handling to ensure $data is array
  @param array $data Associative array of value=>xx, forced=>xx, adv=>xx
  @param string $query
  @return string XHTML to display control
docstring_tokens: Return XHTML to display the field and wrapping div