Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_scorm @core_completion @_file_upload @_switch_iframe
2
Feature: View activity completion in the SCORM activity
3
  In order to have visibility of scorm completion requirements
4
  As a student
5
  I need to be able to view my scorm completion progress
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | Vinnie    | Student1 | student1@example.com |
11
      | teacher1 | Darrell   | Teacher1 | teacher1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname | enablecompletion |
14
      | Course 1 | C1        | 1                |
15
    And the following "course enrolments" exist:
16
      | user | course | role           |
17
      | student1 | C1 | student        |
18
      | teacher1 | C1 | editingteacher |
19
    And the following "activity" exists:
20
      | activity                 | scorm                                                         |
21
      | course                   | C1                                                            |
22
      | name                     | Music history                                                 |
23
      | completion               | 2                                                             |
24
      | completionstatusallscos  | 0                                                             |
25
      # Add requirements
26
      | packagefilepath          | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip |
27
      | completionstatusrequired | 6                                                             |
28
      | completionscorerequired  | 3                                                             |
29
      | completionstatusrequired | 6                                                             |
30
      | completionstatusallscos  | 1                                                             |
31
      | maxattempt               | 1                                                             |
32
      | completionview           | 1                                                             |
33
      | completionusegrade       | 1                                                             |
34
 
35
  @javascript
36
  Scenario: View automatic completion items as a teacher
37
    Given I am on the "Music history" "scorm activity" page logged in as teacher1
38
    Then "Music history" should have the "View" completion condition
39
    And "Music history" should have the "Receive a score of 3 or more" completion condition
40
    And "Music history" should have the "Do all parts of this activity" completion condition
41
    And "Music history" should have the "Receive a grade" completion condition
42
    And "Music history" should have the "Complete or pass the activity" completion condition
43
 
44
  @javascript
45
  Scenario: Any grade and Passing grade options are hidden
46
    Given I am on the "Music history" "scorm activity" page logged in as teacher1
47
    When I navigate to "Settings" in current page administration
48
    And I expand all fieldsets
49
    And the field "completionusegrade" matches value "1"
50
    Then I should not see "Any grade"
51
    And I should not see "Passing grade"
52
 
53
  @javascript
54
  Scenario: View automatic completion items as a student
55
    Given I am on the "Music history" "scorm activity" page logged in as student1
56
    # We need a little taller window because Firefox is, apparently, unable to auto-scroll within
57
    # an iframe, so we need to ensure that the "Save changes" button is visible in the viewport.
58
    And I change window size to "1366x968"
59
    And the "View" completion condition of "Music history" is displayed as "todo"
60
    And the "Receive a score of 3 or more" completion condition of "Music history" is displayed as "todo"
61
    And the "Do all parts of this activity" completion condition of "Music history" is displayed as "todo"
62
    And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
63
    And the "Complete or pass the activity" completion condition of "Music history" is displayed as "todo"
64
    And I press "Enter"
65
    And I switch to the main frame
66
    And I click on "Par?" "list_item"
67
    And I switch to "scorm_object" iframe
68
    And I wait until the page is ready
69
    And I switch to the main frame
70
    And I click on "Keeping Score" "list_item"
71
    And I switch to "scorm_object" iframe
72
    And I wait until the page is ready
73
    And I switch to the main frame
74
    And I click on "Other Scoring Systems" "list_item"
75
    And I switch to "scorm_object" iframe
76
    And I wait until the page is ready
77
    And I switch to the main frame
78
    And I click on "The Rules of Golf" "list_item"
79
    And I switch to "scorm_object" iframe
80
    And I wait until the page is ready
81
    And I switch to the main frame
82
    And I click on "Playing Golf Quiz" "list_item"
83
    And I switch to "scorm_object" iframe
84
    And I wait until the page is ready
85
    And I click on "[id='question_com.scorm.golfsamples.interactions.playing_1_1']" "css_element"
86
    And I press "Submit Answers"
87
    And I wait until "Score: 20" "text" exists
88
    And I switch to the main frame
89
    And I click on "How to Have Fun Playing Golf" "list_item"
90
    And I switch to "scorm_object" iframe
91
    And I wait until the page is ready
92
    And I switch to the main frame
93
    And I click on "How to Make Friends Playing Golf" "list_item"
94
    And I switch to "scorm_object" iframe
95
    And I wait until the page is ready
96
    And I switch to the main frame
97
    And I click on "Having Fun Quiz" "list_item"
98
    And I switch to "scorm_object" iframe
99
    And I wait until the page is ready
100
    And I click on "[id='question_com.scorm.golfsamples.interactions.fun_1_False']" "css_element"
101
    And I press "Submit Answers"
102
    And I wait until "Score: 33" "text" exists
103
    And I switch to the main frame
104
    # We need to get some time till the last item is marked as done (or it won't be ready in slow databases).
105
    # This could be a pause of a few seconds (working ok in super-slow oracle docker database), but re-visiting
106
    # any of the pages seems to  be doing the work too under that very same slow environment.
107
    And I click on "Par?" "list_item"
108
    And I switch to "scorm_object" iframe
109
    And I wait until the page is ready
110
    And I switch to the main frame
111
    When I am on the "Music history" "scorm activity" page
112
    Then the "View" completion condition of "Music history" is displayed as "done"
113
    # Conditions that are not possible to achieve (eg score below requirement but all attempts used) are marked as failed.
114
    And the "Receive a score of 3 or more" completion condition of "Music history" is displayed as "failed"
115
    And the "Do all parts of this activity" completion condition of "Music history" is displayed as "done"
116
    And the "Receive a grade" completion condition of "Music history" is displayed as "done"
117
    And the "Complete or pass the activity" completion condition of "Music history" is displayed as "done"
118
 
119
  @javascript
120
  Scenario: Use manual completion
121
    Given I am on the "Music history" "scorm activity" page logged in as teacher1
122
    And I navigate to "Settings" in current page administration
123
    And I expand all fieldsets
124
    And I set the field "Students must manually mark the activity as done" to "1"
125
    And I press "Save and display"
126
    # Teacher view.
127
    And the manual completion button for "Music history" should be disabled
128
    And I log out
129
    # Student view.
130
    When I am on the "Music history" "scorm activity" page logged in as student1
131
    Then the manual completion button of "Music history" is displayed as "Mark as done"
132
    And I toggle the manual completion state of "Music history"
133
    And the manual completion button of "Music history" is displayed as "Done"
134
 
135
  @javascript
136
  Scenario: Required minimum score should be greater than zero
137
    Given I am on the "Music history" "scorm activity" page logged in as teacher1
138
    And I navigate to "Settings" in current page administration
139
    And I expand all fieldsets
140
    When I set the field "completionscorerequired" to "0"
141
    And I click on "Save and display" "button"
142
    Then I should see "Minimum score must be greater than 0."
143
    And "Enter" "button" should not exist
144
    And I set the field "completionscorerequired" to "-1"
145
    And I click on "Save and display" "button"
146
    And I should see "Minimum score must be greater than 0."
147
    And "Enter" "button" should not exist
148
    And I set the field "completionscorerequired" to "5"
149
    And I click on "Save and display" "button"
150
    And I should not see "Minimum score must be greater than 0."
151
    And "Enter" "button" should exist