Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_completionstatus
2
Feature: Enable Block Completion in a course using manual completion by others
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 manual completion by others
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email | idnumber |
10
      | teacher1 | Teacher | 1 | teacher1@example.com | T1 |
11
      | teacher2 | Teacher | 2 | teacher1@example.com | T2 |
12
      | student1 | Student | 1 | student1@example.com | S1 |
13
    And the following "courses" exist:
14
      | fullname | shortname | category | enablecompletion |
15
      | Course 1 | C1        | 0        | 1                |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher1 | C1     | editingteacher |
19
      | teacher2 | C1     | teacher        |
20
      | student1 | C1     | student        |
21
    And the following "blocks" exist:
22
      | blockname        | contextlevel | reference | pagetypepattern | defaultregion |
23
      | completionstatus | Course       | C1        | course-view-*   | side-pre      |
24
 
25
  Scenario: Add the block to a the course and mark a student complete.
26
    Given I am on the "Course 1" course page logged in as teacher1
27
    And I navigate to "Course completion" in current page administration
28
    And I expand all fieldsets
29
    And I set the following fields to these values:
30
      | Teacher | 1 |
31
    And I press "Save changes"
32
    When I am on the "Course 1" course page logged in as student1
33
    And I should see "Status: Not yet started" in the "Course completion status" "block"
34
    And I should see "No" in the "Teacher" "table_row"
35
    And I am on the "Course 1" course page logged in as teacher1
36
    And I navigate to "Reports" in current page administration
37
    And I click on "Course completion" "link" in the "region-main" "region"
38
    And I follow "Click to mark user complete"
39
    # Running completion task just after clicking sometimes fail, as record
40
    # should be created before the task runs.
41
    And I wait "1" seconds
42
    And I run the scheduled task "core\task\completion_regular_task"
43
    And I am on site homepage
44
    And I am on the "Course 1" course page logged in as student1
45
    Then I should see "Status: Complete" in the "Course completion status" "block"
46
    And I should see "Yes" in the "Teacher" "table_row"
47
    And I follow "More details"
48
    And I should see "Yes" in the "Marked complete by Teacher" "table_row"
49
 
50
  Scenario: Add the block to a the course and require multiple roles to mark a student complete.
51
    Given I am on the "Course 1" course page logged in as teacher1
52
    And I navigate to "Course completion" in current page administration
53
    And I expand all fieldsets
54
    And I set the following fields to these values:
55
      | Teacher             | 1 |
56
      | Non-editing teacher | 1 |
57
      | id_role_aggregation | ALL selected roles to mark when the condition is met |
58
    And I press "Save changes"
59
    When I am on the "Course 1" course page logged in as student1
60
    And I should see "Status: Not yet started" in the "Course completion status" "block"
61
    And I should see "No" in the "Teacher" "table_row"
62
    And I should see "No" in the "Non-editing teacher" "table_row"
63
    And I am on the "Course 1" course page logged in as teacher1
64
    And I navigate to "Reports" in current page administration
65
    And I click on "Course completion" "link" in the "region-main" "region"
66
    And I follow "Click to mark user complete"
67
    And I am on the "Course 1" course page logged in as student1
68
    And I should see "Status: In progress" in the "Course completion status" "block"
69
    And I should see "Yes" in the "Teacher" "table_row"
70
    And I should see "No" in the "Non-editing teacher" "table_row"
71
    And I follow "More details"
72
    And I should see "Yes" in the "Marked complete by Teacher" "table_row"
73
    And I should see "No" in the "Marked complete by Non-editing teacher" "table_row"
74
    And I am on the "Course 1" course page logged in as teacher2
75
    And I navigate to "Reports" in current page administration
76
    And I click on "Course completion" "link" in the "region-main" "region"
77
    And I follow "Click to mark user complete"
78
    # Running completion task just after clicking sometimes fail, as record
79
    # should be created before the task runs.
80
    And I wait "1" seconds
81
    And I run the scheduled task "core\task\completion_regular_task"
82
    And I am on site homepage
83
    And I am on the "Course 1" course page logged in as student1
84
    Then I should see "Status: Complete" in the "Course completion status" "block"
85
    And I should see "Yes" in the "Teacher" "table_row"
86
    And I should see "Yes" in the "Non-editing teacher" "table_row"
87
    And I follow "More details"
88
    And I should see "Yes" in the "Marked complete by Teacher" "table_row"
89
    And I should see "Yes" in the "Marked complete by Non-editing teacher" "table_row"