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
@qbank @qbank_history
2
Feature: Use the qbank plugin manager page for question history
3
  In order to check the plugin behaviour with enable and disable
4
 
5
  Background:
6
    Given the following "courses" exist:
7
      | fullname | shortname | category |
8
      | Course 1 | C1        | 0        |
9
    And the following "activities" exist:
1441 ariadna 10
      | activity | name      | intro           | course | idnumber |
11
      | quiz     | Test quiz |                 | C1     | quiz1    |
12
      | qbank    | Qbank 1   | Question bank 1 | C1     | qbank1   |
13
      | qbank    | Qbank 2   | Question bank 2 | C1     | qbank2   |
1 efrain 14
    And the following "question categories" exist:
1441 ariadna 15
      | contextlevel    | reference | name              |
16
      | Activity module | quiz1     | Test questions    |
17
      | Activity module | qbank1    | Share questions   |
18
      | Activity module | qbank2    | Share questions 2 |
1 efrain 19
    And the following "questions" exist:
1441 ariadna 20
      | questioncategory      | qtype     | name                       | questiontext                  |
21
      | Default for Test quiz | truefalse | First question             | Answer the first question     |
22
      | Default for Qbank 1   | essay     | Test question to be edited | Write about whatever you want |
1 efrain 23
 
24
  Scenario: Enable/disable question history column from the base view
25
    Given I log in as "admin"
26
    When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
27
    And I should see "Question history"
28
    And I click on "Disable" "link" in the "Question history" "table_row"
29
    And I am on the "Test quiz" "mod_quiz > question bank" page
30
    Then the "History" action should not exist for the "First question" question in the question bank
31
    And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
32
    And I click on "Enable" "link" in the "Question history" "table_row"
33
    And I am on the "Test quiz" "mod_quiz > question bank" page
34
    Then the "History" action should exist for the "First question" question in the question bank
35
 
36
  Scenario: History page shows only the specified features and questions
37
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
38
    And I choose "History" action for "First question" in the question bank
39
    And I should see "Question"
40
    And I should see "Actions"
41
    And I should see "Status"
42
    And I should see "Version"
43
    And I should see "Created by"
44
    And I should see "First question"
45
    And the "History" action should not exist for the "First question" question in the question bank
46
 
47
  @javascript
48
  Scenario: Viewing history for a question in a non-default category
49
    Given the following "question categories" exist:
1441 ariadna 50
      | contextlevel    | reference | name             |
51
      | Activity module | quiz1     | Test questions 2 |
1 efrain 52
    And the following "questions" exist:
53
      | questioncategory | qtype     | name            | questiontext               |
54
      | Test questions 2 | truefalse | Second question | Answer the second question |
55
    And I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
56
    And I apply question bank filter "Category" with value "Test questions 2"
57
    And I choose "History" action for "Second question" in the question bank
58
    Then I should see "Question history"
59
    And "Filter 1" "fieldset" should not exist
60
    And I should see "Second question"
61
    And "Second question" "table_row" should exist
62
 
1441 ariadna 63
  Scenario: Viewing history for a Question in a Subcategory
64
    Given the following "question categories" exist:
65
      | contextlevel    | reference | name                 |
66
      | Activity module | quiz1     | Questions Category 1 |
67
    And the following "question categories" exist:
68
      | contextlevel    | reference | name          | questioncategory     |
69
      | Activity module | quiz1     | Subcategory 1 | Questions Category 1 |
70
    And the following "questions" exist:
71
      | questioncategory | qtype     | name                | questiontext       |
72
      | Subcategory 1    | truefalse | First question (v1) | Question version 1 |
73
    When I am on the "Test quiz" "mod_quiz > question categories" page logged in as "admin"
74
    And I should see "Subcategory 1"
75
    And I click on "Subcategory 1" "link"
76
    Then I should see "First question (v1)"
77
    And I choose "Edit question" action for "First question (v1)" in the question bank
78
    And I set the following fields to these values:
79
      | Question name | First question (v2) |
80
      | Question text | Question version 2  |
81
    And I press "id_submitbutton"
82
    And I choose "History" action for "First question (v2)" in the question bank
83
    And "First question (v1)" "table_row" should exist
84
    And "First question (v2)" "table_row" should exist
85
 
1 efrain 86
  @javascript
87
  Scenario: Delete question from the history using Edit question menu
88
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
89
    And I choose "History" action for "First question" in the question bank
90
    When I choose "Delete" action for "First question" in the question bank
91
    And I press "Delete"
92
    And I should not see "First question"
93
    Then I should see "All versions of this question have been deleted."
94
    And I click on "Continue" "button"
95
    And I should see "Question bank"
96
    And I should not see "First question"
1441 ariadna 97
 
98
  Scenario: Resetting the columns in the question history view will return it to its default setting.
99
    Given the following "user preferences" exist:
100
      | user  | preference                       | value                                                           |
101
      | admin | qbank_columnsortorder_hiddencols | qbank_usage\question_last_used_column-question_last_used_column |
102
    And the following "questions" exist:
103
      | questioncategory      | qtype     | name            | questiontext               |
104
      | Default for Test quiz | truefalse | Second question | Answer the second question |
105
    When I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
106
    And "Last used" "qbank_columnsortorder > column header" should not exist
107
    Then I should see "First question"
108
    And I should see "Second question"
109
    And I choose "History" action for "First question" in the question bank
110
    And "First question" "table_row" should exist
111
    And "Second question" "table_row" should not exist
112
    And "Last used" "qbank_columnsortorder > column header" should not exist
113
    And I follow "Reset columns"
114
    And "Last used" "qbank_columnsortorder > column header" should exist
115
    And "First question" "table_row" should exist
116
    And "Second question" "table_row" should not exist
117
 
118
  Scenario: Go History page in edit question page.
119
    Given I am on the "Test quiz" "mod_quiz > question bank" page logged in as "admin"
120
    When I choose "Edit question" action for "First question" in the question bank
121
    And I click on "History" "link"
122
    Then I should see "First question"
123
    And I follow "Close"
124
    And the following fields match these values:
125
      | Question text | Answer the first question |