Example #1
0
 /**
  * Outputs the navigation block panel
  *
  * @param quiz_nav_panel_base $panel instance of quiz_nav_panel_base
  */
 public function navigation_panel(quiz_nav_panel_base $panel)
 {
     $output = '';
     $userpicture = $panel->user_picture();
     if ($userpicture) {
         $fullname = fullname($userpicture->user);
         if ($userpicture->size === true) {
             $fullname = html_writer::div($fullname);
         }
         $output .= html_writer::tag('div', $this->render($userpicture) . $fullname, array('id' => 'user-picture', 'class' => 'clearfix'));
     }
     $output .= $panel->render_before_button_bits($this);
     $bcc = $panel->get_button_container_class();
     $output .= html_writer::start_tag('div', array('class' => "qn_buttons clearfix {$bcc}"));
     foreach ($panel->get_question_buttons() as $button) {
         $output .= $this->render($button);
     }
     $output .= html_writer::end_tag('div');
     $output .= html_writer::tag('div', $panel->render_end_bits($this), array('class' => 'othernav'));
     $this->page->requires->js_init_call('M.mod_quiz.nav.init', null, false, quiz_get_js_module());
     return $output;
 }