From aa9a462a4b702781a5686f19ec5e4cadf7554cd4 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 28 Mar 2023 17:35:21 +0100 Subject: [PATCH] MDL-69551 quiz: start quiz password field should be a passwordunmask This help accessibility and usability --- mod/quiz/accessrule/password/rule.php | 4 ++-- mod/quiz/tests/behat/attempt_begin.feature | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mod/quiz/accessrule/password/rule.php b/mod/quiz/accessrule/password/rule.php index 778e3902891..6421ace1282 100644 --- a/mod/quiz/accessrule/password/rule.php +++ b/mod/quiz/accessrule/password/rule.php @@ -63,8 +63,8 @@ class quizaccess_password extends quiz_access_rule_base { // Don't use the 'proper' field name of 'password' since that get's // Firefox's password auto-complete over-excited. - $mform->addElement('password', 'quizpassword', - get_string('quizpassword', 'quizaccess_password'), array('autofocus' => 'true')); + $mform->addElement('passwordunmask', 'quizpassword', + get_string('quizpassword', 'quizaccess_password'), ['autofocus' => 'true']); } public function validate_preflight_check($data, $files, $errors, $attemptid) { diff --git a/mod/quiz/tests/behat/attempt_begin.feature b/mod/quiz/tests/behat/attempt_begin.feature index 6ca32302b47..81bc94ee47e 100644 --- a/mod/quiz/tests/behat/attempt_begin.feature +++ b/mod/quiz/tests/behat/attempt_begin.feature @@ -80,8 +80,6 @@ Feature: The various checks that may happen when an attept is started And I should see "Your attempt will have a time limit of 1 hour. When you " And I should see "The password entered was incorrect" And I set the field "Quiz password" to "Frog" - # On Mac/FF tab key is needed as text field in dialogue and page have same id. - And I press tab key in "Quiz password" "field" And I press "Start attempt" And I should see "Text of the first question" @@ -102,8 +100,6 @@ Feature: The various checks that may happen when an attept is started And I should see "Your attempt will have a time limit of 1 hour. When you " And I should see "The password entered was incorrect" And I set the field "Quiz password" to "Frog" - # On Mac/FF tab key is needed as text field in dialogue and page have same id. - And I press tab key in "Quiz password" "field" And I press "Cancel" Then I should see "Quiz 1 description" And "Attempt quiz" "button" should be visible