Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_lesson @core_completion
2
Feature: View activity completion in the lesson activity
3
  In order to have visibility of lesson completion requirements
4
  As a student
5
  I need to be able to view my lesson 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                   | lesson        |
21
      | course                     | C1            |
22
      | idnumber                   | mh1           |
23
      | name                       | Music history |
24
      | section                    | 1             |
25
      | completion                 | 2             |
26
      | completionview             | 1             |
27
      | completionusegrade         | 1             |
28
      | completionendreached       | 1             |
29
      | completiontimespentenabled | 1             |
30
      | completiontimespent        | 3             |
31
    And the following "mod_lesson > pages" exist:
32
      | lesson        | qtype   | title                | content                                |
33
      | Music history | content | Music history part 1 |                                        |
34
      | Music history | essay   | Music essay          | Write a really interesting music essay |
35
    And the following "mod_lesson > answers" exist:
36
      | page                 | answer                      | jumpto    | score |
37
      | Music history part 1 | The history of music part 1 | Next page | 0     |
38
      | Music essay          |                             | Next page | 1     |
39
 
40
  Scenario: View automatic completion items as a teacher
41
    When I am on the "Music history" "lesson activity" page logged in as teacher1
42
    Then "Music history" should have the "View" completion condition
43
    And "Music history" should have the "Spend at least 3 secs on this activity" completion condition
44
    And "Music history" should have the "Go through the activity to the end" completion condition
45
    And "Music history" should have the "Receive a grade" completion condition
46
 
47
  Scenario: View automatic completion items as a student
48
    Given I am on the "Music history" "lesson activity" page logged in as student1
49
    And the "View" completion condition of "Music history" is displayed as "done"
50
    And the "Spend at least 3 secs on this activity" completion condition of "Music history" is displayed as "todo"
51
    And the "Go through the activity to the end" completion condition of "Music history" is displayed as "todo"
52
    And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
53
    When I am on the "Music history" "lesson activity" page
54
    And I wait "4" seconds
55
    And I reload the page
56
    And the "View" completion condition of "Music history" is displayed as "done"
57
    And the "Spend at least 3 secs on this activity" completion condition of "Music history" is displayed as "done"
58
    And the "Go through the activity to the end" completion condition of "Music history" is displayed as "todo"
59
    And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
60
    And I press "The history of music part 1"
61
    And I set the field "Your answer" to "Some drummers play with their sticks flipped around"
62
    And I press "Submit"
63
    Then the "View" completion condition of "Music history" is displayed as "done"
64
    And the "Spend at least 3 secs on this activity" completion condition of "Music history" is displayed as "done"
65
    And the "Go through the activity to the end" completion condition of "Music history" is displayed as "done"
66
    And the "Receive a grade" completion condition of "Music history" is displayed as "done"
67
 
68
  @javascript
69
  Scenario: Use manual completion
70
    Given I am on the "Music history" "lesson activity editing" page logged in as teacher1
71
    And I expand all fieldsets
72
    And I set the field "Students must manually mark the activity as done" to "1"
73
    And I press "Save and display"
74
    # Teacher view.
75
    And the manual completion button for "Music history" should be disabled
76
    # Student view.
77
    When I am on the "Music history" "lesson activity" page logged in as student1
78
    Then the manual completion button of "Music history" is displayed as "Mark as done"
79
    And I toggle the manual completion state of "Music history"
80
    And the manual completion button of "Music history" is displayed as "Done"