diff --git a/mod/quiz/attemptlib.php b/mod/quiz/attemptlib.php index aedd15c973d..98f4dafa3c2 100644 --- a/mod/quiz/attemptlib.php +++ b/mod/quiz/attemptlib.php @@ -1236,7 +1236,7 @@ abstract class quiz_nav_panel_base { if (!$showcorrectness && $button->stateclass == 'notanswered') { $button->stateclass = 'complete'; } - $button->statestring = $qa->get_state_string($showcorrectness); + $button->statestring = $this->get_state_string($qa, $showcorrectness); $button->currentpage = $qa->get_question()->_page == $this->page; $button->flagged = $qa->is_flagged(); $button->url = $this->get_question_url($slot); @@ -1246,6 +1246,19 @@ abstract class quiz_nav_panel_base { return $buttons; } + protected function get_state_string(question_attempt $qa, $showcorrectness) { + if ($qa->get_question()->length > 0) { + return $qa->get_state_string($showcorrectness); + } + + // Special case handling for 'information' items. + if ($qa->get_state() == question_state::$todo) { + return get_string('notyetviewed', 'quiz'); + } else { + return get_string('viewed', 'quiz'); + } + } + public function render_before_button_bits(mod_quiz_renderer $output) { return ''; } diff --git a/mod/quiz/lang/en/quiz.php b/mod/quiz/lang/en/quiz.php index d55044bec21..d8c965c2808 100644 --- a/mod/quiz/lang/en/quiz.php +++ b/mod/quiz/lang/en/quiz.php @@ -453,6 +453,7 @@ $string['notenoughrandomquestions'] = 'There are not enough questions in categor $string['notenoughsubquestions'] = 'Not enough sub-questions have been defined!
Do you want to go back and fix this question?'; $string['notimedependentitems'] = 'Time dependent items are not currently supported by the quiz module. As a work around, set a time limit for the whole quiz. Do you wish to choose a different item (or use the current item regardless)?'; $string['notyetgraded'] = 'Not yet graded'; +$string['notyetviewed'] = 'Not yet viewed'; $string['notyourattempt'] = 'This is not your attempt!'; $string['noview'] = 'Logged-in user is not allowed to view this quiz'; $string['numattempts'] = '{$a->studentnum} {$a->studentstring} have made {$a->attemptnum} attempts'; @@ -775,6 +776,7 @@ $string['usersnone'] = 'No students have access to this quiz'; $string['validate'] = 'Validate'; $string['viewallanswers'] = 'View {$a} quiz attempts'; $string['viewallreports'] = 'View reports for {$a} attempts'; +$string['viewed'] = 'Viewed'; $string['warningmissingtype'] = 'This question is of a type that has not been installed on your Moodle yet.
Please alert your Moodle administrator.
'; $string['wheregrade'] = 'Where\'s my grade?'; $string['wildcard'] = 'Wild card';