Merge branch 'MDL-34187_23' of git://github.com/timhunt/moodle into MOODLE_23_STABLE
authorDan Poltawski <dan@moodle.com>
Mon, 16 Jul 2012 07:57:31 +0000 (15:57 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 16 Jul 2012 07:57:31 +0000 (15:57 +0800)
1  2 
mod/quiz/renderer.php

diff --combined mod/quiz/renderer.php
@@@ -509,8 -509,8 +509,8 @@@ class mod_quiz_renderer extends plugin_
              $output .= html_writer::tag('p', get_string('pleaseclose', 'quiz'));
              $delay = 0;
          }
-         $this->page->requires->js_function_call('M.mod_quiz.secure_window.close',
-                 array($url, $delay));
+         $this->page->requires->js_init_call('M.mod_quiz.secure_window.close',
+                 array($url, $delay), false, quiz_get_js_module());
  
          $output .= $this->box_end();
          $output .= $this->footer();
                  'id' => $cm->id, 'mode' => quiz_report_default_report($context)));
          return html_writer::link($url, $summary);
      }
 +
 +    /**
 +     * Output a graph, or a message saying that GD is required.
 +     * @param moodle_url $url the URL of the graph.
 +     * @param string $title the title to display above the graph.
 +     * @return string HTML fragment for the graph.
 +     */
 +    public function graph(moodle_url $url, $title) {
 +        global $CFG;
 +
 +        if (empty($CFG->gdversion)) {
 +            $graph = get_string('gdneed');
 +        } else {
 +            $graph = html_writer::empty_tag('img', array('src' => $url, 'alt' => $title));
 +        }
 +
 +        return $this->heading($title) . html_writer::tag('div', $graph, array('class' => 'graph'));
 +    }
  }
  
  class mod_quiz_links_to_other_attempts implements renderable {