original_string: public function question(structure $structure, $slot, \moodle_url $pageurl) {
          $output = '';
          $output .= html_writer::start_tag('div');
  
          if ($structure->can_be_edited()) {
              $output .= $this->question_move_icon($structure, $slot);
          }
  
          $output .= html_writer::start_div('mod-indent-outer');
          $output .= html_writer::tag('input', '', array('id' => 'selectquestion-' .
                  $structure->get_displayed_number_for_slot($slot), 'name' => 'selectquestion[]',
                 'type' => 'checkbox', 'class' => 'select-multiple-checkbox',
                 'value' => $structure->get_displayed_number_for_slot($slot)));
          $output .= $this->question_number($structure->get_displayed_number_for_slot($slot));
  
          // This div is used to indent the content.
          $output .= html_writer::div('', 'mod-indent');
  
          // Display the link to the question (or do nothing if question has no url).
          if ($structure->get_question_type_for_slot($slot) == 'random') {
              $questionname = $this->random_question($structure, $slot, $pageurl);
          } else {
              $questionname = $this->question_name($structure, $slot, $pageurl);
          }
  
          // Start the div for the activity title, excluding the edit icons.
          $output .= html_writer::start_div('activityinstance');
          $output .= $questionname;
  
          // Closing the tag which contains everything but edit icons. Content part of the module should not be part of this.
          $output .= html_writer::end_tag('div'); // .activityinstance.
  
          // Action icons.
          $questionicons = '';
          $questionicons .= $this->question_preview_icon($structure->get_quiz(), $structure->get_question_in_slot($slot));
          if ($structure->can_be_edited()) {
              $questionicons .= $this->question_remove_icon($structure, $slot, $pageurl);
          }
          $questionicons .= $this->marked_out_of_field($structure, $slot);
          $output .= html_writer::span($questionicons, 'actions'); // Required to add js spinner icon.
          if ($structure->can_be_edited()) {
              $output .= $this->question_dependency_icon($structure, $slot);
          }
  
          // End of indentation div.
          $output .= html_writer::end_tag('div');
          $output .= html_writer::end_tag('div');
  
          return $output;
      }
code: public function question(structure $structure, $slot, \moodle_url $pageurl) {
          $output = '';
          $output .= html_writer::start_tag('div');
  
          if ($structure->can_be_edited()) {
              $output .= $this->question_move_icon($structure, $slot);
          }
  
          $output .= html_writer::start_div('mod-indent-outer');
          $output .= html_writer::tag('input', '', array('id' => 'selectquestion-' .
                  $structure->get_displayed_number_for_slot($slot), 'name' => 'selectquestion[]',
                 'type' => 'checkbox', 'class' => 'select-multiple-checkbox',
                 'value' => $structure->get_displayed_number_for_slot($slot)));
          $output .= $this->question_number($structure->get_displayed_number_for_slot($slot));
  
          // This div is used to indent the content.
          $output .= html_writer::div('', 'mod-indent');
  
          // Display the link to the question (or do nothing if question has no url).
          if ($structure->get_question_type_for_slot($slot) == 'random') {
              $questionname = $this->random_question($structure, $slot, $pageurl);
          } else {
              $questionname = $this->question_name($structure, $slot, $pageurl);
          }
  
          // Start the div for the activity title, excluding the edit icons.
          $output .= html_writer::start_div('activityinstance');
          $output .= $questionname;
  
          // Closing the tag which contains everything but edit icons. Content part of the module should not be part of this.
          $output .= html_writer::end_tag('div'); // .activityinstance.
  
          // Action icons.
          $questionicons = '';
          $questionicons .= $this->question_preview_icon($structure->get_quiz(), $structure->get_question_in_slot($slot));
          if ($structure->can_be_edited()) {
              $questionicons .= $this->question_remove_icon($structure, $slot, $pageurl);
          }
          $questionicons .= $this->marked_out_of_field($structure, $slot);
          $output .= html_writer::span($questionicons, 'actions'); // Required to add js spinner icon.
          if ($structure->can_be_edited()) {
              $output .= $this->question_dependency_icon($structure, $slot);
          }
  
          // End of indentation div.
          $output .= html_writer::end_tag('div');
          $output .= html_writer::end_tag('div');
  
          return $output;
      }
code_tokens: public function question ( structure $ structure , $ slot , \ moodle_url $ pageurl ) { $ output = '' ; $ output .= html_writer :: start_tag ( 'div' ) ; if ( $ structure -> can_be_edited ( ) ) { $ output .= $ this -> question_move_icon ( $ structure , $ slot ) ; } $ output .= html_writer :: start_div ( 'mod-indent-outer' ) ; $ output .= html_writer :: tag ( 'input' , '' , array ( 'id' => 'selectquestion-' . $ structure -> get_displayed_number_for_slot ( $ slot ) , 'name' => 'selectquestion[]' , 'type' => 'checkbox' , 'class' => 'select-multiple-checkbox' , 'value' => $ structure -> get_displayed_number_for_slot ( $ slot ) ) ) ; $ output .= $ this -> question_number ( $ structure -> get_displayed_number_for_slot ( $ slot ) ) ; // This div is used to indent the content. $ output .= html_writer :: div ( '' , 'mod-indent' ) ; // Display the link to the question (or do nothing if question has no url). if ( $ structure -> get_question_type_for_slot ( $ slot ) == 'random' ) { $ questionname = $ this -> random_question ( $ structure , $ slot , $ pageurl ) ; } else { $ questionname = $ this -> question_name ( $ structure , $ slot , $ pageurl ) ; } // Start the div for the activity title, excluding the edit icons. $ output .= html_writer :: start_div ( 'activityinstance' ) ; $ output .= $ questionname ; // Closing the tag which contains everything but edit icons. Content part of the module should not be part of this. $ output .= html_writer :: end_tag ( 'div' ) ; // .activityinstance. // Action icons. $ questionicons = '' ; $ questionicons .= $ this -> question_preview_icon ( $ structure -> get_quiz ( ) , $ structure -> get_question_in_slot ( $ slot ) ) ; if ( $ structure -> can_be_edited ( ) ) { $ questionicons .= $ this -> question_remove_icon ( $ structure , $ slot , $ pageurl ) ; } $ questionicons .= $ this -> marked_out_of_field ( $ structure , $ slot ) ; $ output .= html_writer :: span ( $ questionicons , 'actions' ) ; // Required to add js spinner icon. if ( $ structure -> can_be_edited ( ) ) { $ output .= $ this -> question_dependency_icon ( $ structure , $ slot ) ; } // End of indentation div. $ output .= html_writer :: end_tag ( 'div' ) ; $ output .= html_writer :: end_tag ( 'div' ) ; return $ output ; }
docstring: Display a question.
  
  @param structure $structure object containing the structure of the quiz.
  @param int $slot the first slot on the page we are outputting.
  @param \moodle_url $pageurl the canonical URL of this page.
  @return string HTML to output.
docstring_tokens: Display a question .