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.
This commit is contained in:
Andrew Nicols 2020-11-09 15:35:54 +08:00
parent bce0d4b80f
commit 3959958372

View File

@ -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 |