Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_completion
2
Feature: Allow teachers to edit the visibility of completion conditions in a course
3
  In order to show students the course completion conditions in a course
4
  As a teacher
5
  I need to be able to edit completion conditions settings
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Teacher | 1 | teacher1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | enablecompletion | showcompletionconditions |
13
      | Course 1 | C1        | 1                | 1                        |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
17
    And the following "activities" exist:
18
      | activity  | course | idnumber | name              | completion  | completionsubmit |
19
      | choice    | C1     | c1m      | Test choice manual| 1           | 0                |
20
      | choice    | C1     | c1a      | Test choice auto  | 2           | 1                |
21
  @javascript
22
  Scenario: Completion condition displaying for manual and auto completion
23
    Given I log in as "teacher1"
24
    When I am on "Course 1" course homepage
25
    # The manual completion "Mark as done" criteria should displayed in the dropdown in the course homepage.
26
    Then "Test choice manual" should have the "Mark as done" completion condition
27
    And I follow "Test choice manual"
28
    # The manual completion toggle button should be displayed in activity view.
29
    And the manual completion button for "Test choice manual" should be disabled
30
    # Automatic completion conditions should be displayed on both activity view page and course homepage if show completion conditions is enabled.
31
    And I am on "Course 1" course homepage
32
    And "Test choice auto" should have the "Make a choice" completion condition
33
    And I follow "Test choice auto"
34
    And "Test choice auto" should have the "Make a choice" completion condition
35
 
36
  Scenario: Completion condition displaying setting can be disabled at course level
37
    Given I log in as "teacher1"
38
    And I am on "Course 1" course homepage with editing mode on
39
    And I navigate to "Settings" in current page administration
40
    When I set the following fields to these values:
41
      | Show activity completion conditions | No |
42
    And I click on "Save and display" "button"
43
    # Automatic completion conditions should not be displayed on the course homepage if show completion conditions is disabled.
44
    And there should be no completion information shown for "Test choice auto"
45
    # Completion conditions are always shown in the module's view page.
46
    And I follow "Test choice auto"
47
    Then "Test choice auto" should have the "Make a choice" completion condition
48
    # The manual completion toggle button should not be displayed in the course homepage when completion is disabled.
49
    And I am on "Course 1" course homepage
50
    And the manual completion button for "Test choice manual" should not exist
51
    # The manual completion toggle button should always be displayed in the activity view.
52
    And I follow "Test choice manual"
53
    And the manual completion button for "Test choice manual" should be disabled
54
 
55
  Scenario Outline: Default showcompletionconditions value in course form on course creation
56
    Given I log in as "admin"
57
    And I navigate to "Courses > Default settings > Course default settings" in site administration
58
    And I set the field "Show activity completion conditions" to "<siteshowcompletion>"
59
    And I press "Save changes"
60
    When I navigate to "Courses > Add a new course" in site administration
61
    Then the field "showcompletionconditions" matches value "<expected>"
62
 
63
    Examples:
64
      | siteshowcompletion | expected |
65
      | Yes                | Yes      |
66
      | No                 | No       |
67
 
68
  Scenario Outline: Default showcompletionconditions displayed when editing a course with disabled completion tracking
69
    Given I log in as "admin"
70
    And I navigate to "Courses > Default settings > Course default settings" in site administration
71
    And I set the field "Show activity completion conditions" to "<siteshowcompletion>"
72
    And I press "Save changes"
73
    And I am on "Course 1" course homepage with editing mode on
74
    And I navigate to "Settings" in current page administration
75
    And I set the field "Enable completion tracking" to "No"
76
    And I press "Save and display"
77
    And I navigate to "Settings" in current page administration
78
    Then the field "Show activity completion conditions" matches value "<expected>"
79
 
80
    Examples:
81
      | siteshowcompletion  | expected  |
82
      | Yes                 | Yes       |
83
      | No                  | No        |