]> git.mjollnir.org Git - moodle.git/commitdiff
Clean up code in a couple of places by using my print_js_call function.
authortjhunt <tjhunt>
Fri, 19 Sep 2008 04:53:03 +0000 (04:53 +0000)
committertjhunt <tjhunt>
Fri, 19 Sep 2008 04:53:03 +0000 (04:53 +0000)
mod/quiz/attemptlib.php
question/type/questiontype.php

index 8c553a0fdba8d0d0049b90cf8dec8c243bcbd90b..9225016e05140406fa58b7b0c12e9f4e19dd904d 100644 (file)
@@ -860,9 +860,8 @@ abstract class quiz_nav_panel_base {
     }
 
     protected function get_button_update_script($question) {
-        return '<script type="text/javascript">' .
-                "\nquiz_init_nav_button('" . $this->get_button_id($question) . "', " .
-                $question->id . ")\n</script>\n";
+        return print_js_call('quiz_init_nav_button',
+                array($this->get_button_id($question), $question->id), true);
     }
 
     abstract protected function get_question_button($number, $question);
index 9610c112116af4340a6243817929cd1c070f7405..dde40b10ffa49c57213cd366b4b5d1e7d45cd16f 100644 (file)
@@ -986,9 +986,8 @@ class default_questiontype {
                 $flagcontent = '<input type="checkbox" id="' . $id . '" name="' . $id .
                         '" value="1" ' . $checked . ' />' . 
                         '<label id="' . $id . 'label" for="' . $id . '">' . $this->get_question_flag_tag(
-                        $state->flagged, $id . 'img') . '</label>' .
-                        "\n" . '<script type="text/javascript">question_flag_changer.init_flag(' .
-                        "'$id', '$postdata');</script>";
+                        $state->flagged, $id . 'img') . '</label>' . "\n" .
+                        print_js_call('question_flag_changer.init_flag', array($id, $postdata), true);
                 break;
             default:
                 $flagcontent = '';