[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

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

   1  @core @core_completion
   2  Feature: Restrict sections availability through completion or grade conditions
   3    In order to control section's contents access through activities completion or grade condition
   4    As a teacher
   5    I need to restrict sections availability using different conditions
   6  
   7    Background:
   8      Given the following "courses" exist:
   9        | fullname | shortname | category |
  10        | Course 1 | C1 | 0 |
  11      And the following "users" exist:
  12        | username | firstname | lastname | email |
  13        | teacher1 | Teacher | Frist | [email protected] |
  14        | student1 | Student | First | [email protected] |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19      And I log in as "admin"
  20      And I set the following administration settings values:
  21        | Enable completion tracking | 1 |
  22        | Enable conditional access | 1 |
  23      And I log out
  24  
  25    @javascript
  26    Scenario: Show section greyed-out to student when completion condition is not satisfied
  27      Given I log in as "teacher1"
  28      And I follow "Course 1"
  29      And I turn editing mode on
  30      And I click on "Edit settings" "link" in the "Administration" "block"
  31      And I set the following fields to these values:
  32        | Enable completion tracking | Yes |
  33      And I press "Save changes"
  34      And I add a "Label" to section "1" and I fill the form with:
  35        | Label text | Test label |
  36        | Completion tracking | Students can manually mark the activity as completed |
  37      And I add a "Page" to section "2" and I fill the form with:
  38        | Name | Test page name |
  39        | Description | Test page description |
  40        | Page content | Test page contents |
  41      When I edit the section "2"
  42      And I expand all fieldsets
  43      And I click on "Add restriction..." "button"
  44      And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
  45      And I set the following fields to these values:
  46        | cm | Test label |
  47        | Required completion status | must be marked complete |
  48      And I press "Save changes"
  49      And I log out
  50      And I log in as "student1"
  51      And I follow "Course 1"
  52      Then I should see "Not available unless: The activity Test label is marked complete"
  53      And I should not see "Test page name"
  54      And I press "Not completed: Test label. Select to mark as complete."
  55      And I should see "Test page name"
  56      And I should not see "Not available unless: The activity Test label is marked complete"
  57  
  58    @javascript
  59    Scenario: Show section greyed-out to student when grade condition is not satisfied
  60      Given I log in as "teacher1"
  61      And I follow "Course 1"
  62      And I turn editing mode on
  63      And I add a "Assignment" to section "1" and I fill the form with:
  64        | Assignment name | Grade assignment |
  65        | Description | Grade this assignment to revoke restriction on restricted assignment |
  66        | assignsubmission_onlinetext_enabled | 1 |
  67        | assignsubmission_file_enabled | 0 |
  68      And I add a "Page" to section "2" and I fill the form with:
  69        | Name | Test page name |
  70        | Description | Restricted section page resource, till grades in Grade assignment is at least 20% |
  71        | Page content | Test page contents |
  72      And I edit the section "2"
  73      And I expand all fieldsets
  74      And I click on "Add restriction..." "button"
  75      And I click on "Grade" "button" in the "Add restriction..." "dialogue"
  76      And I click on "min" "checkbox"
  77      And I set the following fields to these values:
  78        | id | Grade assignment |
  79        | minval | 20 |
  80      And I press "Save changes"
  81      And I log out
  82      When I log in as "student1"
  83      And I follow "Course 1"
  84      Then I should see "Not available unless: You achieve a required score in Grade assignment"
  85      And "Test page name" activity should be hidden
  86      And I follow "Grade assignment"
  87      And I press "Add submission"
  88      And I set the following fields to these values:
  89        | Online text | I'm the student submission |
  90      And I press "Save changes"
  91      And I should see "Submitted for grading"
  92      And I log out
  93      And I log in as "teacher1"
  94      And I follow "Course 1"
  95      And I follow "Grade assignment"
  96      And I follow "View/grade all submissions"
  97      And I click on "Grade Student First" "link" in the "Student First" "table_row"
  98      And I set the following fields to these values:
  99        | Grade | 21 |
 100      And I press "Save changes"
 101      And I log out
 102      And I log in as "student1"
 103      And I follow "Course 1"
 104      And "Test page name" activity should be visible
 105      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