Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@core @core_grades @gradereport_user @javascriptFeature: View the user report as the student will see itIn order to know what grades students will seeAs a teacherI need to be able to view the user report as that other userBackground:Given the following "courses" exist:| fullname | shortname | category | groupmode || <span class="multilang" lang="en">Course</span><span class="multilang" lang="de">Kurs</span> 1 & '" | C1 | 0 | 1 |And the following "users" exist:| username | firstname | lastname | email | idnumber || teacher1 | Teacher | 1 | teacher1@example.com | t1 || student1 | Student | 1 | student1@example.com | s1 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || student1 | C1 | student |And the following "grade categories" exist:| fullname | course || Sub category 1 | C1 || Sub category 2 | C1 |And the following "activities" exist:| activity | course | idnumber | name | intro | gradecategory | grade | gradepass || assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 | 100 | 50 || assign | C1 | a2 | Test assignment two | Submit something! | Sub category 1 | 100 | 50 || assign | C1 | a3 | Test assignment three | Submit something! | Sub category 2 | 100 | || assign | C1 | a4 | Test assignment four | Submit something! | Sub category 2 | 100 | |And the following "activities" exist:| activity | course | idnumber | name | intro | grade || assign | C1 | a5 | Test assignment five | Submit something! | 100 || assign | C1 | a6 | Test assignment six | Submit something! | 100 |And the "multilang" filter is "on"And the "multilang" filter applies to "content and headings"When I am on the "C1" "grades > gradebook setup" page logged in as "teacher1"And I hide the grade item "Test assignment six" of type "gradeitem" on "setup" pageAnd I hide the grade item "Sub category 2" of type "category" on "setup" pageAnd I navigate to "View > Grader report" in the course gradebookAnd I turn editing mode onAnd I change window size to "large"And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"And I give the grade "35.00" to the user "Student 1" for the grade item "Test assignment two"And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment three"And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment four"And I give the grade "21.00" to the user "Student 1" for the grade item "Test assignment five"And I give the grade "97.00" to the user "Student 1" for the grade item "Test assignment six"And I press "Save changes"And I change window size to "medium"Scenario: View the report as the teacher themselvesGiven the following "activities" exist:| activity | course | idnumber | name | intro | grade || quiz | C1 | q1 | Test quiz one | Submit something! | 100 |When I navigate to "View > User report" in the course gradebookAnd I click on "Student 1" in the "user" search widgetAnd I should see "Course 1 & '\""And I should not see "Course 1 & '\""And I set the field "View report as" to "Myself"Then the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % || Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % || Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - || Test assignment three | 50.00 % | 100.00 | 0–100 | 100.00 % | 16.67 % || Test assignment four | 50.00 % | 50.00 | 0–100 | 50.00 % | 8.33 % || Sub category 2 total | 33.33 % | 150.00 | 0–200 | 75.00 % | - || Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % || Test assignment six | 16.67 % | 97.00 | 0–100 | 97.00 % | 16.17 % || Test quiz one | 0.00 %( Empty ) | - | 0–100 | - | 0.00 % || Course total | - | 383.00 | 0–600 | 63.83 % | - |# Confirm a contextual menu with a link to the Grade analysis page is available for "Test quiz one".And I open the action menu in "Test quiz one" "table_row"And "Grade analysis" "link" should existScenario: View the report as the student from both the teachers and students perspectiveGiven the following "activities" exist:| activity | course | idnumber | name | intro | grade || quiz | C1 | q1 | Test quiz one | Submit something! | 100 |When I navigate to "View > User report" in the course gradebookAnd I click on "Student 1" in the "user" search widgetAnd I set the field "View report as" to "User"Then the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | - | 80.00 | 0–100 | 80.00 % | - || Test assignment two | - | 35.00 | 0–100 | 35.00 % | - || Sub category 1 total | 33.33 % | - | 0–200 | - | - || Test assignment five | - | 21.00 | 0–100 | 21.00 % | - || Test quiz one | - | - | 0–100 | - | - || Course total | - | - | 0–600 | - | - |And "//i[@aria-label='Pass']" "xpath_element" should exist in the "Test assignment one" "table_row"And "//i[@aria-label='Fail']" "xpath_element" should exist in the "Test assignment two" "table_row"And the following should not exist in the "user-grade" table:| Grade item || Test assignment three || Test assignment four || Sub category 2 total || Test assignment six |# Confirm a contextual menu with a link to the Grade analysis page is available for "Test quiz one".And I open the action menu in "Test quiz one" "table_row"And "Grade analysis" "link" should existAnd I log outAnd I am on the "C1" "Course" page logged in as "student1"And I navigate to "User report" in the course gradebookAnd the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | - | 80.00 | 0–100 | 80.00 % | - || Test assignment two | - | 35.00 | 0–100 | 35.00 % | - || Sub category 1 total | 33.33 % | - | 0–200 | - | - || Test assignment five | - | 21.00 | 0–100 | 21.00 % | - || Test quiz one | - | - | 0–100 | - | - || Course total | - | - | 0–600 | - | - |And "//i[@aria-label='Pass']" "xpath_element" should exist in the "Test assignment one" "table_row"And "//i[@aria-label='Fail']" "xpath_element" should exist in the "Test assignment two" "table_row"And the following should not exist in the "user-grade" table:| Grade item || Test assignment three || Test assignment four || Sub category 2 total || Test assignment six |# Confirm a contextual menu with a link to the Grade analysis page is available for "Test quiz one".And I open the action menu in "Test quiz one" "table_row"And "Grade analysis" "link" should existScenario: View the report as the student from both the teachers and students perspective with totals excluding hiddenGiven I navigate to "Setup > Course grade settings" in the course gradebookAnd I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items"And I press "Save changes"And I navigate to "View > User report" in the course gradebookWhen I click on "Student 1" in the "user" search widgetAnd I set the field "View report as" to "User"Then the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 26.67 % || Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 11.67 % || Sub category 1 total | 66.67 % | 115.00 | 0–200 | 57.50 | - || Test assignment five | 33.33 % | 21.00 | 0–100 | 21.00 % | 7.00 % || Course total | - | 136.00 | 0–300 | 45.33 % | - |And the following should not exist in the "user-grade" table:| Grade item || Test assignment three || Test assignment four || Sub category 2 total || Test assignment six |And I log outAnd I am on the "C1" "Course" page logged in as "student1"And I navigate to "User report" in the course gradebookThen the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 26.67 % || Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 11.67 % || Sub category 1 total | 66.67 % | 115.00 | 0–200 | 57.50 | - || Test assignment five | 33.33 % | 21.00 | 0–100 | 21.00 % | 7.00 % || Course total | - | 136.00 | 0–300 | 45.33 % | - |And the following should not exist in the "user-grade" table:| Grade item || Test assignment three || Test assignment four || Sub category 2 total || Test assignment six |Scenario: View the report as the student from both the teachers and students perspective with totals including hiddenGiven I navigate to "Setup > Course grade settings" in the course gradebookAnd I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals including hidden items"And I press "Save changes"And I navigate to "View > User report" in the course gradebookWhen I click on "Student 1" in the "user" search widgetAnd I set the field "View report as" to "User"Then the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % || Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % || Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - || Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % || Course total | - | 383.00 | 0–600 | 63.83 % | - |And the following should not exist in the "user-grade" table:| Grade item || Test assignment three || Test assignment four || Sub category 2 total || Test assignment six |And I log outAnd I am on the "C1" "Course" page logged in as "student1"And I navigate to "User report" in the course gradebookThen the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % || Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % || Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - || Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % || Course total | - | 383.00 | 0–600 | 63.83 % | - |And the following should not exist in the "user-grade" table:| Grade item || Test assignment three || Test assignment four || Sub category 2 total || Test assignment six |Scenario: View the report as the student from both the teachers and students perspective when the student can view hiddenGiven the following "role capability" exists:| role | student || moodle/grade:viewhidden | allow |And I am on the "C1" "Course" page logged in as "teacher1"And I navigate to "Setup > Course grade settings" in the course gradebookAnd I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items"And I press "Save changes"And I navigate to "View > User report" in the course gradebookWhen I click on "Student 1" in the "user" search widgetAnd I set the field "View report as" to "User"Then the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % || Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % || Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - || Test assignment three | 50.00 % | 100.00 | 0–100 | 100.00 % | 16.67 % || Test assignment four | 50.00 % | 50.00 | 0–100 | 50.00 % | 8.33 % || Sub category 2 total | 33.33 % | 150.00 | 0–200 | 75.00 % | - || Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % || Test assignment six | 16.67 % | 97.00 | 0–100 | 97.00 % | 16.17 % || Course total | - | 383.00 | 0–600 | 63.83 % | - |And I log outAnd I log in as "student1"And I am on "C1" course homepageAnd I navigate to "User report" in the course gradebookThen the following should exist in the "user-grade" table:| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total || Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % || Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % || Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - || Test assignment three | 50.00 % | 100.00 | 0–100 | 100.00 % | 16.67 % || Test assignment four | 50.00 % | 50.00 | 0–100 | 50.00 % | 8.33 % || Sub category 2 total | 33.33 % | 150.00 | 0–200 | 75.00 % | - || Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % || Test assignment six | 16.67 % | 97.00 | 0–100 | 97.00 % | 16.17 % || Course total | - | 383.00 | 0–600 | 63.83 % | - |