1 |
efrain |
1 |
@mod @mod_h5pactivity @core_h5p @_file_upload @_switch_iframe @javascript @core_completion
|
|
|
2 |
Feature: View activity completion information in the h5p activity
|
|
|
3 |
In order to have visibility of h5p completion requirements
|
|
|
4 |
As a student
|
|
|
5 |
I need to be able to view my h5p 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 | showcompletionconditions |
|
|
|
14 |
| Course 1 | C1 | 1 | 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 | h5pactivity |
|
|
|
21 |
| course | C1 |
|
|
|
22 |
| name | Music history |
|
|
|
23 |
| completion | 2 |
|
|
|
24 |
| completionview | 1 |
|
|
|
25 |
| completionusegrade | 1 |
|
|
|
26 |
| packagefilepath | h5p/tests/fixtures/filltheblanks.h5p |
|
|
|
27 |
|
|
|
28 |
Scenario: View automatic completion items
|
|
|
29 |
Given I am on the "Music history" "h5pactivity activity" page logged in as teacher1
|
|
|
30 |
# Teacher view.
|
|
|
31 |
And "Music history" should have the "View" completion condition
|
|
|
32 |
And "Music history" should have the "Receive a grade" completion condition
|
|
|
33 |
# Student view.
|
|
|
34 |
When I am on the "Music history" "h5pactivity activity" page logged in as student1
|
|
|
35 |
And I switch to "h5p-player" class iframe
|
|
|
36 |
And I switch to "h5p-iframe" class iframe
|
|
|
37 |
And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
|
|
|
38 |
And I reload the page
|
|
|
39 |
Then the "View" completion condition of "Music history" is displayed as "done"
|
|
|
40 |
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
|
|
|
41 |
|
|
|
42 |
Scenario: Use manual completion
|
|
|
43 |
Given I am on the "Music history" "h5pactivity activity editing" page logged in as teacher1
|
|
|
44 |
And I expand all fieldsets
|
|
|
45 |
And I set the field "Students must manually mark the activity as done" to "1"
|
|
|
46 |
And I press "Save and display"
|
|
|
47 |
# Teacher view.
|
|
|
48 |
And I am on the "Music history" "h5pactivity activity" page
|
|
|
49 |
And the manual completion button for "Music history" should be disabled
|
|
|
50 |
# Student view.
|
|
|
51 |
When I am on the "Music history" "h5pactivity activity" page logged in as student1
|
|
|
52 |
Then the manual completion button of "Music history" is displayed as "Mark as done"
|
|
|
53 |
And I toggle the manual completion state of "Music history"
|
|
|
54 |
And the manual completion button of "Music history" is displayed as "Done"
|