Skip to content

Commit f502ed6

Browse files
committed
Quiz: #fix message to be shown only if user is course trainer and fix french translation - refs BT#22897
1 parent 087331d commit f502ed6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

public/main/exercise/exercise_result.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,15 @@
159159

160160
if ($objExercise->selectAttempts() > 0) {
161161
if ($attempt_count >= $objExercise->selectAttempts()) {
162-
Display::addFlash(
163-
Display::return_message(
164-
sprintf(get_lang('You have reached the maximum number of attempts for this test. Being a trainer, you can go on practicing but your Results will not be reported.'), $objExercise->selectTitle(), $objExercise->selectAttempts()),
165-
'warning',
166-
false
167-
)
168-
);
162+
if (api_is_allowed_to_edit(true, true, true)) {
163+
Display::addFlash(
164+
Display::return_message(
165+
sprintf(get_lang('You have reached the maximum number of attempts for this test. Being a trainer, you can go on practicing but your Results will not be reported.'), $objExercise->selectTitle(), $objExercise->selectAttempts()),
166+
'warning',
167+
false
168+
)
169+
);
170+
}
169171

170172
if (!in_array($origin, ['learnpath', 'embeddable'])) {
171173
$showFooter = true;

translations/messages.fr.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7981,7 +7981,7 @@ msgid "Score for the test"
79817981
msgstr "Votre résultat"
79827982

79837983
msgid "You have reached the maximum number of attempts for this test. Being a trainer, you can go on practicing but your Results will not be reported."
7984-
msgstr "Vous avez atteint le nombre maximum de tentatives pour cet exercice. En tant qu'administrateur de ce cours, vous pouvez toutefois essayer à nouveau, mais veuillez noter que vos résultats ne s'afficheront pas sur la page de résultats."
7984+
msgstr "Vous avez atteint le nombre maximum de tentatives pour cet exercice. En tant que professeur de ce cours, vous pouvez toutefois essayer à nouveau, mais veuillez noter que vos résultats ne s'afficheront pas sur la page de résultats."
79857985

79867986
msgid "Exercise added"
79877987
msgstr "Exercice ajouté"

0 commit comments

Comments
 (0)