[ Index ]

PHP Cross Reference of Unnamed Project

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 | teacher1@example.com |
  14        | student1 | Student | First | student1@example.com |
  15      And the following "course enrolments" exist:
  16        | user | course | role |
  17        | teacher1 | C1 | editingteacher |
  18        | student1 | C1 | student |
  19  
  20    @javascript
  21    Scenario: Show section greyed-out to student when completion condition is not satisfied
  22      Given I log in as "teacher1"
  23      And I am on site homepage
  24      And I follow "Course 1"
  25      And I turn editing mode on
  26      And I click on "Edit settings" "link" in the "Administration" "block"
  27      And I set the following fields to these values:
  28        | Enable completion tracking | Yes |
  29      And I press "Save and display"
  30      And I add a "Label" to section "1" and I fill the form with:
  31        | Label text | Test label |
  32        | Completion tracking | Students can manually mark the activity as completed |
  33      And I add a "Page" to section "2" and I fill the form with:
  34        | Name | Test page name |
  35        | Description | Test page description |
  36        | Page content | Test page contents |
  37      When I edit the section "2"
  38      And I expand all fieldsets
  39      And I click on "Add restriction..." "button"
  40      And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
  41      And I set the following fields to these values:
  42        | cm | Test label |
  43        | Required completion status | must be marked complete |
  44      And I press "Save changes"
  45      And I log out
  46      And I log in as "student1"
  47      And I am on site homepage
  48      And I follow "Course 1"
  49      Then I should see "Not available unless: The activity Test label is marked complete"
  50      And I should not see "Test page name"
  51      And I press "Not completed: Test label. Select to mark as complete."
  52      And I should see "Test page name"
  53      And I should not see "Not available unless: The activity Test label is marked complete"
  54  
  55    @javascript
  56    Scenario: Show section greyed-out to student when grade condition is not satisfied
  57      Given I log in as "teacher1"
  58      And I am on site homepage
  59      And I follow "Course 1"
  60      And I turn editing mode on
  61      And I add a "Assignment" to section "1" and I fill the form with:
  62        | Assignment name | Grade assignment |
  63        | Description | Grade this assignment to revoke restriction on restricted assignment |
  64        | assignsubmission_onlinetext_enabled | 1 |
  65        | assignsubmission_file_enabled | 0 |
  66      And I add a "Page" to section "2" and I fill the form with:
  67        | Name | Test page name |
  68        | Description | Restricted section page resource, till grades in Grade assignment is at least 20% |
  69        | Page content | Test page contents |
  70      And I edit the section "2"
  71      And I expand all fieldsets
  72      And I click on "Add restriction..." "button"
  73      And I click on "Grade" "button" in the "Add restriction..." "dialogue"
  74      And I set the following fields to these values:
  75        | id     | Grade assignment |
  76        | min    | 1                |
  77        | minval | 20               |
  78      And I press "Save changes"
  79      And I log out
  80      When I log in as "student1"
  81      And I am on site homepage
  82      And I follow "Course 1"
  83      Then I should see "Not available unless: You achieve a required score in Grade assignment"
  84      And "Test page name" activity should be hidden
  85      And I follow "Grade assignment"
  86      And I press "Add submission"
  87      And I set the following fields to these values:
  88        | Online text | I'm the student submission |
  89      And I press "Save changes"
  90      And I should see "Submitted for grading"
  91      And I log out
  92      And I log in as "teacher1"
  93      And I am on site homepage
  94      And I follow "Course 1"
  95      And I follow "Grade assignment"
  96      And I follow "View all submissions"
  97      And I click on "Grade" "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 press "Ok"
 102      And I follow "Edit settings"
 103      And I log out
 104      And I log in as "student1"
 105      And I am on site homepage
 106      And I follow "Course 1"
 107      And "Test page name" activity should be visible
 108      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