diff --git a/mod/quiz/attemptlib.php b/mod/quiz/attemptlib.php
index 8c553a0fdba..9225016e051 100644
--- a/mod/quiz/attemptlib.php
+++ b/mod/quiz/attemptlib.php
@@ -860,9 +860,8 @@ abstract class quiz_nav_panel_base {
}
protected function get_button_update_script($question) {
- return '\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);
diff --git a/question/type/questiontype.php b/question/type/questiontype.php
index 9610c112116..dde40b10ffa 100644
--- a/question/type/questiontype.php
+++ b/question/type/questiontype.php
@@ -986,9 +986,8 @@ class default_questiontype {
$flagcontent = '' .
'' .
- "\n" . '";
+ $state->flagged, $id . 'img') . '' . "\n" .
+ print_js_call('question_flag_changer.init_flag', array($id, $postdata), true);
break;
default:
$flagcontent = '';