2 Feature: The questions in the question bank can be sorted in various ways
3 In order to see what questions I have
5 I want to view them in different orders
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher1 | Teacher | 1 | teacher1@asd.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 |
22 | Test questions | essay | A question 1 name | admin | Question 1 text |
23 | Test questions | essay | B question 2 name | teacher1 | Question 2 text |
24 | Test questions | numerical | C question 3 name | teacher1 | Question 3 text |
25 And I log in as "teacher1"
26 And I follow "Course 1"
27 And I navigate to "Questions" node in "Course administration > Question bank"
30 Scenario: The questions are sorted by type by default
31 Then "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox"
34 Scenario: The questions can be sorted in reverse order by type
35 When I follow "Sort by Question type descending"
36 Then "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox"
39 Scenario: The questions can be sorted by name
40 When I follow "Sort by Question ascending"
41 Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
42 And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox"
45 Scenario: The questions can be sorted in reverse order by name
46 When I follow "Sort by Question ascending"
47 And I follow "Sort by Question descending"
48 Then "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox"
49 And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox"
52 Scenario: The questions can be sorted by creator name
53 When I follow "Sort by First name ascending"
54 Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox"
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"
63 Scenario: The question text can be shown in the list of questions
64 When I click on "Show question text in the question list" "checkbox"
65 Then I should see "Question 1 text"
66 And I should see "Question 2 text"
67 And I should see "Question 3 text"