1 @core @core_grades @gradereport_singleview
2 Feature: We can use Single view
4 In order to view and edit grades
5 For users and activities for a course.
8 Given the following "courses" exist:
9 | fullname | shortname | category |
11 And the following "users" exist:
12 | username | firstname | lastname | email | idnumber | alternatename |
13 | teacher1 | Teacher | 1 | teacher1@asd.com | t1 | fred |
14 | student1 | Student | 1 | student1@asd.com | s1 | james |
15 | student2 | Student | 2 | student1@asd.com | s2 | holly |
16 | student3 | Student | 3 | student1@asd.com | s3 | anna |
17 | student4 | Student | 4 | student1@asd.com | s4 | zac |
18 And the following "grade items" exist:
20 | new grade item 1 | C1 |
21 And the following "course enrolments" exist:
22 | user | course | role |
23 | teacher1 | C1 | editingteacher |
24 | student1 | C1 | student |
25 | student2 | C1 | student |
26 | student3 | C1 | student |
27 | student4 | C1 | student |
28 And the following "grade categories" exist:
30 | Sub category 1 | C1|
31 | Sub category 2 | C1|
32 And the following "activities" exist:
33 | activity | course | idnumber | name | intro | grade |
34 | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
35 | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
36 | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
37 | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
38 And I log in as "teacher1"
39 And I follow "Course 1"
43 Scenario: I can update grades, add feedback and exclude grades.
44 Given I click on "Single view" "option"
45 And I click on "Student 4" "option"
46 And I click on "Override for Test assignment one" "checkbox"
47 When I set the following fields to these values:
48 | Grade for Test assignment one | 10.00 |
49 | Feedback for Test assignment one | test data |
50 And I click on "Exclude for Test assignment four" "checkbox"
52 Then the following should exist in the "generaltable" table:
53 | Test assignment four |
55 And the following should exist in the "generaltable" table:
56 | Test assignment one |
58 And I click on "Show grades for Test assignment three" "link"
59 And I click on "Override for james (Student) 1" "checkbox"
60 And I set the following fields to these values:
61 | Grade for james (Student) 1 | 12.05 |
62 | Feedback for james (Student) 1 | test data2 |
63 And I click on "Exclude for holly (Student) 2" "checkbox"
65 And the following should exist in the "generaltable" table:
66 | Test assignment three |
70 Scenario: Single view links work on grade report.
71 Given I follow "Single view for Test assignment one"
72 Then I should see "Test assignment one"
73 Then I follow "Grader report"
74 And I follow "Single view for Student 1"
75 Then I should see "Student 1"
77 Scenario: Navigation works in the Single view.
78 Given I follow "Single view for Student 1"
79 Then I should see "Student 1"
80 And I follow "Student 2"
81 Then I should see "Student 2"
82 And I follow "Student 1"
83 Then I should see "Student 1"
84 And I click on "Show grades for Test assignment four" "link"
85 Then I should see "Test assignment four"
86 And I follow "Test assignment three"
87 Then I should see "Test assignment three"
88 And I follow "Test assignment four"
89 Then I should see "Test assignment four"
91 Scenario: Activities are clickable only when
92 it has a valid activity page.
93 Given I follow "Single view for Student 1"
94 And "new grade item 1" "link" should not exist in the "//tbody//tr[position()=1]//td[position()=2]" "xpath_element"
95 Then "Category total" "link" should not exist in the "//tbody//tr[position()=2]//td[position()=2]" "xpath_element"
96 And "Course total" "link" should not exist in the "//tbody//tr[position()=last()]//td[position()=2]" "xpath_element"