1 |
efrain |
1 |
@gradeexport @gradeexport_xml
|
|
|
2 |
Feature: I need to export grades as xml
|
|
|
3 |
In order to easily review marks
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to have a export grades as xml
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
|
|
10 |
| Course 1 | C1 | 0 | 1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email | idnumber |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com | s1 |
|
|
|
15 |
| student2 | Student | 2 | student2@example.com | 'Bill'&"Ben"<tag>Hello</tag> |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
And the following "activities" exist:
|
|
|
22 |
| activity | course | idnumber | name |
|
|
|
23 |
| assign | C1 | a1 | Test assignment name |
|
|
|
24 |
And the following "grade grades" exist:
|
|
|
25 |
| gradeitem | user | grade |
|
|
|
26 |
| Test assignment name | student1 | 80.00 |
|
|
|
27 |
| Test assignment name | student2 | 42.00 |
|
|
|
28 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
29 |
|
|
|
30 |
@javascript
|
|
|
31 |
Scenario: Export grades as XML
|
|
|
32 |
When I navigate to "XML file" export page in the course gradebook
|
|
|
33 |
And I expand all fieldsets
|
|
|
34 |
And I set the field "Grade export decimal places" to "1"
|
|
|
35 |
And I press "Download"
|
|
|
36 |
Then I should see "s1" in the "//results//result[1]//student" "xpath_element"
|
|
|
37 |
And I should see "a1" in the "//results//result[1]//assignment" "xpath_element"
|
|
|
38 |
And I should see "80.0" in the "//results//result[1]//score" "xpath_element"
|
|
|
39 |
And I should not see "80.00" in the "//results//result[1]//score" "xpath_element"
|
|
|
40 |
# Ensure we have the encoded ID number of student 2.
|
|
|
41 |
And I should see "'Bill'&\"Ben\"<tag>Hello</tag>" in the "//results//result[2]//student" "xpath_element"
|
|
|
42 |
And I should see "a1" in the "//results//result[2]//assignment" "xpath_element"
|
|
|
43 |
And I should see "42.0" in the "//results//result[2]//score" "xpath_element"
|
|
|
44 |
And I should not see "42.00" in the "//results//result[2]//score" "xpath_element"
|