Proyectos de Subversion Moodle

Rev

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

Rev Autor Línea Nro. Línea
1441 ariadna 1
@core @core_question @javascript
1 efrain 2
Feature: A teacher can duplicate questions in the question bank
3
  In order to efficiently expand my question bank
4
  As a teacher
5
  I need to be able to duplicate existing questions and make small changes
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email               |
10
      | teacher  | Teacher   | One      | teacher@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | format |
13
      | Course 1 | C1        | weeks  |
14
    And the following "course enrolments" exist:
15
      | user    | course | role           |
16
      | teacher | C1     | editingteacher |
1441 ariadna 17
    And the following "activities" exist:
18
      | activity   | name    | intro              | course | idnumber |
19
      | qbank      | Qbank 1 | Question bank 1    | C1     | qbank1   |
1 efrain 20
    And the following "question categories" exist:
1441 ariadna 21
      | contextlevel    | reference | name           |
22
      | Activity module | qbank1    | Test questions |
1 efrain 23
    And the following "questions" exist:
24
      | questioncategory | qtype | name                       | questiontext                  | idnumber |
25
      | Test questions   | essay | Test question to be copied | Write about whatever you want | qid      |
1441 ariadna 26
    And I am on the "Qbank 1" "core_question > question bank" page logged in as "teacher"
27
    And I apply question bank filter "Category" with value "Test questions"
1 efrain 28
 
29
  Scenario: Duplicating a previously created question
30
    When I choose "Duplicate" action for "Test question to be copied" in the question bank
31
    And I set the following fields to these values:
32
      | Question name | Duplicated question name                |
33
      | Question text | Write a lot about duplicating questions |
34
    And I press "id_submitbutton"
35
    Then I should see "Duplicated question name"
36
    And I should see "Test question to be copied"
37
    And I should see "ID number" in the "Test question to be copied" "table_row"
38
    And I should see "qid" in the "Test question to be copied" "table_row"
39
 
40
  Scenario: Duplicated questions automatically get a new name suggested
41
    When I choose "Duplicate" action for "Test question to be copied" in the question bank
42
    Then the field "Question name" matches value "Test question to be copied (copy)"
43
 
44
  Scenario: The duplicate operation can be cancelled
45
    When I choose "Duplicate" action for "Test question to be copied" in the question bank
46
    And I press "Cancel"
47
    Then I should see "Test question to be copied"
48
    And I should see "Test questions (1)" in the "Filter 1" "fieldset"
49
 
50
  Scenario: Duplicating a question with an idnumber increments it
51
    Given the following "questions" exist:
52
      | questioncategory | qtype | name                   | questiontext                  | idnumber |
53
      | Test questions   | essay | Question with idnumber | Write about whatever you want | id101    |
54
    And I reload the page
55
    When I choose "Duplicate" action for "Question with idnumber" in the question bank
56
    And I press "id_submitbutton"
57
    Then I should see "Question with idnumber (copy)"
58
    Then I should see "id102" in the "Question with idnumber (copy)" "table_row"