Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_user @javascript
2
Feature: The student can navigate to their grades page and user grade report.
3
  In order to view my grades and the user grade report
4
  As a user
5
  I need to log in and browse to my grades.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | student1 | Student | 1 | student1@example.com |
11
      | student2 | Student | 2 | student2@example.com |
12
      | teacher1 | Teacher | 1 | teacher1@example.com |
13
      | parent1 | Parent | 1 | parent1@example.com |
14
    And the following "courses" exist:
15
      | fullname | shortname | format |
16
      | Course 1 | C1 | topics |
17
      | Course 2 | C2 | topics |
18
    And the following "course enrolments" exist:
19
      | user | course | role |
20
      | student1 | C1 | student |
21
      | student2 | C1 | student |
22
      | teacher1 | C1 | editingteacher |
23
      | student1 | C2 | student |
24
    And the following "activities" exist:
25
      | activity | course | idnumber | name                  | grade |
26
      | assign   | C1     | a1       | Test assignment one   | 300   |
27
      | assign   | C1     | a2       | Test assignment two   | 100   |
28
      | assign   | C1     | a3       | Test assignment three | 150   |
29
      | assign   | C2     | a4       | Test assignment four  | 150   |
30
    And the following "grade grades" exist:
31
      | gradeitem           | user     | grade  |
32
      | Test assignment one | student1 | 150.00 |
33
      | Test assignment two | student1 | 67.00  |
34
 
35
  Scenario: Navigation to Grades and the user grade report.
36
    When I log in as "student1"
37
    And I follow "Grades" in the user menu
38
    Then the following should exist in the "overview-grade" table:
39
    | Course name | Grade |
40
    | Course 2 | - |
41
    | Course 1 | 217.00 |
42
    And I click on "Course 1" "link" in the "region-main" "region"
43
    And the following should exist in the "user-grade" table:
44
    | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
45
    | Test assignment one | 75.00 % | 150.00 | 0–300 | 50.00 % | 37.50 % |
46
    | Test assignment two | 25.00 % | 67.00  | 0–100 | 67.00 % | 16.75 % |
47
    | Test assignment three | 0.00 %( Empty ) | - | 0–150 | - | 0.00 % |
48
 
49
  Scenario: Change Grades settings to go to a custom url.
50
    Given the following config values are set as admin:
51
      | grade_mygrades_report  | external             |
52
      | gradereport_mygradeurl | /badges/mybadges.php |
53
    And I log in as "student1"
54
    And I follow "Grades" in the user menu
55
    Then I should see "My badges from Acceptance test site web site"
56
 
57
  Scenario: Log in as a parent and view a childs grades.
58
    Given the following "role" exists:
59
      | shortname                            | Parent |
60
      | name                                 | Parent |
61
      | context_user                         | 1      |
62
      | moodle/user:editprofile              | allow  |
63
      | moodle/user:viewalldetails           | allow  |
64
      | moodle/user:viewuseractivitiesreport | allow  |
65
      | moodle/user:viewdetails              | allow  |
66
    And the following "blocks" exist:
67
      | blockname | contextlevel | reference | pagetypepattern | defaultregion |
68
      | mentees   | System       | 1         | site-index      | side-pre      |
69
    When I log in as "admin"
70
    And I am on site homepage
71
    And I am on the "student1" "user > profile" page
72
    And I click on "Preferences" "link" in the ".profile_tree" "css_element"
73
    And I follow "Assign roles relative to this user"
74
    And I follow "Parent"
75
    And I set the field "Potential users" to "Parent 1 (parent1@example.com)"
76
    And I click on "Add" "button" in the "#page-content" "css_element"
77
    And I log out
78
    And I log in as "parent1"
79
    And I am on site homepage
80
    And I follow "Student 1"
81
    And I follow "Grades overview"
82
    Then the following should exist in the "overview-grade" table:
83
    | Course name | Grade |
84
    | Course 2 | - |
85
    | Course 1 | 217.00 |
86
    And I click on "Course 1" "link" in the "region-main" "region"
87
    And the following should exist in the "user-grade" table:
88
    | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
89
    | Test assignment one | 75.00 % | 150.00 | 0–300 | 50.00 % | 37.50 % |
90
    | Test assignment two | 25.00 % | 67.00  | 0–100 | 67.00 % | 16.75 % |
91
    | Test assignment three | 0.00 %( Empty ) | - | 0–150 | - | 0.00 % |