This commit is contained in:
Eloy Lafuente (stronk7) 2021-04-13 00:46:55 +02:00
commit 6e39487123
4 changed files with 63 additions and 5 deletions

View File

@ -22,7 +22,7 @@ Feature: Attempt a quiz
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 |
@javascript
Scenario: Attempt a quiz with a single unnamed section
Scenario: Attempt a quiz with a single unnamed section, review and re-attempt
Given the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | TF1 | First question |
@ -37,7 +37,15 @@ Feature: Attempt a quiz
| 2 | False |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I follow "Review"
Then I should see "25.00 out of 100.00"
Then I should see "Started on"
And I should see "State"
And I should see "Completed on"
And I should see "Time taken"
And I should see "Marks"
And I should see "Grade"
And I should see "25.00 out of 100.00"
And I follow "Finish review"
And I press "Re-attempt quiz"
@javascript
Scenario: Attempt a quiz with mulitple sections
@ -59,10 +67,10 @@ Feature: Attempt a quiz
| TF6 | 4 |
And quiz "Quiz 1" contains the following sections:
| heading | firstslot | shuffle |
| Section 1 | 1 | 1 |
| Section 1 | 1 | 0 |
| Section 2 | 3 | 0 |
| | 4 | 1 |
| Section 3 | 5 | 0 |
| Section 3 | 5 | 1 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
And I press "Attempt quiz now"
@ -95,6 +103,16 @@ Feature: Attempt a quiz
And I should see question "5" in section "Section 3" in the quiz navigation
And I should see question "6" in section "Section 3" in the quiz navigation
And I follow "Show one page at a time"
And I should see "First question"
And I should not see "Third question"
And I should see "Next page"
And I follow "Show all questions on one page"
And I should see "Fourth question"
And I should see "Sixth question"
And I should not see "Next page"
@javascript
Scenario: Next and previous navigation
Given the following "questions" exist:

View File

@ -103,3 +103,25 @@ Feature: Adding questions to a quiz from the question bank
And I click on "Add selected questions to the quiz" "button"
Then I should see "question 03 name" on quiz page "1"
And I should see "question 01 name" before "question 03 name" on the edit quiz page
Scenario: Add several selected questions from the question bank
Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
When I open the "last" add to quiz menu
And I follow "from question bank"
And I set the field with xpath "//input[@type='checkbox' and @id='qbheadercheckbox']" to "1"
And I press "Add selected questions to the quiz"
Then I should see "question 01 name" on quiz page "1"
And I should see "question 02 name" on quiz page "2"
@javascript
Scenario: Validate the sorting while adding questions from question bank
Given the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | multichoice | question 03 name | question 03 name text |
And I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
When I open the "last" add to quiz menu
And I follow "from question bank"
And I follow "Sort by Question type descending"
Then "question 03 name" "checkbox" should appear before "question 01 name" "checkbox"
And I follow "Sort by Question ascending"
And "question 01 name" "checkbox" should appear before "question 02 name" "checkbox"

View File

@ -54,3 +54,14 @@ Feature: Adding random questions to a quiz based on category and tags
And I am on the "Quiz 1" "mod_quiz > Edit" page
When I open the "last" add to quiz menu
Then I should not see "a random question"
Scenario: A random question can be added to the quiz by creating a new category
Given I am on the "Quiz 1" "mod_quiz > Edit" page logged in as "teacher1"
When I open the "last" add to quiz menu
And I follow "a random question"
And I follow "New category"
And I set the following fields to these values:
| Name | New Random category |
| Parent category | Top for Quiz 1 |
And I press "Create category and add random question"
Then I should see "Random (New Random category)" on quiz page "1"

View File

@ -34,9 +34,16 @@ Feature: Preview a quiz as a teacher
| 2 | False |
@javascript
Scenario: Preview a quiz
Scenario: Review the quiz attempt
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
And I follow "Review"
Then I should see "25.00 out of 100.00"
And I follow "Finish review"
And "Review" "link" in the "Preview" "table_row" should be visible
@javascript
Scenario: Preview the quiz
Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
When I press "Preview quiz now"
Then I should see "Question 1"
And "Start a new preview" "button" should exist