Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_completionstatus @core_completion @javascript
2
Feature: Course completion state should match completion criteria
3
  In order to understand the configuration or status of an course's completion
4
  As a user
5
  I need to see the appropriate completion information on course and dashboard pages
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email | idnumber |
10
      | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11
      | student1 | Student | 1 | student1@example.com | S1 |
12
    And the following "courses" exist:
13
      | fullname | shortname | category | enablecompletion | showcompletionconditions |
14
      | Course 1 | C1        | 0        | 1                | 1                        |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
    And the following "activity" exists:
20
      | activity                            | assign                  |
21
      | course                              | C1                      |
22
      | name                                | Test assignment name    |
23
      | assignsubmission_onlinetext_enabled | 1                       |
24
      | grade[modgrade_type]                | Point                   |
25
      | grade[modgrade_point]               | 100                     |
26
      | gradepass                           | 70                      |
27
      | completion                          | 2                       |
28
      | completionusegrade                  | 1                       |
29
      | completionpassgrade                 | 1                       |
30
    And the following "blocks" exist:
31
      | blockname        | contextlevel | reference | pagetypepattern | defaultregion |
32
      | completionstatus | Course       | C1        | course-view-*   | side-pre      |
33
    And I am on the "Course 1" course page logged in as teacher1
34
    And I navigate to "Course completion" in current page administration
35
    And I click on "Condition: Activity completion" "link"
36
    And I set the field "Assignment - Test assignment name" to "1"
37
    And I press "Save changes"
38
 
39
  Scenario: Completion status show match completion criteria when passgrage condition is set.
40
    Given I am on the "Course 1" course page logged in as "student1"
41
    And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
42
    And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "todo"
43
    And I should see "Status: Not yet started" in the "Course completion status" "block"
44
    When the following "mod_assign > submissions" exist:
45
      | assign                 | user     | onlinetext                           |
46
      | Test assignment name   | student1 | This is a submission for assignment  |
47
    And the following "grade grades" exist:
48
      | gradeitem              | user     | grade |
49
      | Test assignment name   | student1 | 50    |
50
    And I reload the page
51
    Then I should see "Status: Not yet started" in the "Course completion status" "block"
52
    And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
53
    And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
54
    And I am on the "My courses" page
55
    And I should not see "100%" in the "Course overview" "block"
56
    And I am on the "Course 1" course page logged in as teacher1
57
    And I navigate to "Reports > Activity completion" in current page administration
58
    And "Student 1, Test assignment name: Completed (did not achieve pass grade)" "icon" should exist in the "Student 1" "table_row"
59
    And I navigate to "Reports > Course completion" in current page administration
60
    And "Student 1, Test assignment name: Completed (did not achieve pass grade)" "icon" should exist in the "Student 1" "table_row"
61
    And "Student 1, Course complete: Not completed" "icon" should exist in the "Student 1" "table_row"
62
    And the following "grade grades" exist:
63
      | gradeitem              | user     | grade |
64
      | Test assignment name   | student1 | 75    |
65
    And I navigate to "Reports > Activity completion" in current page administration
66
    And "Student 1, Test assignment name: Completed (achieved pass grade)" "icon" should exist in the "Student 1" "table_row"
67
    And I navigate to "Reports > Course completion" in current page administration
68
    And "Student 1, Test assignment name: Completed (achieved pass grade)" "icon" should exist in the "Student 1" "table_row"
69
    And "Student 1, Course complete: Completed" "icon" should exist in the "Student 1" "table_row"
70
    And I am on the "Course 1" course page logged in as "student1"
71
    And I should see "Status: Complete" in the "Course completion status" "block"
72
    And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
73
    And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
74
    And I am on the "My courses" page
75
    And I should see "100%" in the "Course overview" "block"
76
 
77
  Scenario: Completion status show match completion criteria when passgrage condition is not set.
78
    Given I am on the "Test assignment name" "assign activity editing" page logged in as teacher1
79
    And I set the following fields to these values:
80
      | completionpassgrade       | 0            |
81
    And I press "Save and return to course"
82
    And I am on the "Course 1" course page logged in as "student1"
83
    And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
84
    And I should see "Status: Not yet started" in the "Course completion status" "block"
85
    When the following "mod_assign > submissions" exist:
86
      | assign                 | user     | onlinetext                    |
87
      | Test assignment name   | student1 | I'm the student1 submission   |
88
    And the following "grade grades" exist:
89
      | gradeitem              | user     | grade |
90
      | Test assignment name   | student1 | 50    |
91
    And I reload the page
92
    # TODO: Expected status is Complete but activity is marked as completed with a failed icon.
93
    # Then I should see "Status: Complete" in the "Course completion status" "block"
94
    Then I should see "Status: Pending" in the "Course completion status" "block"
95
    # Once MDL-75582 is fixed "failed" should be changed to "done"
96
    And the "Receive a grade" completion condition of "Test assignment name" is displayed as "failed"
97
    And I am on the "My courses" page
98
    And I should see "100%" in the "Course overview" "block"
99
    And I am on the "Course 1" course page logged in as teacher1
100
    And I navigate to "Reports > Activity completion" in current page administration
101
    And "Student 1, Test assignment name: Completed (did not achieve pass grade)" "icon" should exist in the "Student 1" "table_row"
102
    And I navigate to "Reports > Course completion" in current page administration
103
    And "Student 1, Test assignment name: Completed (did not achieve pass grade)" "icon" should exist in the "Student 1" "table_row"
104
    And "Student 1, Course complete: Completed" "icon" should exist in the "Student 1" "table_row"
105
    And the following "grade grades" exist:
106
      | gradeitem              | user     | grade |
107
      | Test assignment name   | student1 | 75    |
108
    And I navigate to "Reports > Activity completion" in current page administration
109
    And "Student 1, Test assignment name: Completed (achieved pass grade)" "icon" should exist in the "Student 1" "table_row"
110
    And I navigate to "Reports > Course completion" in current page administration
111
    And "Student 1, Test assignment name: Completed (achieved pass grade)" "icon" should exist in the "Student 1" "table_row"
112
    And "Student 1, Course complete: Completed" "icon" should exist in the "Student 1" "table_row"
113
    And I am on the "Course 1" course page logged in as "student1"
114
    And I should see "Status: Complete" in the "Course completion status" "block"
115
    And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
116
    And I am on the "My courses" page
117
    And I should see "100%" in the "Course overview" "block"