Merge branch 'MDL-42504' of git://github.com/timhunt/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 19 Nov 2013 02:30:16 +0000 (10:30 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 19 Nov 2013 02:30:16 +0000 (10:30 +0800)
1  2 
mod/quiz/renderer.php

diff --combined mod/quiz/renderer.php
@@@ -313,8 -313,7 +313,8 @@@ class mod_quiz_renderer extends plugin_
          }
          $output .= $panel->render_before_button_bits($this);
  
 -        $output .= html_writer::start_tag('div', array('class' => 'qn_buttons'));
 +        $bcc = $panel->get_button_container_class();
 +        $output .= html_writer::start_tag('div', array('class' => "qn_buttons $bcc"));
          foreach ($panel->get_question_buttons() as $button) {
              $output .= $this->render($button);
          }
          $output .= html_writer::end_tag('div');
          $output .= html_writer::end_tag('form');
  
+         $output .= $this->connection_warning();
          return $output;
      }
  
  
          return $this->heading($title, 3) . html_writer::tag('div', $graph, array('class' => 'graph'));
      }
+     /**
+      * Output the connection warning messages, which are initially hidden, and
+      * only revealed by JavaScript if necessary.
+      */
+     public function connection_warning() {
+         $options = array('filter' => false, 'newlines' => false);
+         $warning = format_text(get_string('connectionerror', 'quiz'), FORMAT_MARKDOWN, $options);
+         $ok = format_text(get_string('connectionok', 'quiz'), FORMAT_MARKDOWN, $options);
+         return html_writer::tag('div', $warning, array('id' => 'connection-error', 'style' => 'display: none;', 'role' => 'alert')) .
+                 html_writer::tag('div', $ok, array('id' => 'connection-ok', 'style' => 'display: none;', 'role' => 'alert'));
+     }
  }
  
  class mod_quiz_links_to_other_attempts implements renderable {