Clean up code in a couple of places by using my print_js_call function.

This commit is contained in:
tjhunt
2008-09-19 04:53:03 +00:00
parent 78b5eb25c8
commit ddf977898c
2 changed files with 4 additions and 6 deletions
+2 -3
View 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);
+2 -3
View 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 = '';