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
2
Feature: Enable Block Completion in a course using activity completion
3
  In order to view the completion block in a course
4
  As a teacher
5
  I can add completion block to a course and set up activity completion
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 |
14
      | Course 1 | C1        | 0        | 1                |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
    And the following "activities" exist:
20
      | activity   | course | idnumber   | name             | gradepass | completion   | completionview | completionusegrade | completionpassgrade |
21
      | page       | C1     | page1      | Test page name   |           | 2            | 1              | 0                  | 0                   |
22
      | assign     | C1     | assign1    | Test assign name | 50        | 2            | 0              | 1                  | 1                   |
23
    And the following "blocks" exist:
24
      | blockname        | contextlevel | reference | pagetypepattern | defaultregion |
25
      | completionstatus | Course       | C1        | course-view-*   | side-pre      |
26
 
27
  Scenario: Completion status block when student has not started any activities
28
    Given I am on the "Course 1" course page logged in as teacher1
29
    And I navigate to "Course completion" in current page administration
30
    And I expand all fieldsets
31
    And I set the following fields to these values:
32
      | Test page name | 1 |
33
    And I press "Save changes"
34
    When I am on the "Course 1" course page logged in as student1
35
    Then I should see "Status: Not yet started" in the "Course completion status" "block"
36
    And I should see "0 of 1" in the "Activity completion" "table_row"
37
 
38
  Scenario: Completion status block when student has completed a page
39
    Given I am on the "Course 1" course page logged in as teacher1
40
    And I navigate to "Course completion" in current page administration
41
    And I expand all fieldsets
42
    And I set the following fields to these values:
43
      | Test page name | 1 |
44
    And I press "Save changes"
45
    When I am on the "Test page name" "page activity" page logged in as student1
46
    And I am on "Course 1" course homepage
47
    Then I should see "Status: Complete" in the "Course completion status" "block"
48
    And I should see "1 of 1" in the "Activity completion" "table_row"
49
    And I follow "More details"
50
    And I should see "Yes" in the "Activity completion" "table_row"
51
 
52
  Scenario: Completion status block with items with passing grade
53
    Given I am on the "Course 1" course page logged in as teacher1
54
    And I navigate to "Course completion" in current page administration
55
    And I expand all fieldsets
56
    And I set the following fields to these values:
57
      | Test assign name | 1 |
58
    And I press "Save changes"
59
    And the following "grade grades" exist:
60
      | gradeitem           | user     | grade |
61
      | Test assign name    | student1 | 53    |
62
    When I am on the "Course 1" course page logged in as student1
63
    Then I should see "Status: Complete" in the "Course completion status" "block"
64
    And I should see "1 of 1" in the "Activity completion" "table_row"
65
    And I trigger cron
66
    And I am on "Course 1" course homepage
67
    And I follow "More details"
68
    And I should see "Achieving grade, Achieving passing grade" in the "Activity completion" "table_row"
69
    And I should see "Yes" in the "Activity completion" "table_row"
70
 
71
  Scenario: Completion status block with items with failing grade
72
    Given I am on the "Course 1" course page logged in as teacher1
73
    And the following "grade grades" exist:
74
      | gradeitem           | user     | grade |
75
      | Test assign name    | student1 | 49    |
76
    And I navigate to "Course completion" in current page administration
77
    And I expand all fieldsets
78
    And I set the following fields to these values:
79
      | Test assign name | 1 |
80
    And I press "Save changes"
81
    When I am on the "Course 1" course page logged in as student1
82
    Then I should see "Status: Not yet started" in the "Course completion status" "block"
83
    And I should see "0 of 1" in the "Activity completion" "table_row"
84
    And I trigger cron
85
    And I am on "Course 1" course homepage
86
    And I follow "More details"
87
    And I should see "Achieving grade, Achieving passing grade" in the "Activity completion" "table_row"
88
    And I should see "No" in the "Activity completion" "table_row"