first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
@mod @mod_scorm @_file_upload @_switch_iframe
Feature: Add scorm activity
In order to let students access a scorm package
As a teacher
I need to add scorm activity to a course
@javascript
Scenario: Add a scorm activity to a course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
When I log in as "teacher1"
And I add a scorm activity to course "Course 1" section "1"
And I set the following fields to these values:
| Name | Awesome SCORM package |
| Description | Description |
And I upload "mod/scorm/tests/packages/singlesco_scorm12.zip" file to "Package file" filemanager
And I click on "Save and display" "button"
Then I should see "Awesome SCORM package"
And I should see "Enter"
And I should see "Preview"
And I log out
And I am on the "Awesome SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Not implemented yet"
And I switch to the main frame
And I am on "Course 1" course homepage
@@ -0,0 +1,161 @@
@mod @mod_scorm @_file_upload @_switch_iframe
Feature: Scorm multi-sco completion
In order to let students access a scorm package
As a teacher
I need to add scorm activity to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| enablecompletion | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
@javascript
Scenario: Test completion with a single sco completion.
Given the following "activity" exists:
| activity | scorm |
| course | C1 |
| name | Basic Multi-sco SCORM package |
| completion | 2 |
# Add requirements
| completionstatusallscos | 0 |
| packagefilepath | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12.zip |
| completionstatusrequired | 4 |
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
Then I should see "Basic Multi-sco SCORM package" in the "page" "region"
And I am on homepage
And I log out
And I am on the "Course 1" course page logged in as teacher1
Then "Student 1" user has completed "Basic Multi-sco SCORM package" activity
@javascript
Scenario: Test completion with all scos and correct sco load on re-entry.
Given the following "activity" exists:
| activity | scorm |
| course | C1 |
| name | ADV Multi-sco SCORM package |
| completion | 2 |
# Add requirements
| packagefilepath | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12.zip |
| completionstatusallscos | 1 |
And I am on the "ADV Multi-sco SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
Then I should see "ADV Multi-sco SCORM package" in the "page" "region"
And I am on homepage
And I log out
And I am on the "Course 1" course page logged in as teacher1
Then "Student 1" user has not completed "ADV Multi-sco SCORM package" activity
And I log out
And I am on the "ADV Multi-sco SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Par"
And I switch to the main frame
And I click on "Keeping Score" "list_item"
And I switch to "scorm_object" iframe
And I should see "Scoring"
And I switch to the main frame
And I click on "Other Scoring Systems" "list_item"
And I switch to "scorm_object" iframe
And I should see "Other Scoring Systems"
And I switch to the main frame
And I click on "The Rules of Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "The Rules of Golf"
And I switch to the main frame
And I click on "Playing Golf Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "Taking Care of the Course" "list_item"
And I switch to "scorm_object" iframe
And I should see "Etiquette - Care For the Course"
And I switch to the main frame
And I click on "Avoiding Distraction" "list_item"
And I switch to "scorm_object" iframe
And I should see "Etiquette - Avoiding Distraction"
And I switch to the main frame
And I click on "Playing Politely" "list_item"
And I switch to "scorm_object" iframe
And I should see "Etiquette - Playing the Game"
And I switch to the main frame
And I click on "Etiquette Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "Handicapping Overview" "list_item"
And I switch to "scorm_object" iframe
And I should see "Handicapping"
And I switch to the main frame
And I click on "Calculating a Handicap" "list_item"
And I switch to "scorm_object" iframe
And I should see "Calculating a Handicap"
And I switch to the main frame
And I click on "Calculating a Handicapped Score" "list_item"
And I switch to "scorm_object" iframe
And I should see "Calculating a Score"
And I switch to the main frame
And I click on "Handicapping Example" "list_item"
And I switch to "scorm_object" iframe
And I should see "Calculating a Score"
And I switch to the main frame
And I click on "Handicapping Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "How to Have Fun Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Have Fun Golfing"
And I switch to the main frame
And I click on "How to Make Friends Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Make Friends on the Golf Course"
And I switch to the main frame
And I click on "Having Fun Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
Then I should see "ADV Multi-sco SCORM package" in the "page" "region"
And I log out
And I am on the "Course 1" course page logged in as teacher1
And "Student 1" user has completed "ADV Multi-sco SCORM package" activity
@@ -0,0 +1,115 @@
@mod @mod_scorm @core_completion
Feature: Scorm activity default completion
In order to make easier for teachers to set completion conditions
As a teacher or admin
I need to be able to set default condition completion
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| enablecompletion | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@javascript
Scenario: Completion conditions when there is no default set at site or course level.
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
Then the field "None" matches value "1"
And the field "Add requirements" matches value "0"
And I set the field "Add requirements" to "1"
And the field "completionstatusrequired[4]" matches value "1"
And the field "completionstatusrequired[2]" matches value "0"
@javascript
Scenario: Completion conditions when default completion is set at site level but not at course level.
Given I log in as "admin"
And I navigate to "Courses > Default settings > Default activity completion" in site administration
And I click on "Expand SCORM" "button"
And I set the following fields to these values:
| id_completion_scorm_2 | 1 |
| completionview_scorm | 1 |
| completionstatusrequired_scorm[4] | 0 |
| completionstatusrequired_scorm[2] | 0 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
Then the field "None" matches value "0"
And the field "Add requirements" matches value "1"
And the field "completionview" matches value "1"
And the field "completionstatusrequired[4]" matches value "0"
And the field "completionstatusrequired[2]" matches value "0"
@javascript
Scenario: Completion conditions when default completion is set at course level but not at site level.
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Course completion" in current page administration
And I set the field "Course completion tertiary navigation" to "Default activity completion"
And I click on "Expand SCORM" "button"
And I set the following fields to these values:
| id_completion_scorm_2 | 1 |
| completionview_scorm | 1 |
| completionstatusrequired_scorm[4] | 0 |
| completionstatusrequired_scorm[2] | 0 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
Then the field "None" matches value "0"
And the field "Add requirements" matches value "1"
And the field "completionview" matches value "1"
And the field "completionstatusrequired[4]" matches value "0"
And the field "completionstatusrequired[2]" matches value "0"
@javascript
Scenario: Completion conditions when default completion is set at site and course level.
Given I log in as "admin"
And I navigate to "Courses > Default settings > Default activity completion" in site administration
And I click on "Expand SCORM" "button"
And I set the following fields to these values:
| id_completion_scorm_2 | 1 |
| completionview_scorm | 1 |
| completionstatusrequired_scorm[4] | 0 |
| completionstatusrequired_scorm[2] | 0 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
And the following "core_completion > Course defaults" exist:
| course | module | completion |
| C1 | scorm | 1 |
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
Then the field "None" matches value "0"
And the field "Students must manually mark the activity as done" matches value "1"
And the field "Add requirements" matches value "0"
@javascript
Scenario: Completion conditions when 'Passed' is marked as default but 'Completed' is unmarked.
Given I log in as "admin"
And I navigate to "Courses > Default settings > Default activity completion" in site administration
And I click on "Expand SCORM" "button"
And I set the following fields to these values:
| id_completion_scorm_2 | 1 |
| completionview_scorm | 1 |
| completionstatusrequired_scorm[4] | 0 |
| completionstatusrequired_scorm[2] | 1 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
And I am on "Course 1" course homepage with editing mode on
And I press "Add an activity or resource"
When I click on "Add a new SCORM" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
Then the field "None" matches value "0"
And the field "Add requirements" matches value "1"
And the field "completionview" matches value "1"
And the field "completionstatusrequired[4]" matches value "0"
And the field "completionstatusrequired[2]" matches value "1"
+66
View File
@@ -0,0 +1,66 @@
@mod @mod_scorm
Feature: Viewing scorm reports in separate and visible groups mode
In order to view reports for large courses
As a teacher
I need to filter the users on the reports page by group
Background:
And the following "courses" exist:
| fullname | shortname |
| Test Course 1 | C1 |
And the following "groups" exist:
| name | course | idnumber | participation |
| Group 1 | C1 | G1 | 1 |
| Group 2 | C1 | G2 | 1 |
| Group 3 | C1 | G3 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | TeacherG1 | 1 | teacher1@example.com |
| noneditor1 | NoneditorG1 | 1 | noneditor1@example.com |
| noneditor2 | NoneditorNone | 2 | noneditor2@example.com |
| user1 | User1G1 | 1 | user1@example.com |
| user2 | User2G2 | 2 | user2@example.com |
| user3 | User3None | 3 | user3@example.com |
| user4 | User4NPgroup | 4 | user4@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| noneditor1 | C1 | teacher |
| noneditor2 | C1 | teacher |
| user1 | C1 | student |
| user2 | C1 | student |
| user3 | C1 | student |
| user4 | C1 | student |
And the following "group members" exist:
| user | group |
| teacher1 | G1 |
| noneditor1 | G1 |
| user1 | G1 |
| user2 | G2 |
| user4 | G3 |
And the following "activities" exist:
| activity | course | name | packagefilepath | forcenewattempt | idnumber | groupmode |
| scorm | C1 | Separate scorm | mod/scorm/tests/packages/singlescobasic.zip | 0 | scorm1 | 1 |
| scorm | C1 | Visible scorm | mod/scorm/tests/packages/singlescobasic.zip | 0 | scorm2 | 2 |
Scenario Outline: Editing teachers should see all groups on the Reports page. Non-editing teachers should see just their own
groups in Separate groups mode, all groups in Visible groups mode.
Given I am on the "<scorm>" "scorm activity" page logged in as "<user>"
And I navigate to "Reports" in current page administration
Then I <all> see "All participants"
And I <G1> see "Group 1"
And I <G2> see "Group 2"
And I should not see "Group 3"
And I <user1> see "User1G1"
And I <user2> see "User2G2"
And I <user3> see "User3None"
And I <user4> see "User4NPgroup"
Examples:
| scorm | user | all | G1 | G2 | user1 | user2 | user3 | user4 |
| scorm1 | teacher1 | should | should | should | should | should | should | should |
| scorm1 | noneditor1 | should not | should | should not | should | should not | should not | should not |
| scorm1 | noneditor2 | should | should not | should not | should | should | should | should |
| scorm2 | teacher1 | should | should | should | should | should | should | should |
| scorm2 | noneditor1 | should | should | should | should | should not | should not | should not |
| scorm2 | noneditor2 | should | should | should | should | should not | should not | should not |
+34
View File
@@ -0,0 +1,34 @@
@mod @mod_scorm @_file_upload @_switch_iframe
Feature: Check a SCORM package with missing Organisational structure.
@javascript
Scenario: Add a scorm activity to a course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
When I log in as "teacher1"
And I add a scorm activity to course "Course 1" section "1"
And I set the following fields to these values:
| Name | MissingOrg SCORM package |
| Description | Description |
| ID number | Missingorg |
And I upload "mod/scorm/tests/packages/singlescobasic_missingorg.zip" file to "Package file" filemanager
And I click on "Save and display" "button"
Then I should see "MissingOrg SCORM package"
And I should see "Enter"
And I should see "Preview"
And I log out
And I am on the "Missingorg" Activity page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I switch to "contentFrame" iframe
And I should see "Play of the game"
@@ -0,0 +1,304 @@
@mod @mod_scorm @_file_upload @_switch_iframe
Feature: Scorm multi-sco review mode.
Check review mode and attempt handling.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
@javascript
Scenario: Test review mode with a single sco completion.
When the following "activities" exist:
| activity | course | name | packagefilepath | forcenewattempt |
| scorm | C1 | Basic Multi-sco SCORM package | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12.zip | 0 |
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page
And I should see "Enter"
And I press "Enter"
Then I should not see "Review mode"
@javascript
Scenario: Test review mode with all scos completed.
When the following "activities" exist:
| activity | course | name | packagefilepath | forcenewattempt |
| scorm | C1 | ADV Multi-sco SCORM package | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12.zip | 0 |
And I am on the "ADV Multi-sco SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I click on "Par?" "list_item"
And I switch to "scorm_object" iframe
And I should see "Par"
And I switch to the main frame
And I click on "Keeping Score" "list_item"
And I switch to "scorm_object" iframe
And I should see "Scoring"
And I switch to the main frame
And I click on "Other Scoring Systems" "list_item"
And I switch to "scorm_object" iframe
And I should see "Other Scoring Systems"
And I switch to the main frame
And I click on "The Rules of Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "The Rules of Golf"
And I switch to the main frame
And I click on "Playing Golf Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "Taking Care of the Course" "list_item"
And I switch to "scorm_object" iframe
And I should see "Etiquette - Care For the Course"
And I switch to the main frame
And I click on "Avoiding Distraction" "list_item"
And I switch to "scorm_object" iframe
And I should see "Etiquette - Avoiding Distraction"
And I switch to the main frame
And I click on "Playing Politely" "list_item"
And I switch to "scorm_object" iframe
And I should see "Etiquette - Playing the Game"
And I switch to the main frame
And I click on "Etiquette Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "Handicapping Overview" "list_item"
And I switch to "scorm_object" iframe
And I should see "Handicapping"
And I switch to the main frame
And I click on "Calculating a Handicap" "list_item"
And I switch to "scorm_object" iframe
And I should see "Calculating a Handicap"
And I switch to the main frame
And I click on "Calculating a Handicapped Score" "list_item"
And I switch to "scorm_object" iframe
And I should see "Calculating a Score"
And I switch to the main frame
And I click on "Handicapping Example" "list_item"
And I switch to "scorm_object" iframe
And I should see "Calculating a Score"
And I switch to the main frame
And I click on "Handicapping Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "How to Have Fun Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Have Fun Golfing"
And I switch to the main frame
And I click on "How to Make Friends Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Make Friends on the Golf Course"
And I switch to the main frame
And I click on "Having Fun Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "ADV Multi-sco SCORM package"
And I am on the "ADV Multi-sco SCORM package" "scorm activity" page
And I should see "Enter"
And I press "Enter"
Then I should see "Review mode"
@javascript
Scenario: Test force completed set to Always.
When the following "activities" exist:
| activity | course | name | packagefilepath | forcenewattempt |
| scorm | C1 | Basic Multi-sco SCORM package | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 2 |
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page
And I should see "Enter"
And I should not see "Start a new attempt"
And I press "Enter"
Then I should not see "Review mode"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
@javascript
Scenario: Test force completed set to when previous complete/passed/failed.
When the following "activities" exist:
| activity | course | name | packagefilepath | forcenewattempt |
| scorm | C1 | Basic Multi-sco SCORM package | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1 |
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page logged in as student1
And I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page
And I should see "Enter"
And I should not see "Start a new attempt"
And I press "Enter"
And I should not see "Review mode"
And I switch to "scorm_object" iframe
And I should see "Par"
And I switch to the main frame
And I click on "Keeping Score" "list_item"
And I switch to "scorm_object" iframe
And I should see "Scoring"
And I switch to the main frame
And I click on "Other Scoring Systems" "list_item"
And I switch to "scorm_object" iframe
And I should see "Other Scoring Systems"
And I switch to the main frame
And I click on "The Rules of Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "The Rules of Golf"
And I switch to the main frame
And I click on "Playing Golf Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "How to Have Fun Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Have Fun Golfing"
And I switch to the main frame
And I click on "How to Make Friends Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Make Friends on the Golf Course"
And I switch to the main frame
And I click on "Having Fun Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page
And I should see "Enter"
And I press "Enter"
Then I should not see "Review mode"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
@javascript
Scenario: Test force completed set to Always and student skipview
When the following "activities" exist:
| activity | course | name | packagefilepath | forcenewattempt | skipview |
| scorm | C1 | Basic Multi-sco SCORM package | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 2 | 2 |
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page logged in as student1
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page
Then I should not see "Review mode"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
@javascript
Scenario: Test force completed set to when previous complete/passed/failed.
When the following "activities" exist:
| activity | course | name | packagefilepath | forcenewattempt | skipview |
| scorm | C1 | Basic Multi-sco SCORM package | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1 | 2 |
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page logged in as student1
And I switch to "scorm_object" iframe
And I should see "Play of the game"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page
And I should not see "Review mode"
And I switch to "scorm_object" iframe
And I should see "Par"
And I switch to the main frame
And I click on "Keeping Score" "list_item"
And I switch to "scorm_object" iframe
And I should see "Scoring"
And I switch to the main frame
And I click on "Other Scoring Systems" "list_item"
And I switch to "scorm_object" iframe
And I should see "Other Scoring Systems"
And I switch to the main frame
And I click on "The Rules of Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "The Rules of Golf"
And I switch to the main frame
And I click on "Playing Golf Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I click on "How to Have Fun Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Have Fun Golfing"
And I switch to the main frame
And I click on "How to Make Friends Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I should see "How to Make Friends on the Golf Course"
And I switch to the main frame
And I click on "Having Fun Quiz" "list_item"
And I switch to "scorm_object" iframe
And I should see "Knowledge Check"
And I switch to the main frame
And I follow "Exit activity"
And I wait until the page is ready
And I should see "Basic Multi-sco SCORM package"
And I am on the "Basic Multi-sco SCORM package" "scorm activity" page
Then I should not see "Review mode"
And I switch to "scorm_object" iframe
And I should see "Play of the game"
@@ -0,0 +1,46 @@
@mod @mod_scorm @_file_upload @_switch_iframe @_alert
Feature: Confirm progress gets saved on unload events
In order to let students access a scorm package
As a teacher
I need to add scorm activity to a course
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I change window size to "large"
@javascript
Scenario: Test progress gets saved correctly when the user navigates away from the scorm activity
Given the following "activity" exists:
| activity | scorm |
| course | C1 |
| name | Runtime Basic Calls SCORM 2004 3rd Edition package |
| packagefilepath | mod/scorm/tests/packages/RuntimeBasicCalls_SCORM20043rdEdition.zip |
When I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Runtime Basic Calls SCORM 2004 3rd Edition package" "scorm activity" page
Then I should see "Enter"
And I press "Enter"
And I switch to "scorm_object" iframe
And I press "Next"
And I press "Next"
And I switch to "contentFrame" iframe
And I should see "Scoring"
And I switch to the main frame
And I am on the "Runtime Basic Calls SCORM 2004 3rd Edition package" "scorm activity" page
And I should see "Enter"
And I click on "Enter" "button" confirming the dialogue
And I switch to "scorm_object" iframe
And I switch to "contentFrame" iframe
And I should see "Scoring"
And I switch to the main frame
# Go away from the scorm to stop background requests
And I am on homepage
@@ -0,0 +1,151 @@
@mod @mod_scorm @core_completion @_file_upload @_switch_iframe
Feature: View activity completion in the SCORM activity
In order to have visibility of scorm completion requirements
As a student
I need to be able to view my scorm completion progress
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | enablecompletion |
| Course 1 | C1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activity" exists:
| activity | scorm |
| course | C1 |
| name | Music history |
| completion | 2 |
| completionstatusallscos | 0 |
# Add requirements
| packagefilepath | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip |
| completionstatusrequired | 6 |
| completionscorerequired | 3 |
| completionstatusrequired | 6 |
| completionstatusallscos | 1 |
| maxattempt | 1 |
| completionview | 1 |
| completionusegrade | 1 |
@javascript
Scenario: View automatic completion items as a teacher
Given I am on the "Music history" "scorm activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Receive a score of 3 or more" completion condition
And "Music history" should have the "Do all parts of this activity" completion condition
And "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "Complete or pass the activity" completion condition
@javascript
Scenario: Any grade and Passing grade options are hidden
Given I am on the "Music history" "scorm activity" page logged in as teacher1
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "completionusegrade" matches value "1"
Then I should not see "Any grade"
And I should not see "Passing grade"
@javascript
Scenario: View automatic completion items as a student
Given I am on the "Music history" "scorm activity" page logged in as student1
# We need a little taller window because Firefox is, apparently, unable to auto-scroll within
# an iframe, so we need to ensure that the "Save changes" button is visible in the viewport.
And I change window size to "1366x968"
And the "View" completion condition of "Music history" is displayed as "todo"
And the "Receive a score of 3 or more" completion condition of "Music history" is displayed as "todo"
And the "Do all parts of this activity" completion condition of "Music history" is displayed as "todo"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And the "Complete or pass the activity" completion condition of "Music history" is displayed as "todo"
And I press "Enter"
And I switch to the main frame
And I click on "Par?" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "Keeping Score" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "Other Scoring Systems" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "The Rules of Golf" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "Playing Golf Quiz" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I click on "[id='question_com.scorm.golfsamples.interactions.playing_1_1']" "css_element"
And I press "Submit Answers"
And I wait until "Score: 20" "text" exists
And I switch to the main frame
And I click on "How to Have Fun Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "How to Make Friends Playing Golf" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
And I click on "Having Fun Quiz" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I click on "[id='question_com.scorm.golfsamples.interactions.fun_1_False']" "css_element"
And I press "Submit Answers"
And I wait until "Score: 33" "text" exists
And I switch to the main frame
# We need to get some time till the last item is marked as done (or it won't be ready in slow databases).
# This could be a pause of a few seconds (working ok in super-slow oracle docker database), but re-visiting
# any of the pages seems to be doing the work too under that very same slow environment.
And I click on "Par?" "list_item"
And I switch to "scorm_object" iframe
And I wait until the page is ready
And I switch to the main frame
When I am on the "Music history" "scorm activity" page
Then the "View" completion condition of "Music history" is displayed as "done"
# Conditions that are not possible to achieve (eg score below requirement but all attempts used) are marked as failed.
And the "Receive a score of 3 or more" completion condition of "Music history" is displayed as "failed"
And the "Do all parts of this activity" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
And the "Complete or pass the activity" completion condition of "Music history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I am on the "Music history" "scorm activity" page logged in as teacher1
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the field "Students must manually mark the activity as done" to "1"
And I press "Save and display"
# Teacher view.
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I am on the "Music history" "scorm activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
@javascript
Scenario: Required minimum score should be greater than zero
Given I am on the "Music history" "scorm activity" page logged in as teacher1
And I navigate to "Settings" in current page administration
And I expand all fieldsets
When I set the field "completionscorerequired" to "0"
And I click on "Save and display" "button"
Then I should see "Minimum score must be greater than 0."
And "Enter" "button" should not exist
And I set the field "completionscorerequired" to "-1"
And I click on "Save and display" "button"
And I should see "Minimum score must be greater than 0."
And "Enter" "button" should not exist
And I set the field "completionscorerequired" to "5"
And I click on "Save and display" "button"
And I should not see "Minimum score must be greater than 0."
And "Enter" "button" should exist
@@ -0,0 +1,44 @@
@mod @mod_scorm
Feature: Scorm availability
In order to control when a SCORM activity is available to students
As a teacher
I need be able to set availability dates for the SCORM
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name | packagefilepath | timeopen | timeclose |
| scorm | C1 | Past SCORM | mod/scorm/tests/packages/singlesco_scorm12.zip | ##yesterday## | ##yesterday## |
| scorm | C1 | Current SCORM | mod/scorm/tests/packages/singlesco_scorm12.zip | ##yesterday## | ##tomorrow## |
| scorm | C1 | Future SCORM | mod/scorm/tests/packages/singlesco_scorm12.zip | ##tomorrow## | ##tomorrow## |
Scenario: Scorm activity with dates in the past should not be available.
When I am on the "Past SCORM" "scorm activity" page logged in as "student1"
Then the activity date in "Past SCORM" should contain "Opened:"
And the activity date in "Past SCORM" should contain "##yesterday noon##%A, %d %B %Y, %I:%M##"
And the activity date in "Past SCORM" should contain "Closed:"
And the activity date in "Past SCORM" should contain "##yesterday noon##%A, %d %B %Y, %I:%M##"
And "Enter" "button" should not exist
And I should not see "Preview"
And I am on the "Current SCORM" "scorm activity" page
And the activity date in "Current SCORM" should contain "Opened:"
And the activity date in "Current SCORM" should contain "##yesterday noon##%A, %d %B %Y, %I:%M##"
And the activity date in "Current SCORM" should contain "Closes:"
And the activity date in "Current SCORM" should contain "##tomorrow noon##%A, %d %B %Y, %I:%M##"
And "Enter" "button" should exist
And I should see "Preview"
And I am on the "Future SCORM" "scorm activity" page
And the activity date in "Future SCORM" should contain "Opens:"
And the activity date in "Future SCORM" should contain "##tomorrow noon##%A, %d %B %Y, %I:%M##"
And the activity date in "Future SCORM" should contain "Closes:"
And the activity date in "Future SCORM" should contain "##tomorrow noon##%A, %d %B %Y, %I:%M##"
And "Enter" "button" should not exist
And I should not see "Preview"
@@ -0,0 +1,58 @@
@mod @mod_scorm
Feature: Scorm display options
In order to set how Scorm is displayed
As a teacher
I need to be able to choose from Scorm package display options
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | teacher1@example.com |
| student1 | Student | One | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format | activitytype |
| Course 1 | C1 | topics | |
| Course 2 | C2 | singleactivity | scorm |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| teacher1 | C2 | editingteacher |
| student1 | C2 | student |
@javascript
Scenario Outline: Teacher can change to various Scorm package display options
Given the following "activities" exist:
| activity | course | name | packagefilepath | hidetoc | nav |
| scorm | C1 | C1 Scorm 1 | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12.zip | <toc> | <shownavigation> |
And I am on the "C1 Scorm 1" "scorm activity" page logged in as teacher1
When I press "Preview"
# Confirm TOC display
# Used css_element to check > and < button display in TOC since similar buttons also exist in navigation
Then I <tocdisplay> see "Golf Explained - Minimum Run-time Calls"
And "[title='Show']" "css_element" <showdisplay> exist
And "[title='Hide']" "css_element" <hidedisplay> exist
# Confirm TOC dropdown display
And "scoid" "select" <tocdropdown> exist
# Confirm the navigation display
And "[id='scorm_nav']" "css_element" <navbar> exist
Examples:
| toc | shownavigation | tocdisplay | showdisplay | hidedisplay | tocdropdown | navbar |
| 1 | | should not | should | should not | should not | should not |
| 2 | 1 | should | should | should not | should | should not |
| 0 | 0 | should | should not | should | should not | should not |
| 0 | 1 | should | should not | should | should not | should |
Scenario: Student can exit Scorm activity in single activity course format
Given the following "activities" exist:
| activity | course | name | packagefilepath | popup |
| scorm | C2 | C2 Scorm 1 | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12.zip | 0 |
And I am on the "C2 Scorm 1" "scorm activity" page logged in as student1
And I press "Enter"
When I click on "Exit activity" "link"
# Confirm that student can exit activity
Then "Preview" "button" should exist
And "Enter" "button" should exist
And "Exit activity" "link" should not exist
And I should not see "Golf Explained - Minimum Run-time Calls"
@@ -0,0 +1,38 @@
@mod @mod_scorm
Feature: Scorm with no calendar capabilites
In order to allow work effectively
As a teacher
I need to be able to create SCORM activities even when I cannot edit calendar events
Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activity" exists:
| activity | scorm |
| course | C1 |
| name | Test scorm name |
| timeopen | ##first day of January 2017## |
| timeclose | ##first day of February 2017## |
| packagefilepath | mod/scorm/tests/packages/singlesco_scorm12.zip |
And I log in as "admin"
And I am on the "Course 1" "permissions" page
And I override the system permissions of "Teacher" role with:
| capability | permission |
| moodle/calendar:manageentries | Prohibit |
And I log out
@javascript @_file_upload @_switch_iframe
Scenario: Editing a scorm activity without calendar permission
Given I am on the "Test scorm name" "scorm activity editing" page logged in as teacher1
When I set the following fields to these values:
| id_timeopen_year | 2018 |
| id_timeclose_year | 2018 |
And I press "Save and return to course"
Then I should see "Test scorm name"