diff --git a/lang/en_utf8/quiz.php b/lang/en_utf8/quiz.php index 6ec7c67dfc3..7361e41fad8 100644 --- a/lang/en_utf8/quiz.php +++ b/lang/en_utf8/quiz.php @@ -98,6 +98,7 @@ $string['confirmstartattempttimelimit'] = 'This quiz has a time limit and is lim $string['confirmstarttimelimit'] = 'The Quiz has a time limit. Are you sure that you wish to start?'; $string['containercategorycreated'] = 'This category has been created to store all the original categories moved to site level due to the causes specified below.'; $string['continueattemptquiz'] = 'Continue the last attempt'; +$string['continuepreview'] = 'Continue the last preview'; $string['copyingfrom'] = 'Creating a copy of the question \'$a\''; $string['copyingquestion'] = 'Copying a question'; $string['correct'] = 'Correct'; @@ -360,6 +361,7 @@ $string['popupnotice'] = 'Students will see this quiz in a secure window'; $string['preview'] = 'Preview'; $string['previewquestion'] = 'Preview question'; $string['previewquiz'] = 'Preview $a'; +$string['previewquiznow'] = 'Preview quiz now'; $string['previous'] = 'Previous state'; $string['publish'] = 'Publish'; $string['publishedit'] = 'You must have permission in the publishing course to add or edit questions in this category'; diff --git a/mod/quiz/view.php b/mod/quiz/view.php index 137416a46d1..317fb48faf2 100644 --- a/mod/quiz/view.php +++ b/mod/quiz/view.php @@ -317,11 +317,17 @@ echo "
"; if ($unfinished) { - $buttontext = get_string('continueattemptquiz', 'quiz'); + if (has_capability('mod/quiz:preview', $context)) { + $buttontext = get_string('continuepreview', 'quiz'); + } else { + $buttontext = get_string('continueattemptquiz', 'quiz'); + } } else { // Work out the appropriate button caption. - if ($numattempts == 0) { + if (has_capability('mod/quiz:preview', $context)) { + $buttontext = get_string('previewquiznow', 'quiz'); + } else if ($numattempts == 0) { $buttontext = get_string('attemptquiznow', 'quiz'); } else { $buttontext = get_string('reattemptquiz', 'quiz');