Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_grades @javascript @_file_upload
2
Feature: An admin can import grades into gradebook using a CSV file
3
  In order to import grades using a CSV file
4
  As a teacher
5
  I need to be able to upload a CSV file and see uploaded grades in gradebook
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | format |
10
      | Course 1 | C1        | topics |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email                |
13
      | teacher1 | Teacher   | 1        | teacher1@example.com |
14
      | student1 | Student   | 1        | student1@example.com |
15
      | student2 | Student   | 2        | student2@example.com |
16
      | student3 | Student   | 3        | student3@example.com |
17
    And the following "course enrolments" exist:
18
      | user     | course | role           |
19
      | teacher1 | C1     | editingteacher |
20
      | student1 | C1     | student        |
21
      | student2 | C1     | student        |
22
      | student3 | C1     | student        |
23
    And the following "grade item" exists:
24
      | course   | C1            |
25
      | itemname | Manual item 1 |
26
      | grademin | 10            |
27
      | grademax | 500           |
28
    And the following "grade grades" exist:
29
      | gradeitem     | user     | grade |
30
      | Manual item 1 | student1 | 50.00 |
31
      | Manual item 1 | student2 | 50.00 |
32
      | Manual item 1 | student3 | 50.00 |
33
 
34
  Scenario: Max grade of grade item is respected when importing grades
35
    Given I am on the "Course 1" "Course" page logged in as "teacher1"
36
    And I navigate to "CSV file" import page in the course gradebook
37
    And I upload "grade/tests/fixtures/grade_import_grademax.csv" file to "File" filemanager
38
    And I click on "Upload grades" "button"
39
    And I set the field "Map from" to "Email address"
40
    And I set the field "Map to" to "Email address"
41
    And I set the field "Manual item 1" to "Manual item 1"
42
    And I click on "Upload grades" "button"
43
    And I should see "One of the grade values is larger than the allowed grade maximum of 500.0"
44
    And I should see "Import failed. No data was imported."
45
    And I click on "Continue" "button"
46
    And I upload "grade/tests/fixtures/grade_import_grademin.csv" file to "File" filemanager
47
    And I click on "Upload grades" "button"
48
    And I set the field "Map from" to "Email address"
49
    And I set the field "Map to" to "Email address"
50
    And I set the field "Manual item 1" to "Manual item 1"
51
    And I click on "Upload grades" "button"
52
    And I should see "One of the grade values is smaller than the allowed grade minimum of 10.0"
53
    And I should see "Import failed. No data was imported."
54
    And I click on "Continue" "button"
55
    When I upload "grade/tests/fixtures/grade_import.csv" file to "File" filemanager
56
    And I click on "Upload grades" "button"
57
    And I set the field "Map from" to "Email address"
58
    And I set the field "Map to" to "Email address"
59
    And I set the field "Manual item 1" to "Manual item 1"
60
    And I click on "Upload grades" "button"
61
    And I should see "Grade import success"
62
    And I click on "Continue" "button"
63
    Then the following should exist in the "user-grades" table:
64
      | -1-                | -1-                  | -3-    | -4-    |
65
      | Student 1          | student1@example.com | 400.00 | 400.00 |
66
      | Student 2          | student2@example.com | 50.00  | 50.00  |
67
      | Student 3          | student3@example.com | 50.00  | 50.00  |
68
 
69
  Scenario: Importing grades with multiple new mappings
70
    Given I am on the "Course 1" "Course" page logged in as "teacher1"
71
    And I navigate to "CSV file" import page in the course gradebook
72
    And I upload "grade/tests/fixtures/grade_import_multiple_mappings.csv" file to "File" filemanager
73
    And I click on "Upload grades" "button"
74
    And I set the following fields to these values:
75
      | Map from | Email address  |
76
      | Map to   | Email address  |
77
      | Grade A  | New grade item |
78
      | Grade B  | New grade item |
79
      | Grade C  | New grade item |
80
      | Grade D  | New grade item |
81
    And I click on "Upload grades" "button"
82
    And I should see "Grade import success"
83
    And I click on "Continue" "button"
84
    Then the following should exist in the "user-grades" table:
85
      | -1-       | -1-                  | -3-   | -4-   | -5-   | -6-   | -7-   | -8-    |
86
      | Student 1 | student1@example.com | 50.00 | 11.00 | 12.00 | 13.00 | 14.00 | 100.00 |
87
      | Student 2 | student2@example.com | 50.00 | 21.00 | 22.00 | 23.00 | 24.00 | 140.00 |
88
      | Student 3 | student3@example.com | 50.00 | 31.00 | 32.00 | 33.00 | 34.00 | 180.00 |