From 581c909321eb41ded93976703dde555ecf6bbb95 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 9 Nov 2020 15:35:54 +0800 Subject: [PATCH] MDL-70148 gradereport_grader: Improve reliability of keyboard usage In some browsers the ajax grade select does not properly update the grade after setting values. The previous solution was to press the [enter] key, but doing this with the new key type step opens the select box again. This is what happens when a real user presses enter on the select. This is the last possible field in the report, so pressing the tab key to move to the next gradable element does not work. The solution uses a shift-tab to move the focus away to the previous gradale element. In this case it must also be moved to an earlier step because the previously selected value must be checked in the Then section of the test and if it is selected then its value cannot be checked. --- grade/report/grader/tests/behat/ajax_grader.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grade/report/grader/tests/behat/ajax_grader.feature b/grade/report/grader/tests/behat/ajax_grader.feature index 072c5f04cf1..3500be14ba0 100644 --- a/grade/report/grader/tests/behat/ajax_grader.feature +++ b/grade/report/grader/tests/behat/ajax_grader.feature @@ -62,15 +62,15 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe And I press the enter key And I should not see a grade field for "Student 2" and grade item "Item VU" And I should not see a feedback field for "Student 2" and grade item "Item VU" + And I click on student "Student 3" for grade item "Item SU" + And I set the field "ajaxgrade" to "Very good" + And I press the shift tab key And I click on student "Student 3" for grade item "Item VU" And I set the field "ajaxgrade" to "50" And I press the enter key And I click on student "Student 3" for grade item "Item 1" And I set the field "ajaxgrade" to "80" And I press the enter key - And I click on student "Student 3" for grade item "Item SU" - And I set the field "ajaxgrade" to "Very good" - And I press the enter key And the following should exist in the "user-grades" table: | -1- | -6- | -7- | -13- | -16- | | Student 2 | - | 33.00 | - | 33.00 |