예제 #1
0
 /**
  * Displays one question with the surrounding controls.
  *
  * @param structure $structure object containing the structure of the quiz.
  * @param int $slot the first slot on the page we are outputting.
  * @param \question_edit_contexts $contexts the relevant question bank contexts.
  * @param array $pagevars the variables from {@link \question_edit_setup()}.
  * @param \moodle_url $pageurl the canonical URL of this page.
  * @return string HTML to output.
  */
 public function page_row(structure $structure, $slot, $contexts, $pagevars, $pageurl)
 {
     $output = '';
     $pagenumber = $structure->get_page_number_for_slot($slot);
     // Put page in a heading for accessibility and styling.
     $page = $this->heading(get_string('page') . ' ' . $pagenumber, 4);
     if ($structure->is_first_slot_on_page($slot)) {
         // Add the add-menu at the page level.
         $addmenu = html_writer::tag('span', $this->add_menu_actions($structure, $pagenumber, $pageurl, $contexts, $pagevars), array('class' => 'add-menu-outer'));
         $addquestionform = $this->add_question_form($structure, $pagenumber, $pageurl, $pagevars);
         $output .= html_writer::tag('li', $page . $addmenu . $addquestionform, array('class' => 'pagenumber activity yui3-dd-drop page', 'id' => 'page-' . $pagenumber));
     }
     return $output;
 }