Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_forum @core_completion
2
Feature: View activity completion in the forum activity
3
  In order to have visibility of forum completion requirements
4
  As a student
5
  I need to be able to view my forum 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 | forum         |
21
      | course   | C1            |
22
      | idnumber | mh1           |
23
      | name     | Music history |
24
    And I am on the "Music history" "forum activity editing" page logged in as teacher1
25
    And I expand all fieldsets
26
    And I set the following fields to these values:
27
      | Whole forum grading > Type   | Point        |
28
      | Add requirements             | 1            |
29
      | View the activity            | 1            |
30
      | Receive a grade              | 1            |
31
      | completiongradeitemnumber    | Whole forum |
32
      | Any grade                    | 1            |
33
      | completionpostsenabled       | 1            |
34
      | completionposts              | 2            |
35
      | completiondiscussionsenabled | 1            |
36
      | completiondiscussions        | 1            |
37
      | completionrepliesenabled     | 1            |
38
      | completionreplies            | 1            |
39
    And I press "Save and display"
40
 
41
  @javascript
42
  Scenario: View automatic completion items as a teacher
43
    When I am on the "Music history" "forum activity" page logged in as teacher1
44
    Then "Music history" should have the "View" completion condition
45
    And "Music history" should have the "Start discussions: 1" completion condition
46
    And "Music history" should have the "Make forum posts: 2" completion condition
47
    And "Music history" should have the "Post replies: 1" completion condition
48
    And "Music history" should have the "Receive a grade" completion condition
49
 
50
  @javascript
51
  Scenario: View automatic completion items as a student
52
    Given I am on the "Music history" "forum activity" page logged in as student1
53
    And the "View" completion condition of "Music history" is displayed as "done"
54
    And the "Start discussions: 1" completion condition of "Music history" is displayed as "todo"
55
    And the "Make forum posts: 2" completion condition of "Music history" is displayed as "todo"
56
    And the "Post replies: 1" completion condition of "Music history" is displayed as "todo"
57
    And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
58
    And I add a new discussion to "Music history" forum with:
59
       | Subject | Fun instruments |
60
       | Message | I like drums    |
61
    And I am on the "Music history" "forum activity" page
62
    And the "View" completion condition of "Music history" is displayed as "done"
63
    And the "Start discussions: 1" completion condition of "Music history" is displayed as "done"
64
    And the "Make forum posts: 2" completion condition of "Music history" is displayed as "todo"
65
    And the "Post replies: 1" completion condition of "Music history" is displayed as "todo"
66
    And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
67
    And I reply "Fun instruments" post from "Music history" forum with:
68
      | Subject | Reply 1 to Fun instruments |
69
      | Message | Guitar is also Fun         |
70
    And I am on the "Music history" "forum activity" page
71
    And the "View" completion condition of "Music history" is displayed as "done"
72
    And the "Start discussions: 1" completion condition of "Music history" is displayed as "done"
73
    And the "Make forum posts: 2" completion condition of "Music history" is displayed as "done"
74
    And the "Post replies: 1" completion condition of "Music history" is displayed as "done"
75
    And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
76
    # Grade the student
77
    And I am on the "Music history" "forum activity" page logged in as teacher1
78
    And I press "Grade users"
79
    And I set the field "grade" to "33"
80
    And I press "Save"
81
    And I press "Close grader"
82
    # All conditions should now be completed.
83
    When I am on the "Music history" "forum activity" page logged in as student1
84
    Then the "View" completion condition of "Music history" is displayed as "done"
85
    And the "Start discussions: 1" completion condition of "Music history" is displayed as "done"
86
    And the "Make forum posts: 2" completion condition of "Music history" is displayed as "done"
87
    And the "Post replies: 1" completion condition of "Music history" is displayed as "done"
88
    And the "Receive a grade" completion condition of "Music history" is displayed as "done"
89
 
90
  @javascript
91
  Scenario: Use manual completion
92
    Given I am on the "Music history" "forum activity editing" page logged in as teacher1
93
    And I expand all fieldsets
94
    And I set the field "Students must manually mark the activity as done" to "1"
95
    And I press "Save and display"
96
    # Teacher view.
97
    And the manual completion button for "Music history" should be disabled
98
    # Student view.
99
    When I am on the "Music history" "forum activity" page logged in as student1
100
    Then the manual completion button of "Music history" is displayed as "Mark as done"
101
    And I toggle the manual completion state of "Music history"
102
    And the manual completion button of "Music history" is displayed as "Done"