[ Index ]

PHP Cross Reference of moodle-2.8

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 | [email protected] |
  15        | student1 | Student | First | [email protected] |
  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 "admin"
  21      And I set the following administration settings values:
  22        | Enable conditional access | 1 |
  23      And I log out
  24      And I log in as "teacher1"
  25      And I follow "Course 1"
  26      And I turn editing mode on
  27      And I add a "Assignment" to section "1" and I fill the form with:
  28        | Assignment name | Grade assignment |
  29        | Description | Grade this assignment to revoke restriction on restricted assignment |
  30        | assignsubmission_onlinetext_enabled | 1 |
  31        | assignsubmission_file_enabled | 0 |
  32      # Adding the page like this because id_availableform_enabled needs to be clicked to trigger the action.
  33      And I add a "Page" to section "2"
  34      And I expand all fieldsets
  35      And I click on "Add restriction..." "button"
  36      And I click on "Grade" "button" in the "Add restriction..." "dialogue"
  37      And I click on "min" "checkbox"
  38      And I set the following fields to these values:
  39        | Name | Test page name |
  40        | Description | Restricted page, till grades in Grade assignment is at least 20% |
  41        | Page content | Test page contents |
  42        | id | Grade assignment |
  43        | minval | 20 |
  44      And I press "Save and return to course"
  45      And I log out
  46      When I log in as "student1"
  47      And I follow "Course 1"
  48      Then I should see "Not available unless: You achieve a required score in Grade assignment"
  49      And "Test page name" activity should be hidden
  50      And I follow "Grade assignment"
  51      And I press "Add submission"
  52      And I set the following fields to these values:
  53        | Online text | I'm the student submission |
  54      And I press "Save changes"
  55      And I should see "Submitted for grading"
  56      And I log out
  57      And I log in as "teacher1"
  58      And I follow "Course 1"
  59      And I follow "Grade assignment"
  60      And I follow "View/grade all submissions"
  61      And I click on "Grade Student First" "link" in the "Student First" "table_row"
  62      And I set the following fields to these values:
  63        | Grade | 21 |
  64      And I press "Save changes"
  65      And I log out
  66      And I log in as "student1"
  67      And I follow "Course 1"
  68      And "Test page name" activity should be visible
  69      And I should not see "Not available unless: You achieve a required score in Grade assignment"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1