Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@qtype @qtype_randomsamatch
2
Feature: Test creating a Random short-answer matching question
3
  As a teacher
4
  In order to test my students
5
  I need to be able to create a Random short-answer matching question
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username |
10
      | teacher  |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1        | 0        |
14
    And the following "course enrolments" exist:
15
      | user    | course | role           |
16
      | teacher | C1     | editingteacher |
17
    And the following "question categories" exist:
18
      | contextlevel | reference | name       |
19
      | Course       | C1        | Category 1 |
20
    And the following "questions" exist:
21
      | questioncategory | qtype       | name                              | template |
22
      | Category 1       | shortanswer | Short answer question A version 1 | frogtoad |
23
      | Category 1       | shortanswer | Short answer question B version 1 | frogtoad |
24
      | Category 1       | shortanswer | Short answer question C version 1 | frogtoad |
25
 
26
  Scenario: Create a too large size of options Random short-answer matching question
27
    When I am on the "Course 1" "core_question > course question bank" page logged in as teacher
28
    And I add a "Random short-answer matching" question filling the form with:
29
      | Category                      | Category 1                   |
30
      | Question name                 | Random short-answer matching |
31
      | Question text                 | Random short-answer matching |
32
      | Default mark                  | 1                            |
33
      | Number of questions to select | 4                            |
34
    Then I should see "There is/are only 3 short answer questions in the category"
35
 
36
  Scenario: Create a Random short-answer matching question
37
    When I am on the "Course 1" "core_question > course question bank" page logged in as teacher
38
    # Edit the first Short answer question so a version 2 is created.
39
    And I am on the "Short answer question A version 1" "core_question > edit" page logged in as teacher
40
    And I set the following fields to these values:
41
      | Question name | Short answer question A version 2          |
42
      | Question text | Short answer question A version 2          |
43
      | id_answer_0   | Short answer Question A Version 2 Answer 1 |
44
      | id_answer_1   | Short answer Question A Version 2 Answer 2 |
45
      | id_answer_2   | Short answer Question A Version 2 Answer 3 |
46
    And I press "id_submitbutton"
47
    And I should see "Short answer question A version 2"
48
    # Edit the second Short answer question so a version 2 is created.
49
    And I am on the "Short answer question B version 1" "core_question > edit" page logged in as teacher
50
    And I set the following fields to these values:
51
      | Question name | Short answer question B version 2          |
52
      | Question text | Short answer question B version 2          |
53
      | id_answer_0   | Short answer Question B Version 2 Answer 1 |
54
      | id_answer_1   | Short answer Question B Version 2 Answer 2 |
55
      | id_answer_2   | Short answer Question B Version 2 Answer 3 |
56
    And I press "id_submitbutton"
57
    And I should see "Short answer question B version 2"
58
    # Edit the third Short answer question so a version 2 is created.
59
    And I am on the "Short answer question C version 1" "core_question > edit" page logged in as teacher
60
    And I set the following fields to these values:
61
      | Question name | Short answer question C version 2          |
62
      | Question text | Short answer question C version 2          |
63
      | id_answer_0   | Short answer Question C Version 2 Answer 1 |
64
      | id_answer_1   | Short answer Question C Version 2 Answer 2 |
65
      | id_answer_2   | Short answer Question C Version 2 Answer 3 |
66
    And I press "id_submitbutton"
67
    And I should see "Short answer question C version 2"
68
    # Create the Random short-answer question.
69
    And I am on the "Course 1" "core_question > course question bank" page logged in as teacher
70
    And I add a "Random short-answer matching" question filling the form with:
71
      | Category                      | Category 1                   |
72
      | Question name                 | Random short-answer matching |
73
      | Question text                 | Random short-answer matching |
74
      | Default mark                  | 1                            |
75
      | Number of questions to select | 3                            |
76
    And I should see "Random short-answer matching"
77
    And I am on the "Random short-answer matching" "core_question > preview" page logged in as teacher
78
    Then I should not see "Name an amphibian:"
79
    And I should see "Version 2"