Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_lesson
2
Feature: Lesson activity access can be restricted
3
  In order to restrict access to lesson activity
4
  As a teacher
5
  I need to set the lesson activity restriction
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
      | student2 | Student   | 2        | student2@example.com |
13
    And the following "courses" exist:
14
      | fullname | shortname | category |
15
      | Course 1 | C1        | 0        |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher1 | C1     | editingteacher |
19
      | student1 | C1     | student        |
20
      | student2 | C1     | student        |
21
    And the following "groups" exist:
22
      | name    | course | idnumber |
23
      | Group 1 | C1     | G1       |
24
      | Group 2 | C1     | G2       |
25
    And the following "group members" exist:
26
      | user     | group   |
27
      | student1 | G1      |
28
      | student2 | G2      |
29
    And the following "activities" exist:
30
      | activity   | name        | course | groupmode |
31
      | lesson     | Test lesson | C1     | 1         |
32
 
33
  @javascript
34
  Scenario Outline: Restrict lesson activity access by group
35
    # Set lesson activity access by group
36
    # Restrict lesson activity access by group as teacher
37
    Given I am on the "Test lesson" "lesson activity editing" page logged in as teacher1
38
    And I expand all fieldsets
39
    And I click on "Add restriction..." "button"
40
    And I click on "Group" "button" in the "Add restriction..." "dialogue"
41
    # Set only Group 1 can access activity
42
    And I set the field "Group" in the "Restrict access" "fieldset" to "Group 1"
43
    And I click on "Displayed if student doesn't meet this condition" "button"
44
    And I press "Save and return to course"
45
    # Confirm that student1 can see lesson but student2 can't
46
    When I am on the "Course 1" course page logged in as <user>
47
    Then I <visibility> "Test lesson" in the "region-main" "region"
48
 
49
    Examples:
50
      | user     | visibility     |
51
      | student1 | should see     |
52
      | student2 | should not see |