Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_h5pactivity @core_h5p @_file_upload @_switch_iframe @javascript @core_completion
2
Feature: Pass grade activity completion information in the h5p activity
3
 
4
  Background:
5
    Given the following "users" exist:
6
      | username | firstname | lastname | email                |
7
      | student1 | Vinnie    | Student1 | student1@example.com |
8
      | student2 | Vinnie    | Student2 | student2@example.com |
9
      | student3 | Vinnie    | Student3 | student3@example.com |
10
      | teacher1 | Darrell   | Teacher1 | teacher1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | category | enablecompletion |
13
      | Course 1 | C1        | 0        | 1                |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | student1 | C1     | student        |
17
      | student2 | C1     | student        |
18
      | student3 | C1     | student        |
19
      | teacher1 | C1     | editingteacher |
20
    And the following "activity" exists:
21
      | activity            | h5pactivity                          |
22
      | course              | C1                                   |
23
      | name                | Music history                        |
24
      | completion          | 2                                    |
25
      | completionview      | 1                                    |
26
      | completionusegrade  | 1                                    |
27
      | completionpassgrade | 1                                    |
28
      | gradepass           | 25                                   |
29
      | packagefilepath     | h5p/tests/fixtures/filltheblanks.h5p |
30
 
31
  Scenario: View automatic completion items
32
    # Teacher view.
33
    Given I am on the "Music history" "h5pactivity activity" page logged in as teacher1
34
    And "Music history" should have the "View" completion condition
35
    And "Music history" should have the "Receive a grade" completion condition
36
    And "Music history" should have the "Receive a passing grade" completion condition
37
    And I log out
38
    # Student view.
39
    When I am on the "Music history" "h5pactivity activity" page logged in as student1
40
    And I switch to "h5p-player" class iframe
41
    And I switch to "h5p-iframe" class iframe
42
    And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
43
    And I reload the page
44
    And I am on the "Music history" "h5pactivity activity" page logged in as student2
45
    And I switch to "h5p-player" class iframe
46
    And I switch to "h5p-iframe" class iframe
47
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 1 of 4\")]" to "Brasilia"
48
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 2 of 4\")]" to "Washington"
49
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 3 of 4\")]" to "Berlin"
50
    And I set the field with xpath "//input[contains(@aria-label,\"Blank input 4 of 4\")]" to "Canberra"
51
    And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
52
    And I switch to the main frame
53
    And I reload the page
54
    Then the "View" completion condition of "Music history" is displayed as "done"
55
    And the "Receive a grade" completion condition of "Music history" is displayed as "done"
56
    And the "Receive a passing grade" completion condition of "Music history" is displayed as "done"
57
    And I log out
58
    And I am on the "Music history" "h5pactivity activity" page logged in as student1
59
    And the "View" completion condition of "Music history" is displayed as "done"
60
    And the "Receive a grade" completion condition of "Music history" is displayed as "done"
61
    And the "Receive a passing grade" completion condition of "Music history" is displayed as "failed"
62
    And I am on the "Course 1" "course" page logged in as "teacher1"
63
    And "Vinnie Student1" user has completed "Music history" activity
64
    And "Vinnie Student2" user has completed "Music history" activity
65
    And "Vinnie Student3" user has not completed "Music history" activity