[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 @core @core_completion 2 Feature: Restrict activity availability through date conditions 3 In order to control activity access through date condition 4 As a teacher 5 I need to set allow access dates to restrict activity access 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 conditional access | 1 | 22 And I log out 23 And I log in as "teacher1" 24 And I follow "Course 1" 25 And I turn editing mode on 26 # Adding the page like this because id_available*_enabled needs to be clicked to trigger the action. 27 And I add a "Assignment" to section "1" 28 And I expand all fieldsets 29 30 @javascript 31 Scenario: Show activity greyed-out to students when available from date is in future 32 Given I click on "Add restriction..." "button" 33 And I click on "Date" "button" in the "Add restriction..." "dialogue" 34 And I set the following fields to these values: 35 | Assignment name | Test assignment 1 | 36 | Description | This assignment is restricted by date | 37 | assignsubmission_onlinetext_enabled | 1 | 38 | assignsubmission_file_enabled | 0 | 39 | x[day] | 31 | 40 | x[month] | 12 | 41 | x[year] | 2037 | 42 And I press "Save and return to course" 43 And I log out 44 When I log in as "student1" 45 And I follow "Course 1" 46 Then I should see "Available from 31 December 2037" 47 And "Test assignment 1" activity should be hidden 48 And I log out 49 50 @javascript 51 Scenario: Show activity hidden to students when available until date is in past 52 Given I click on "Add restriction..." "button" 53 And I click on "Date" "button" in the "Add restriction..." "dialogue" 54 And I set the following fields to these values: 55 | Assignment name | Test assignment 2 | 56 | Description | This assignment is restricted by date | 57 | assignsubmission_onlinetext_enabled | 1 | 58 | assignsubmission_file_enabled | 0 | 59 | x[day] | 1 | 60 | x[month] | 2 | 61 | x[year] | 2013 | 62 | Direction | until | 63 # Click eye icon to hide it when not available. 64 And I click on ".availability-item .availability-eye img" "css_element" 65 And I press "Save and return to course" 66 And I log out 67 When I log in as "student1" 68 And I follow "Course 1" 69 Then I should not see "Test assignment 2"
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |