[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/user/tests/behat/ -> user_grade_navigation.feature (source)

   1  @core @core_user
   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 | intro | grade |
  26        | assign | C1 | a1 | Test assignment one | Submit something! | 300 |
  27        | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
  28        | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
  29        | assign | C2 | a4 | Test assignment four | Submit something! | 150 |
  30      And I log in as "teacher1"
  31      And I follow "Course 1"
  32      And I navigate to "Grades" node in "Course administration"
  33      And I turn editing mode on
  34      And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment one"
  35      And I give the grade "67.00" to the user "Student 1" for the grade item "Test assignment two"
  36      And I press "Save changes"
  37      And I log out
  38  
  39    Scenario: Navigation to Grades and the user grade report.
  40      When I log in as "student1"
  41      And I follow "Grades"
  42      Then the following should exist in the "overview-grade" table:
  43      | Course name | Grade |
  44      | Course 2 | - |
  45      | Course 1 | 217.00 |
  46      And I follow "Course 1"
  47      And the following should exist in the "user-grade" table:
  48      | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
  49      | Test assignment one | 75.00 % | 150.00 | 0–300 | 50.00 % | 37.50 % |
  50      | Test assignment two | 25.00 % | 67.00  | 0–100 | 67.00 % | 16.75 % |
  51      | Test assignment three | 0.00 %( Empty ) | - | 0–150 | - | 0.00 % |
  52  
  53    Scenario: Change Grades settings to go to a custom url.
  54      When I log in as "admin"
  55      And I set the following administration settings values:
  56      | grade_mygrades_report | External URL |
  57      | gradereport_mygradeurl | /badges/mybadges.php |
  58      And I log out
  59      And I log in as "student1"
  60      And I follow "Student 1"
  61      And I follow "Grades"
  62      Then I should see "My badges from Acceptance test site web site"
  63  
  64    Scenario: Log in as a parent and view a childs grades.
  65      When I log in as "admin"
  66      And I am on site homepage
  67      And I follow "Turn editing on"
  68      And I add the "Mentees" block
  69      And I navigate to "Define roles" node in "Site administration > Users > Permissions"
  70      And I click on "Add a new role" "button"
  71      And I click on "Continue" "button"
  72      And I set the following fields to these values:
  73      | Short name | Parent |
  74      | Custom full name | Parent |
  75      | contextlevel30 | 1 |
  76      | moodle/user:editprofile | 1 |
  77      | moodle/user:viewalldetails | 1 |
  78      | moodle/user:viewuseractivitiesreport | 1 |
  79      | moodle/user:viewdetails | 1 |
  80      And I click on "Create this role" "button"
  81      And I navigate to "Browse list of users" node in "Site administration > Users > Accounts"
  82      And I follow "Student 1"
  83      And I click on "Preferences" "link" in the ".profile_tree" "css_element"
  84      And I follow "Assign roles relative to this user"
  85      And I follow "Parent"
  86      And I set the field "Potential users" to "Parent 1 (parent1@example.com)"
  87      And I click on "Add" "button"
  88      And I log out
  89      And I log in as "parent1"
  90      And I am on site homepage
  91      And I follow "Student 1"
  92      And I navigate to "Grades" node in "Users > Student 1"
  93      Then the following should exist in the "overview-grade" table:
  94      | Course name | Grade |
  95      | Course 2 | - |
  96      | Course 1 | 217.00 |
  97      And I follow "Course 1"
  98      And the following should exist in the "user-grade" table:
  99      | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
 100      | Test assignment one | 75.00 % | 150.00 | 0–300 | 50.00 % | 37.50 % |
 101      | Test assignment two | 25.00 % | 67.00  | 0–100 | 67.00 % | 16.75 % |
 102      | Test assignment three | 0.00 %( Empty ) | - | 0–150 | - | 0.00 % |


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1