quiz attempt UI NOBUG need accesshide text in the quiz navigation to say if a question has been flagged.

This commit is contained in:
Tim Hunt 2010-08-09 17:10:25 +00:00
parent c2a3a44818
commit a26246eac2
3 changed files with 10 additions and 1 deletions

View File

@ -1081,10 +1081,15 @@ abstract class quiz_nav_panel_base {
protected function get_question_button($number, $question) {
$strstate = get_string($this->attemptobj->get_question_status($question->id), 'quiz');
$flagstate = '';
if ($this->attemptobj->is_question_flagged($question->id)) {
$flagstate = get_string('flagged', 'question');
}
return '<a href="' . s($this->get_question_url($question)) .
'" class="qnbutton ' . $this->get_question_state_classes($question) .
'" id="quiznavbutton' . $question->id . '" title="' . $strstate . '">' .
$number . ' <span class="accesshide"> (' . $strstate . ')</span></a>';
$number . ' <span class="accesshide"> (' . $strstate . '
<span class="flagstate">' . $flagstate . '</span>)</span></a>';
}
protected function get_before_button_bits() {

View File

@ -1260,6 +1260,7 @@ function quiz_get_js_module() {
'strings' => array(
array('timesup', 'quiz'),
array('functiondisabledbysecuremode', 'quiz'),
array('flagged', 'question'),
),
);
}

View File

@ -118,6 +118,9 @@ M.mod_quiz.nav.update_flag_state = function(attemptid, questionid, newstate) {
navlink.removeClass('flagged');
if (newstate == 1) {
navlink.addClass('flagged');
navlink.one('.accesshide .flagstate').setContent(M.str.question.flagged);
} else {
navlink.one('.accesshide .flagstate').setContent('');
}
};