[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/completion/tests/behat/ -> restrict_activity_by_grade.feature (source)

   1  @core @core_completion
   2  Feature: Restrict activity availability through grade conditions
   3    In order to control activity access through grade condition
   4    As a teacher
   5    I need to set grade condition to restrict activity access
   6  
   7    @javascript
   8    Scenario: Show activity greyed-out to students when grade condition is not satisfied
   9      Given the following "courses" exist:
  10        | fullname | shortname | category |
  11        | Course 1 | C1 | 0 |
  12      And the following "users" exist:
  13        | username | firstname | lastname | email |
  14        | teacher1 | Teacher | Frist | teacher1@example.com |
  15        | student1 | Student | First | student1@example.com |
  16      And the following "course enrolments" exist:
  17        | user | course | role |
  18        | teacher1 | C1 | editingteacher |
  19        | student1 | C1 | student |
  20      And I log in as "teacher1"
  21      #And I am on site homepage
  22      And I follow "Course 1"
  23      And I turn editing mode on
  24      And I add a "Assignment" to section "1" and I fill the form with:
  25        | Assignment name | Grade assignment |
  26        | Description | Grade this assignment to revoke restriction on restricted assignment |
  27        | assignsubmission_onlinetext_enabled | 1 |
  28        | assignsubmission_file_enabled | 0 |
  29      # Adding the page like this because id_availableform_enabled needs to be clicked to trigger the action.
  30      And I add a "Page" to section "2"
  31      And I expand all fieldsets
  32      And I click on "Add restriction..." "button"
  33      And I click on "Grade" "button" in the "Add restriction..." "dialogue"
  34      And I click on "min" "checkbox"
  35      And I set the following fields to these values:
  36        | Name | Test page name |
  37        | Description | Restricted page, till grades in Grade assignment is at least 20% |
  38        | Page content | Test page contents |
  39        | id | Grade assignment |
  40        | minval | 20 |
  41      And I press "Save and return to course"
  42      And I log out
  43      When I log in as "student1"
  44      And I am on site homepage
  45      And I follow "Course 1"
  46      Then I should see "Not available unless: You achieve a required score in Grade assignment"
  47      And "Test page name" activity should be hidden
  48      And I follow "Grade assignment"
  49      And I press "Add submission"
  50      And I set the following fields to these values:
  51        | Online text | I'm the student submission |
  52      And I press "Save changes"
  53      And I should see "Submitted for grading"
  54      And I log out
  55      And I log in as "teacher1"
  56      And I am on site homepage
  57      And I follow "Course 1"
  58      And I follow "Grade assignment"
  59      And I follow "View all submissions"
  60      And I click on "Grade" "link" in the "Student First" "table_row"
  61      And I set the following fields to these values:
  62        | Grade | 21 |
  63      And I press "Save changes"
  64      And I press "Ok"
  65      And I follow "Edit settings"
  66      And I log out
  67      And I log in as "student1"
  68      And I am on site homepage
  69      And I follow "Course 1"
  70      And "Test page name" activity should be visible
  71      And I should not see "Not available unless: You achieve a required score in Grade assignment"


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