Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@qtype @qtype_shortanswer
2
Feature: Test editing a Short answer question
3
  As a teacher
4
  In order to be able to update my Short answer question
5
  I need to edit them
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        | Test questions |
20
    And the following "questions" exist:
21
      | questioncategory | qtype       | name                        | template |
22
      | Test questions   | shortanswer | shortanswer-001 for editing | frogtoad |
23
 
24
  @javascript @_switch_window
25
  Scenario: Edit a Short answer question
26
    When I am on the "shortanswer-001 for editing" "core_question > edit" page logged in as teacher
27
    And I set the following fields to these values:
28
      | Question name | |
29
    And I press "id_submitbutton"
30
    And I should see "You must supply a value here."
31
    And I set the following fields to these values:
32
      | Question name | Edited shortanswer-001 name |
33
    And I press "id_submitbutton"
34
    Then I should see "Edited shortanswer-001 name"
35
    And I choose "Edit question" action for "Edited shortanswer-001" in the question bank
36
    And I set the following fields to these values:
37
      | id_answer_1          | newt                       |
38
      | id_fraction_1        | 70%                        |
39
      | id_feedback_1        | Newt is an OK good answer. |
40
    And I press "id_submitbutton"
41
    And I should see "Edited shortanswer-001 name"
42
    And I choose "Preview" action for "Edited shortanswer-001" in the question bank
43
    And I should see "Name an amphibian:"
44
    # Set behaviour options
45
    And I set the following fields to these values:
46
      | behaviour | immediatefeedback |
47
    And I press "Save preview options and start again"
48
    And I set the field with xpath "//div[@class='qtext']//input[contains(@id, '1_answer')]" to "newt"
49
    And I press "Check"
50
    And I should see "Newt is an OK good answer."
51
    And I should see "Generalfeedback: frog or toad would have been OK."
52
    And I should see "The correct answer is: frog"