original_string: protected function submit_button(question_attempt $qa, question_display_options $options) {
          if (!$qa->get_state()->is_active()) {
              return '';
          }
          $attributes = array(
              'type' => 'submit',
              'id' => $qa->get_behaviour_field_name('submit'),
              'name' => $qa->get_behaviour_field_name('submit'),
              'value' => get_string('check', 'question'),
              'class' => 'submit btn btn-secondary',
          );
          if ($options->readonly) {
              $attributes['disabled'] = 'disabled';
          }
          $output = html_writer::empty_tag('input', $attributes);
          if (!$options->readonly) {
              $this->page->requires->js_init_call('M.core_question_engine.init_submit_button',
                      array($attributes['id'], $qa->get_slot()));
          }
          return $output;
      }
code: protected function submit_button(question_attempt $qa, question_display_options $options) {
          if (!$qa->get_state()->is_active()) {
              return '';
          }
          $attributes = array(
              'type' => 'submit',
              'id' => $qa->get_behaviour_field_name('submit'),
              'name' => $qa->get_behaviour_field_name('submit'),
              'value' => get_string('check', 'question'),
              'class' => 'submit btn btn-secondary',
          );
          if ($options->readonly) {
              $attributes['disabled'] = 'disabled';
          }
          $output = html_writer::empty_tag('input', $attributes);
          if (!$options->readonly) {
              $this->page->requires->js_init_call('M.core_question_engine.init_submit_button',
                      array($attributes['id'], $qa->get_slot()));
          }
          return $output;
      }
code_tokens: protected function submit_button ( question_attempt $ qa , question_display_options $ options ) { if ( ! $ qa -> get_state ( ) -> is_active ( ) ) { return '' ; } $ attributes = array ( 'type' => 'submit' , 'id' => $ qa -> get_behaviour_field_name ( 'submit' ) , 'name' => $ qa -> get_behaviour_field_name ( 'submit' ) , 'value' => get_string ( 'check' , 'question' ) , 'class' => 'submit btn btn-secondary' , ) ; if ( $ options -> readonly ) { $ attributes [ 'disabled' ] = 'disabled' ; } $ output = html_writer :: empty_tag ( 'input' , $ attributes ) ; if ( ! $ options -> readonly ) { $ this -> page -> requires -> js_init_call ( 'M.core_question_engine.init_submit_button' , array ( $ attributes [ 'id' ] , $ qa -> get_slot ( ) ) ) ; } return $ output ; }
docstring: Several behaviours need a submit button, so put the common code here.
  The button is disabled if the question is displayed read-only.
  @param question_display_options $options controls what should and should not be displayed.
  @return string HTML fragment.
docstring_tokens: Several behaviours need a submit button so put the common code here . The button is disabled if the question is displayed read - only .