1 |
efrain |
1 |
@core @core_question
|
|
|
2 |
Feature: The questions in the question bank can be sorted in various ways
|
|
|
3 |
In order to see what questions I have
|
|
|
4 |
As a teacher
|
|
|
5 |
I want to view them in different orders
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@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 |
| teacher1 | 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 | user | questiontext | idnumber |
|
|
|
22 |
| Test questions | essay | A question 1 name | admin | Question 1 text | numidnum</a |
|
|
|
23 |
| Test questions | essay | B question 2 name | teacher1 | Question 2 text | |
|
|
|
24 |
| Test questions | numerical | C question 3 name | teacher1 | Question 3 text | numidnum</c |
|
|
|
25 |
And I am on the "Course 1" "core_question > course question bank" page logged in as "teacher1"
|
|
|
26 |
|
|
|
27 |
Scenario: The questions are sorted by type by default
|
|
|
28 |
Then "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
|
|
29 |
|
|
|
30 |
Scenario: The questions can be sorted by idnumber
|
|
|
31 |
When I change the window size to "large"
|
|
|
32 |
And I follow "Sort by ID number ascending"
|
|
|
33 |
Then "C question 3 name" "checkbox" should appear after "A question 1 name" "checkbox"
|
|
|
34 |
And I should see "numidnum</c" in the "C question 3 name" "table_row"
|
|
|
35 |
And I follow "Sort by ID number descending"
|
|
|
36 |
And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
|
|
37 |
|
|
|
38 |
Scenario: The questions can be sorted in reverse order by type
|
|
|
39 |
When I follow "Sort by Question type descending"
|
|
|
40 |
Then "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
|
|
41 |
|
|
|
42 |
Scenario: The questions can be sorted by name
|
|
|
43 |
When I follow "Sort by Question name ascending"
|
|
|
44 |
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
|
|
45 |
And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox"
|
|
|
46 |
|
|
|
47 |
Scenario: The questions can be sorted in reverse order by name
|
|
|
48 |
When I follow "Sort by Question name ascending"
|
|
|
49 |
And I follow "Sort by Question name descending"
|
|
|
50 |
Then "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
|
|
51 |
And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
|
|
52 |
|
|
|
53 |
Scenario: The questions can be sorted by creator name
|
|
|
54 |
When I follow "Sort by First name ascending"
|
|
|
55 |
Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
|
|
|
56 |
|
|
|
57 |
Scenario: The questions can be sorted in reverse order by creator name
|
|
|
58 |
When I follow "Sort by First name ascending"
|
|
|
59 |
And I follow "Sort by First name descending"
|
|
|
60 |
Then "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
|
|
|
61 |
|
|
|
62 |
@javascript
|
|
|
63 |
Scenario: The question text can be shown in the list of questions
|
|
|
64 |
When I set the field "Show question text in the question list?" to "Yes"
|
|
|
65 |
Then I should see "Question 1 text"
|
|
|
66 |
And I should see "Question 2 text"
|
|
|
67 |
And I should see "Question 3 text"
|