Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course @_cross_browser
2
Feature: Toggle activities visibility from the course page
3
  In order to delay activities availability
4
  As a teacher
5
  I need to quickly change the visibility of an activity
6
 
7
  Background:
8
    Given the following "users" exist:
1441 ariadna 9
      | username           | firstname           | lastname | email                          |
10
      | teacher1           | Teacher             | 1        | teacher1@example.com           |
11
      | noneditingteacher1 | Non-Editing Teacher | 1        | noneditingteacher1@example.com |
12
      | student1           | Student             | 1        | student1@example.com           |
1 efrain 13
    And the following "courses" exist:
14
      | fullname | shortname | format | numsections |
15
      | Course 1 | C1        | topics | 2           |
16
    And the following "course enrolments" exist:
1441 ariadna 17
      | user               | course | role           |
18
      | teacher1           | C1     | editingteacher |
19
      | noneditingteacher1 | C1     | teacher        |
20
      | student1           | C1     | student        |
1 efrain 21
    And the following "activities" exist:
22
      | activity | course | section | idnumber | name                 | intro                       | id_visible |
23
      | assign   | C1     | 1       | 1        | Test assignment name | Test assignment description | 1          |
24
    And the following "blocks" exist:
25
      | blockname       | contextlevel | reference | pagetypepattern | defaultregion |
26
      | recent_activity | Course       | C1        | course-view-*   | side-pre      |
27
 
28
  @javascript
29
  Scenario: Hide/Show toggle with javascript enabled
30
    Given the following "activity" exists:
31
      | activity | forum                  |
32
      | course   | C1                     |
33
      | idnumber | C1F1                   |
34
      | name     | Test forum name        |
35
      | visible  | 1                      |
36
    And I log in as "teacher1"
37
    And I am on "Course 1" course homepage with editing mode on
38
    When I open "Test forum name" actions menu
39
    And I choose "Hide" in the open action menu
40
    Then "Test forum name" activity should be hidden
41
    And I open "Test forum name" actions menu
42
    And I choose "Show" in the open action menu
43
    And "Test forum name" activity should be visible
44
    And I open "Test forum name" actions menu
45
    And I choose "Hide" in the open action menu
46
    And "Test forum name" activity should be hidden
47
    And I reload the page
48
    And "Test forum name" activity should be hidden
49
    # Make sure that "Availability" dropdown in the edit menu has two options: Show/Hide.
50
    And I open "Test forum name" actions menu
51
    And I click on "Edit settings" "link" in the "Test forum name" activity
52
    And I expand all fieldsets
53
    And the "Availability" select box should contain "Show on course page"
54
    And the "Availability" select box should not contain "Make available but don't show on course page"
55
    And the field "Availability" matches value "Hide on course page"
56
    And I press "Save and return to course"
57
    And "Test forum name" activity should be hidden
1441 ariadna 58
    # Non-editing teacher should see this activity.
59
    And I am on the "Course 1" course page logged in as noneditingteacher1
60
    And I should see "Test forum name" in the "region-main" "region"
1 efrain 61
    # Student should not see this activity.
62
    And I am on the "Course 1" course page logged in as student1
63
    And I should not see "Test forum name"
64
 
65
  @javascript
66
  Scenario: Activities can be made available and unavailable inside a hidden section
67
    Given the following "activity" exists:
68
      | activity | forum                  |
69
      | course   | C1                     |
70
      | idnumber | C1F1                   |
71
      | section  | 2                      |
72
      | name     | Test forum name        |
73
      | visible  | 1                      |
74
    And I log in as "teacher1"
75
    And I am on "Course 1" course homepage with editing mode on
76
    When I hide section "2"
77
    And "Test forum name" activity should be hidden
78
    And I open "Test forum name" actions menu
79
    And I choose "Availability > Make available but don't show on course page" in the open action menu
80
    Then "Test forum name" activity should be available but hidden from course page
81
    And I open "Test forum name" actions menu
82
    And I choose "Availability > Hide on course page" in the open action menu
83
    And "Test forum name" activity should be hidden
84
    # Make sure that "Availability" dropdown in the edit menu has three options.
85
    And I open "Test forum name" actions menu
86
    And I click on "Edit settings" "link" in the "Test forum name" activity
87
    And I expand all fieldsets
88
    And the "Availability" select box should contain "Hide on course page"
89
    And the "Availability" select box should contain "Make available but don't show on course page"
90
    And the "Availability" select box should not contain "Show on course page"
91
    And I set the field "Availability" to "Make available but don't show on course page"
92
    And I press "Save and return to course"
93
    And "Test forum name" activity should be available but hidden from course page
94
    And I turn editing mode off
95
    And "Test forum name" activity should be available but hidden from course page
96
    # Student will not see the module on the course page but can access it from other reports and blocks:
97
    And I am on the "Course 1" course page logged in as student1
98
    And "Test forum name" activity should be hidden
99
    And I click on "Test forum name" "link" in the "Recent activity" "block"
100
    And I should see "Test forum name"
101
    And I should see "There are no discussion topics yet in this forum"
102
 
103
  @javascript
104
  Scenario: Activities can be made available but not visible on a course page
105
    Given the following config values are set as admin:
106
      | allowstealth | 1 |
107
    And I log in as "teacher1"
108
    And I am on "Course 1" course homepage with editing mode on
109
    When I open "Test assignment name" actions menu
110
    And I choose "Availability > Make available but don't show on course page" in the open action menu
111
    Then "Test assignment name" activity should be available but hidden from course page
112
    # Make sure that "Availability" dropdown in the edit menu has three options.
113
    And I open "Test assignment name" actions menu
114
    And I click on "Edit settings" "link" in the "Test assignment name" activity
115
    And I expand all fieldsets
116
    And the "Availability" select box should contain "Show on course page"
117
    And the "Availability" select box should contain "Hide on course page"
118
    And the field "Availability" matches value "Make available but don't show on course page"
119
    And I press "Save and return to course"
120
    And "Test assignment name" activity should be available but hidden from course page
121
    And I turn editing mode off
122
    And "Test assignment name" activity should be available but hidden from course page
1441 ariadna 123
    # Non-editing teacher will see the module on the course page:
124
    And I am on the "Course 1" course page logged in as noneditingteacher1
125
    And I should see "Test assignment name" in the "region-main" "region"
1 efrain 126
    # Student will not see the module on the course page but can access it from other reports and blocks:
1441 ariadna 127
    And I am on the "Course 1" course page logged in as student1
1 efrain 128
    And "Test assignment name" activity should be hidden
129
    And I click on "Test assignment name" "link" in the "Recent activity" "block"
130
    And I should see "Test assignment name"
131
    And I should see "Submission status"