Proyectos de Subversion Moodle

Rev

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