original_string: public function section_shuffle_questions(structure $structure, $section) {
          $checkboxattributes = array(
              'type' => 'checkbox',
              'id' => 'shuffle-' . $section->id,
              'value' => 1,
              'data-action' => 'shuffle_questions',
              'class' => 'cm-edit-action',
          );
  
          if (!$structure->can_be_edited()) {
              $checkboxattributes['disabled'] = 'disabled';
          }
          if ($section->shufflequestions) {
              $checkboxattributes['checked'] = 'checked';
          }
  
          if ($structure->is_first_section($section)) {
              $help = $this->help_icon('shufflequestions', 'quiz');
          } else {
              $help = '';
          }
  
          $helpspan = html_writer::span($help, 'shuffle-help-tip');
          $progressspan = html_writer::span('', 'shuffle-progress');
          $checkbox = html_writer::empty_tag('input', $checkboxattributes);
          $label = html_writer::label(get_string('shufflequestions', 'quiz'),
                  $checkboxattributes['id'], false);
          return html_writer::span($progressspan . $checkbox . $label. ' ' . $helpspan,
                  'instanceshufflequestions', array('data-action' => 'shuffle_questions'));
      }
code: public function section_shuffle_questions(structure $structure, $section) {
          $checkboxattributes = array(
              'type' => 'checkbox',
              'id' => 'shuffle-' . $section->id,
              'value' => 1,
              'data-action' => 'shuffle_questions',
              'class' => 'cm-edit-action',
          );
  
          if (!$structure->can_be_edited()) {
              $checkboxattributes['disabled'] = 'disabled';
          }
          if ($section->shufflequestions) {
              $checkboxattributes['checked'] = 'checked';
          }
  
          if ($structure->is_first_section($section)) {
              $help = $this->help_icon('shufflequestions', 'quiz');
          } else {
              $help = '';
          }
  
          $helpspan = html_writer::span($help, 'shuffle-help-tip');
          $progressspan = html_writer::span('', 'shuffle-progress');
          $checkbox = html_writer::empty_tag('input', $checkboxattributes);
          $label = html_writer::label(get_string('shufflequestions', 'quiz'),
                  $checkboxattributes['id'], false);
          return html_writer::span($progressspan . $checkbox . $label. ' ' . $helpspan,
                  'instanceshufflequestions', array('data-action' => 'shuffle_questions'));
      }
code_tokens: public function section_shuffle_questions ( structure $ structure , $ section ) { $ checkboxattributes = array ( 'type' => 'checkbox' , 'id' => 'shuffle-' . $ section -> id , 'value' => 1 , 'data-action' => 'shuffle_questions' , 'class' => 'cm-edit-action' , ) ; if ( ! $ structure -> can_be_edited ( ) ) { $ checkboxattributes [ 'disabled' ] = 'disabled' ; } if ( $ section -> shufflequestions ) { $ checkboxattributes [ 'checked' ] = 'checked' ; } if ( $ structure -> is_first_section ( $ section ) ) { $ help = $ this -> help_icon ( 'shufflequestions' , 'quiz' ) ; } else { $ help = '' ; } $ helpspan = html_writer :: span ( $ help , 'shuffle-help-tip' ) ; $ progressspan = html_writer :: span ( '' , 'shuffle-progress' ) ; $ checkbox = html_writer :: empty_tag ( 'input' , $ checkboxattributes ) ; $ label = html_writer :: label ( get_string ( 'shufflequestions' , 'quiz' ) , $ checkboxattributes [ 'id' ] , false ) ; return html_writer :: span ( $ progressspan . $ checkbox . $ label . ' ' . $ helpspan , 'instanceshufflequestions' , array ( 'data-action' => 'shuffle_questions' ) ) ; }
docstring: Display a checkbox for shuffling question within a section.
  
  @param structure $structure object containing the structure of the quiz.
  @param \stdClass $section data from the quiz_section table.
  @return string HTML to output.
docstring_tokens: Display a checkbox for shuffling question within a section .