Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@qtype @qtype_essay
2
Feature: In a essay question, limit submittable file types
3
  In order to constrain student submissions for marking
4
  As a teacher
5
  I need to limit the submittable file types
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username |
10
      | teacher  |
11
      | student  |
12
    And the following "courses" exist:
13
      | fullname | shortname | category |
14
      | Course 1 | C1        | 0        |
15
    And the following "course enrolments" exist:
16
      | user    | course | role           |
17
      | teacher | C1     | editingteacher |
18
      | student | C1     | student        |
19
    And the following "question categories" exist:
20
      | contextlevel | reference | name           |
21
      | Course       | C1        | Test questions |
22
    And the following "questions" exist:
23
      | questioncategory | qtype       | name  | questiontext    | defaultmark |
24
      | Test questions   | essay       | TF1   | First question  | 20          |
25
    And the following "activities" exist:
26
      | activity   | name   | intro              | course | idnumber | grade |
27
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | 20    |
28
    And quiz "Quiz 1" contains the following questions:
29
      | question | page |
30
      | TF1      | 1    |
11 efrain 31
    And I am on the "Quiz 1" "mod_quiz > edit" page logged in as teacher
1 efrain 32
    And I click on "Edit question TF1" "link"
33
    And I set the field "Allow attachments" to "1"
34
    And I set the field "Response format" to "No online text"
35
    And I set the field "Require attachments" to "1"
36
    And I set the field "filetypeslist[filetypes]" to ".txt"
37
    And I press "Save changes"
38
    And I am on the "Quiz 1" "mod_quiz > edit" page
39
    And I set the field "version" to "Always latest"
40
    Then I log out
41
 
11 efrain 42
  @javascript
1 efrain 43
  Scenario: Preview an Essay question and submit a response with a correct filetype.
11 efrain 44
    Given the following "user private file" exists:
45
      | user     | student                      |
46
      | filepath | lib/tests/fixtures/empty.txt |
47
    When I am on the "Quiz 1" "quiz activity" page logged in as "student"
1 efrain 48
    And I press "Attempt quiz"
49
    And I should see "First question"
50
    And I should see "You can drag and drop files here to add them."
51
    And I click on "Add..." "button"
52
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
53
    And I click on "empty.txt" "link"
54
    And I click on "Select this file" "button"
55
    # Wait for the page to "settle".
56
    And I wait until the page is ready
57
    Then I should not see "These file types are not allowed here:"
58
 
11 efrain 59
  @javascript
1 efrain 60
  Scenario: Preview an Essay question and try to submit a response with an incorrect filetype.
11 efrain 61
    Given the following "user private file" exists:
62
      | user     | student                             |
63
      | filepath | lib/tests/fixtures/upload_users.csv |
64
    When I am on the "Quiz 1" "quiz activity" page logged in as "student"
1 efrain 65
    And I press "Attempt quiz"
66
    And I should see "First question"
67
    And I should see "You can drag and drop files here to add them."
68
    And I click on "Add..." "button"
69
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
70
    Then I should see "No files available"