|
|
@ -6,6 +6,14 @@ Feature: Exercise tool |
|
|
|
Given I am a platform administrator |
|
|
|
Given I am a platform administrator |
|
|
|
And I am on course "TEMP" homepage |
|
|
|
And I am on course "TEMP" homepage |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: Create an exercise category |
|
|
|
|
|
|
|
Given I am on "/main/exercise/tests_category.php?action=addcategory&cidReq=TEMP" |
|
|
|
|
|
|
|
When I fill in the following: |
|
|
|
|
|
|
|
| category_name | Category 1 | |
|
|
|
|
|
|
|
And I fill in ckeditor field "category_description" with "Category description" |
|
|
|
|
|
|
|
And I press "SubmitNote" |
|
|
|
|
|
|
|
Then I should see "Category added" |
|
|
|
|
|
|
|
|
|
|
|
Scenario: Create an exercise |
|
|
|
Scenario: Create an exercise |
|
|
|
Given I am on "/main/exercise/exercise_admin.php?cidReq=TEMP" |
|
|
|
Given I am on "/main/exercise/exercise_admin.php?cidReq=TEMP" |
|
|
|
And I press advanced settings |
|
|
|
And I press advanced settings |
|
|
@ -15,108 +23,126 @@ Feature: Exercise tool |
|
|
|
And I press "submitExercise" |
|
|
|
And I press "submitExercise" |
|
|
|
Then I should see "Exercise added" |
|
|
|
Then I should see "Exercise added" |
|
|
|
|
|
|
|
|
|
|
|
# Scenario: Edit an exercise |
|
|
|
Scenario: Edit an exercise |
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
# And I follow "Exercise 1" |
|
|
|
And I follow "Exercise 1" |
|
|
|
# And I follow "Edit" |
|
|
|
And I follow "Edit" |
|
|
|
# And I follow "Edit test name and settings" |
|
|
|
And I follow "Edit test name and settings" |
|
|
|
# And I press "submitExercise" |
|
|
|
And I press "submitExercise" |
|
|
|
# Then I should see "Test name and settings have been saved." |
|
|
|
Then I should see "Test name and settings have been saved." |
|
|
|
# |
|
|
|
|
|
|
|
# Scenario: Add question "Multiple choice" to exercise created "Exercise 1" |
|
|
|
Scenario: Add question "Multiple choice" to exercise created "Exercise 1" |
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
# And I follow "Exercise 1" |
|
|
|
And I follow "Exercise 1" |
|
|
|
# And I follow "Edit" |
|
|
|
And I follow "Edit" |
|
|
|
# And I follow "Multiple choice" |
|
|
|
And I follow "Multiple choice" |
|
|
|
# When I fill in the following: |
|
|
|
When I fill in the following: |
|
|
|
# | questionName | Question Multiple choice | |
|
|
|
| questionName | Multiple choice | |
|
|
|
# | weighting[1] | 10 | |
|
|
|
| weighting[1] | 10 | |
|
|
|
# Then I fill in ckeditor field "answer[1]" with "Answer true" |
|
|
|
Then I fill in ckeditor field "answer[1]" with "Answer true" |
|
|
|
# Then I fill in ckeditor field "answer[2]" with "Answer false" |
|
|
|
Then I fill in ckeditor field "answer[2]" with "Answer false" |
|
|
|
# Then I fill in ckeditor field "answer[3]" with "Answer false" |
|
|
|
Then I fill in ckeditor field "answer[3]" with "Answer false" |
|
|
|
# Then I fill in ckeditor field "answer[4]" with "Answer false" |
|
|
|
Then I fill in ckeditor field "answer[4]" with "Answer false" |
|
|
|
# |
|
|
|
|
|
|
|
# Then I fill in ckeditor field "comment[1]" with "Comment true" |
|
|
|
Then I fill in ckeditor field "comment[1]" with "Comment true" |
|
|
|
# Then I fill in ckeditor field "comment[2]" with "Comment false" |
|
|
|
Then I fill in ckeditor field "comment[2]" with "Comment false" |
|
|
|
# Then I fill in ckeditor field "comment[3]" with "Comment false" |
|
|
|
Then I fill in ckeditor field "comment[3]" with "Comment false" |
|
|
|
# Then I fill in ckeditor field "comment[4]" with "Comment false" |
|
|
|
Then I fill in ckeditor field "comment[4]" with "Comment false" |
|
|
|
# And I press "submitQuestion" |
|
|
|
And I press "submitQuestion" |
|
|
|
# Then I should see "Item added" |
|
|
|
Then I should see "Item added" |
|
|
|
# |
|
|
|
|
|
|
|
# Scenario: Add question "Multiple answer" to exercise created "Exercise 1" |
|
|
|
Scenario: Add question "Multiple answer" to exercise created "Exercise 1" |
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
# And I follow "Exercise 1" |
|
|
|
And I follow "Exercise 1" |
|
|
|
# And I follow "Edit" |
|
|
|
And I follow "Edit" |
|
|
|
# And I follow "Multiple answer" |
|
|
|
And I follow "Multiple answer" |
|
|
|
# When I fill in the following: |
|
|
|
When I fill in the following: |
|
|
|
# | questionName | Question Multiple | |
|
|
|
| questionName | Multiple answers | |
|
|
|
# | weighting[1] | 10 | |
|
|
|
| weighting[1] | 10 | |
|
|
|
# Then I check the "correct[1]" radio button |
|
|
|
Then I check the "correct[1]" radio button |
|
|
|
# Then I fill in ckeditor field "answer[1]" with "Answer true" |
|
|
|
Then I fill in ckeditor field "answer[1]" with "Answer true" |
|
|
|
# Then I fill in ckeditor field "answer[2]" with "Answer false" |
|
|
|
Then I fill in ckeditor field "answer[2]" with "Answer false" |
|
|
|
# Then I fill in ckeditor field "answer[3]" with "Answer false" |
|
|
|
Then I fill in ckeditor field "answer[3]" with "Answer false" |
|
|
|
# Then I fill in ckeditor field "answer[4]" with "Answer false" |
|
|
|
Then I fill in ckeditor field "answer[4]" with "Answer false" |
|
|
|
# |
|
|
|
|
|
|
|
# Then I fill in ckeditor field "comment[1]" with "Comment true" |
|
|
|
Then I fill in ckeditor field "comment[1]" with "Comment true" |
|
|
|
# Then I fill in ckeditor field "comment[2]" with "Comment false" |
|
|
|
Then I fill in ckeditor field "comment[2]" with "Comment false" |
|
|
|
# Then I fill in ckeditor field "comment[3]" with "Comment false" |
|
|
|
Then I fill in ckeditor field "comment[3]" with "Comment false" |
|
|
|
# Then I fill in ckeditor field "comment[4]" with "Comment false" |
|
|
|
Then I fill in ckeditor field "comment[4]" with "Comment false" |
|
|
|
# And I press "submitQuestion" |
|
|
|
And I press "submitQuestion" |
|
|
|
# Then I should see "Item added" |
|
|
|
Then I should see "Item added" |
|
|
|
# |
|
|
|
|
|
|
|
# Scenario: Add question "Matching" to exercise created "Exercise 1" |
|
|
|
Scenario: Add question "Fill in blanks" to "Exercise 1" |
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
# And I follow "Exercise 1" |
|
|
|
And I follow "Exercise 1" |
|
|
|
# And I follow "Edit" |
|
|
|
And I follow "Edit" |
|
|
|
# And I follow "Matching" |
|
|
|
And I follow "Fill blanks or form" |
|
|
|
# When I fill in the following: |
|
|
|
When I fill in the following: |
|
|
|
# | questionName | Question Matching | |
|
|
|
| questionName | Fill blanks | |
|
|
|
# | answer[1] | Answer A | |
|
|
|
Then I fill in ckeditor field "answer" with "Romeo and [Juliet]" |
|
|
|
# | answer[2] | Answer B | |
|
|
|
And I press "submitQuestion" |
|
|
|
# | option[1] | Option A | |
|
|
|
Then I should see "Item added" |
|
|
|
# | option[2] | Option B | |
|
|
|
|
|
|
|
# And I fill in select bootstrap static input "#matches_2" select "2" |
|
|
|
Scenario: Add question "Matching" to exercise created "Exercise 1" |
|
|
|
# |
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
# And I press "submitQuestion" |
|
|
|
And I follow "Exercise 1" |
|
|
|
# Then I should see "Item added" |
|
|
|
And I follow "Edit" |
|
|
|
# |
|
|
|
And I follow "Matching" |
|
|
|
# Scenario: Try exercise "Exercise 1" |
|
|
|
When I fill in the following: |
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
| questionName | Matching | |
|
|
|
# And I follow "Exercise 1" |
|
|
|
| answer[1] | Answer A | |
|
|
|
# And I follow "Start test" |
|
|
|
| answer[2] | Answer B | |
|
|
|
# Then I should see "Question Multiple choice" |
|
|
|
| option[1] | Option A | |
|
|
|
# And I check the "Answer true" radio button |
|
|
|
| option[2] | Option B | |
|
|
|
# And wait for the page to be loaded |
|
|
|
And I fill in select bootstrap static input "#matches_2" select "2" |
|
|
|
# Then I follow "Next question" |
|
|
|
And I press "submitQuestion" |
|
|
|
# And wait for the page to be loaded |
|
|
|
Then I should see "Item added" |
|
|
|
# And I check the "Answer true" radio button |
|
|
|
|
|
|
|
# And wait for the page to be loaded |
|
|
|
Scenario: Try exercise "Exercise 1" |
|
|
|
# Then I follow "Next question" |
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
# And wait for the page to be loaded |
|
|
|
And I follow "Exercise 1" |
|
|
|
# Then I select "A" from "choice_id_3_1" |
|
|
|
And I follow "Start test" |
|
|
|
# Then I select "B" from "choice_id_3_2" |
|
|
|
Then I should see "Multiple choice" |
|
|
|
# Then I follow "End test" |
|
|
|
And I check the "Answer true" radio button |
|
|
|
# Then I should see "Score for the test: 40 / 40" |
|
|
|
And wait for the page to be loaded |
|
|
|
|
|
|
|
Then I follow "Next question" |
|
|
|
|
|
|
|
And wait for the page to be loaded |
|
|
|
|
|
|
|
And I check the "Answer true" radio button |
|
|
|
|
|
|
|
And wait for the page to be loaded |
|
|
|
|
|
|
|
Then I follow "Next question" |
|
|
|
|
|
|
|
Then I fill in the following: |
|
|
|
|
|
|
|
| choice_id_3_0 | Juliet | |
|
|
|
|
|
|
|
And wait for the page to be loaded |
|
|
|
|
|
|
|
Then I follow "Next question" |
|
|
|
|
|
|
|
Then I select "A" from "choice_id_4_1" |
|
|
|
|
|
|
|
Then I select "B" from "choice_id_4_2" |
|
|
|
|
|
|
|
Then I follow "End test" |
|
|
|
|
|
|
|
Then I should see "Score for the test: 41 / 41" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: Check exercise result |
|
|
|
|
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
|
|
|
|
And I follow "Exercise 1" |
|
|
|
|
|
|
|
And I follow "Edit" |
|
|
|
|
|
|
|
And I follow "Results and feedback" |
|
|
|
|
|
|
|
Then I should see "Learner score" |
|
|
|
|
|
|
|
And wait for the page to be loaded |
|
|
|
|
|
|
|
And I follow "Grade activity" |
|
|
|
|
|
|
|
Then I should see "Score for the test: 41 / 41" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: Duplicate exercise |
|
|
|
|
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
|
|
|
|
And I follow "Copy this exercise as a new one" |
|
|
|
|
|
|
|
And I confirm the popup |
|
|
|
|
|
|
|
Then I should see "Exercise copied" |
|
|
|
|
|
|
|
And I should see "Exercise 1 - Copy" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Scenario: Delete an exercise |
|
|
|
|
|
|
|
Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
|
|
|
|
And I follow "Delete" |
|
|
|
|
|
|
|
And I confirm the popup |
|
|
|
|
|
|
|
Then I should see "The test has been deleted" |
|
|
|
|
|
|
|
|
|
|
|
# Scenario: Check exercise result |
|
|
|
Scenario: Delete an exercise category |
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
Given I am on "/main/exercise/tests_category.php?cidReq=TEMP" |
|
|
|
# And I follow "Exercise 1" |
|
|
|
And I follow "Delete" |
|
|
|
# And I follow "Edit" |
|
|
|
Then I should see "Category deleted" |
|
|
|
# And I follow "Results and feedback" |
|
|
|
|
|
|
|
# Then I should see "Learner score" |
|
|
|
|
|
|
|
# And wait for the page to be loaded |
|
|
|
|
|
|
|
# And I follow "Grade activity" |
|
|
|
|
|
|
|
# Then I should see "Score for the test: 20 / 20" |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# Scenario: Duplicate exercise |
|
|
|
|
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
|
|
|
|
# And I follow "Copy this exercise as a new one" |
|
|
|
|
|
|
|
# And I confirm the popup |
|
|
|
|
|
|
|
# Then I should see "Exercise copied" |
|
|
|
|
|
|
|
# And I should see "Exercise 1 - Copy" |
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
# Scenario: Delete an exercise |
|
|
|
|
|
|
|
# Given I am on "/main/exercise/exercise.php?cidReq=TEMP" |
|
|
|
|
|
|
|
# And I follow "Delete" |
|
|
|
|
|
|
|
# And I confirm the popup |
|
|
|
|
|
|
|
# Then I should see "The test has been deleted" |
|
|
|
|