Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_assign
2
Feature: Remove a submission
3
  In order to restart an assignment for a student
4
  As a teacher
5
  I need to remove a student submission at any time
6
 
7
  Background:
8
    Given the following config values are set as admin:
9
      | enabletimelimit | 1 | assign |
10
    And the following "courses" exist:
11
      | fullname | shortname | category | groupmode |
12
      | Course 1 | C1 | 0 | 0 |
13
    And the following "users" exist:
14
      | username | firstname | lastname | email |
15
      | teacher1 | Teacher | 1 | teacher1@example.com |
16
      | student1 | Student | 1 | student1@example.com |
17
      | student2 | Student | 2 | student2@example.com |
18
    And the following "course enrolments" exist:
19
      | user | course | role |
20
      | teacher1 | C1 | editingteacher |
21
      | student1 | C1 | student |
22
      | student2 | C1 | student |
23
    And the following "role capability" exists:
24
      | role                           | editingteacher |
25
      | mod/assign:editothersubmission | allow          |
26
    And the following "groups" exist:
27
      | name    | course | idnumber |
28
      | Group 1 | C1     | G1       |
29
    And the following "group members" exist:
30
      | user     | group   |
31
      | student1 | G1 |
32
      | student2 | G1 |
33
 
34
  @javascript @skip_chrome_zerosize
35
  Scenario: Remove a submission should remove the data that was submitted
36
    Given the following "activity" exists:
37
      | activity                             | assign                |
38
      | course                               | C1                    |
39
      | name                                 | Test assignment name  |
40
      | submissiondrafts                     | 0                     |
41
      | assignsubmission_onlinetext_enabled  | 1                     |
42
      | assignsubmission_file_enabled        | 0                     |
43
      | submissiondrafts                     | 0                     |
44
    And the following "mod_assign > submissions" exist:
45
      | assign                | user      | onlinetext                  |
46
      | Test assignment name  | student1  | I'm the student submission  |
47
 
48
    And I am on the "Test assignment name" Activity page logged in as teacher1
49
    And I follow "View all submissions"
50
    And I open the action menu in "Student 1" "table_row"
51
    When I follow "Remove submission"
52
    And I click on "Continue" "button"
53
    Then I should not see "I'm the student submission"
54
    And "Student 1" row "Status" column of "generaltable" table should contain "No submission"
55
    And I log out
56
 
57
    And I am on the "Test assignment name" Activity page logged in as student1
58
    And I should not see "I'm the student submission"
59
    And I should see "No submissions have been made yet" in the "Submission status" "table_row"
60
 
61
  @javascript @skip_chrome_zerosize
62
  Scenario: Remove a group submission should remove the data from all group members
63
    Given the following "activity" exists:
64
      | activity                             | assign                |
65
      | course                               | C1                    |
66
      | name                                 | Test assignment name  |
67
      | submissiondrafts                     | 0                     |
68
      | assignsubmission_onlinetext_enabled  | 1                     |
69
      | assignsubmission_file_enabled        | 0                     |
70
      | teamsubmission                       | 1                     |
71
      | submissiondrafts                     | 0                     |
72
    And the following "mod_assign > submissions" exist:
73
      | assign                | user      | onlinetext                  |
74
      | Test assignment name  | student1  | I'm the student submission  |
75
 
76
    And I am on the "Test assignment name" Activity page logged in as teacher1
77
    And I follow "View all submissions"
78
    And I open the action menu in "Student 1" "table_row"
79
    When I follow "Remove submission"
80
    And I click on "Continue" "button"
81
    Then I should not see "I'm the student submission"
82
    And "Student 1" row "Status" column of "generaltable" table should contain "No submission"
83
    And I log out
84
 
85
    And I am on the "Test assignment name" Activity page logged in as student2
86
    And I should not see "I'm the student submission"
87
    And I should see "Nothing has been submitted for this assignment" in the "Submission status" "table_row"
88
 
89
  @javascript @skip_chrome_zerosize
90
  Scenario: A student can remove their own submission
91
    Given the following "activity" exists:
92
      | activity                             | assign                |
93
      | course                               | C1                    |
94
      | name                                 | Test assignment name  |
95
      | submissiondrafts                     | 0                     |
96
      | assignsubmission_onlinetext_enabled  | 1                     |
97
      | assignsubmission_file_enabled        | 0                     |
98
      | submissiondrafts                     | 0                     |
99
    And the following "mod_assign > submissions" exist:
100
      | assign                | user      | onlinetext                  |
101
      | Test assignment name  | student1  | I'm the student submission  |
102
 
103
    And I am on the "Test assignment name" Activity page logged in as student1
104
    And I click on "Remove submission" "button"
105
    And I click on "Continue" "button"
106
    And I log out
107
 
108
    When I am on the "Test assignment name" Activity page logged in as teacher1
109
    And I follow "View all submissions"
110
    Then I should not see "I'm the student submission"
111
    And "Student 1" row "Status" column of "generaltable" table should contain "No submission"
112
    And I log out
113
 
114
    And I am on the "Test assignment name" Activity page logged in as student1
115
    And I should not see "I'm the student submission"
116
    And I should see "No submissions have been made yet" in the "Submission status" "table_row"
117
 
118
  @javascript @skip_chrome_zerosize @_file_upload
119
  Scenario: Submission removal with time limit setting
120
    Given the following "activity" exists:
121
      | activity                            | assign                          |
122
      | course                              | C1                              |
123
      | name                                | Test assignment with time limit |
124
      | assignsubmission_onlinetext_enabled | 1                               |
125
      | assignsubmission_file_enabled       | 1                               |
126
      | assignsubmission_file_maxfiles      | 1                               |
127
      | assignsubmission_file_maxsizebytes  | 1000000                         |
128
      | submissiondrafts                    | 0                               |
129
      | allowsubmissionsfromdate_enabled    | 0                               |
130
      | duedate_enabled                     | 0                               |
131
      | cutoffdate_enabled                  | 0                               |
132
      | gradingduedate_enabled              | 0                               |
133
    And I am on the "Test assignment with time limit" Activity page logged in as admin
134
    And I navigate to "Settings" in current page administration
135
    And I click on "Expand all" "link" in the "region-main" "region"
136
    # Set 'Time limit' to 5 seconds.
137
    And I set the field "timelimit[enabled]" to "1"
138
    And I set the field "timelimit[number]" to "5"
139
    And I set the field "timelimit[timeunit]" to "seconds"
140
    And I press "Save and return to course"
141
    When I am on the "Test assignment with time limit" Activity page logged in as student1
142
    And I click on "Begin assignment" "link"
143
    And I click on "Begin assignment" "button"
144
    And I upload "lib/tests/fixtures/empty.txt" file to "File submissions" filemanager
145
    And I press "Save changes"
146
    And I click on "Remove submission" "button"
147
    Then I should see "Are you sure you want to remove your submission? Please note that this will not reset your time limit."
148
    And I press "Cancel"
149
    And I am on the "Test assignment with time limit" Activity page logged in as admin
150
    And I click on "View all submissions" "link"
151
    And I open the action menu in "Student 1" "table_row"
152
    And I follow "Remove submission"
153
    And I should see "Are you sure you want to remove the submission for Student 1? Please note that this will not reset the student's time limit. You can give more time by adding a time limit user override."