Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_choice @core_completion
2
Feature: Manual completion in the choice activity
3
  To avoid navigating from the choice activity to the course homepage to mark the choice activity as complete
4
  As a student
5
  I need to be able to mark the choice activity as complete within the choice activity itself
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 "course" exists:
13
      | fullname          | Course 1  |
14
      | shortname         | C1        |
15
      | category          | 0         |
16
      | enablecompletion  | 1         |
17
    And the following "activity" exists:
18
      | activity    | choice                  |
19
      | name        | What to drink?          |
20
      | intro       | Friday drinks, anyone?  |
21
      | course      | C1                      |
22
      | idnumber    | choice1                 |
23
      | completion  | 1                       |
24
    And the following "course enrolments" exist:
25
      | user     | course | role           |
26
      | student1 | C1     | student        |
27
      | teacher1 | C1     | editingteacher |
28
 
29
  @javascript
30
  Scenario: Toggle manual completion as a student
31
    Given I am on the "What to drink?" "choice activity" page logged in as student1
32
    And the manual completion button of "What to drink?" is displayed as "Mark as done"
33
    When I toggle the manual completion state of "What to drink?"
34
    Then the manual completion button of "What to drink?" is displayed as "Done"
35
    But "Mark as done" "button" should not exist
36
    # Just make sure that the change persisted.
37
    And I reload the page
38
    And I wait until the page is ready
39
    And I should not see "Mark as done"
40
    And the manual completion button of "What to drink?" is displayed as "Done"
41
    And I toggle the manual completion state of "What to drink?"
42
    And the manual completion button of "What to drink?" is displayed as "Mark as done"
43
    But "Done" "button" should not exist
44
    # Just make sure that the change persisted.
45
    And I reload the page
46
    And the manual completion button of "What to drink?" is displayed as "Mark as done"
47
    But "Done" "button" should not exist
48
 
49
  Scenario: Viewing a choice activity with manual completion as a teacher
50
    When I am on the "What to drink?" "choice activity" page logged in as teacher1
51
    Then the manual completion button for "What to drink?" should be disabled
52
 
53
  @javascript
54
  Scenario: Overriding a manual choice completion for a user to done
55
    Given I am on the "Course 1" course page logged in as teacher1
56
    And I navigate to "Reports" in current page administration
57
    And I click on "Activity completion" "link"
58
    And I click on "Student 1, What to drink?: Not completed" "link"
59
    And I press "Save changes"
60
    And I log out
61
    When I am on the "What to drink?" "choice activity" page logged in as student1
62
    Then the manual completion button of "What to drink?" overridden by "Teacher 1" is displayed as "Done"
63
    And I toggle the manual completion state of "What to drink?"
64
    And the manual completion button of "What to drink?" is displayed as "Mark as done"
65
 
66
  @javascript
67
  Scenario: Overriding a manual choice completion for a user to not done
68
    Given I am on the "What to drink?" "choice activity" page logged in as student1
69
    And I press "Mark as done"
70
    And I wait until the page is ready
71
    And I log out
72
    And I am on the "Course 1" course page logged in as teacher1
73
    And I navigate to "Reports" in current page administration
74
    And I click on "Activity completion" "link"
75
    And I click on "Student 1, What to drink?: Completed" "link"
76
    And I press "Save changes"
77
    And I log out
78
    Given I am on the "What to drink?" "choice activity" page logged in as student1
79
    Then the manual completion button of "What to drink?" overridden by "Teacher 1" is displayed as "Mark as done"
80
    And I toggle the manual completion state of "What to drink?"
81
    And the manual completion button of "What to drink?" is displayed as "Done"