123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428 |
- Feature: Exercise tool
- In order to use the exercise tool
- The teachers should be able to create exercises
- Background:
- Given I am a platform administrator
- And I am on course "TEMP" homepage
- Scenario: Create a question category
- Given I am on "/main/exercise/tests_category.php?action=addcategory&cidReq=TEMP"
- And wait for the page to be loaded
- When I fill in the following:
- | category_name | Category 1 |
- And I fill in ckeditor field "category_description" with "Category 1 description"
- And I press "SubmitNote"
- Then I should see "Category added"
- Scenario: Create a second question category
- Given I am on "/main/exercise/tests_category.php?action=addcategory&cidReq=TEMP"
- And wait for the page to be loaded
- When I fill in the following:
- | category_name | Category 2 |
- And I fill in ckeditor field "category_description" with "Category 2 description"
- And I press "SubmitNote"
- Then I should see "Category added"
- Scenario: Create an exercise
- Given I am on "/main/exercise/exercise_admin.php?cidReq=TEMP"
- And I press advanced settings
- When I fill in the following:
- | exercise_title | Exercise 1 |
- And I fill in ckeditor field "exerciseDescription" with "Exercise description"
- And I press "submitExercise"
- Then I should see "Exercise added"
- Scenario: Edit an exercise
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Edit test name and settings"
- And I press "submitExercise"
- Then I should see "Test name and settings have been saved."
- Scenario: Add question "Multiple choice" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Multiple choice"
- When I fill in the following:
- | questionName | Multiple choice |
- | weighting[1] | 10 |
- 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[3]" 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[2]" 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"
- And I press "submit-question"
- Then I should see "Item added"
- Scenario: Add question "Multiple answer" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Multiple answer"
- When I fill in the following:
- | questionName | Multiple answers |
- | weighting[1] | 10 |
- 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[2]" 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 "comment[1]" with "Comment true"
- 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[4]" with "Comment false"
- And I press "submit-question"
- Then I should see "Item added"
- Scenario: Add question "Fill in blanks" to "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Fill blanks or form"
- When I fill in the following:
- | questionName | Fill blanks |
- Then I fill in ckeditor field "answer" with "Romeo and [Juliet] [Hätten||Haetten] [möchte||moechte] [wäre||waere] [können||koennen] [Könnten||Koennten] [Ärger] [voilà] [müssen] [l'été] [cherchent à] [Übung] [Ärger|Möglichkeit]"
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Matching" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Matching"
- When I fill in the following:
- | questionName | Matching |
- And I fill in ckeditor field "answer[1]" with "Answer A"
- And I fill in ckeditor field "answer[2]" with "Answer B"
- And I fill in ckeditor field "option[1]" with "Option A"
- And I fill in ckeditor field "option[2]" with "Option B"
- And I fill in select bootstrap static input "#matches_2" select "2"
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Open" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Open"
- When I fill in the following:
- | questionName | Open question |
- | weighting | 10 |
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Oral expression" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Oral expression"
- When I fill in the following:
- | questionName | Oral expression question |
- | weighting | 10 |
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Exact answers combination" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Exact Selection"
- When I fill in the following:
- | questionName | Exact answers combination |
- 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[2]" with "Answer false"
- Then I fill in ckeditor field "comment[1]" with "Comment true"
- Then I fill in ckeditor field "comment[2]" with "Comment false"
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Unique answer with unknown" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Unique answer with unknown"
- When I fill in the following:
- | questionName | Unique answer with unknown |
- | weighting[1] | 10 |
- Then I check the "correct" radio button
- 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[3]" with "Answer false"
- 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[3]" with "Comment false"
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Multiple answer true/false/don't know" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Multiple answer true/false/don't know"
- When I fill in the following:
- | questionName | Multiple answer true - false - dont know |
- Then I check the "correct[1]" radio button
- Then I check the "correct[2]" radio button
- Then I check the "correct[3]" radio button
- Then I check the "correct[4]" radio button
- Then I fill in ckeditor field "answer[1]" with "Answer true"
- Then I fill in ckeditor field "answer[2]" with "Answer true"
- Then I fill in ckeditor field "answer[3]" with "Answer true"
- Then I fill in ckeditor field "answer[4]" with "Answer true"
- Then I fill in ckeditor field "comment[1]" with "Comment true"
- Then I fill in ckeditor field "comment[2]" with "Comment true"
- Then I fill in ckeditor field "comment[3]" with "Comment true"
- Then I fill in ckeditor field "comment[4]" with "Comment true"
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Combination true/false/don't-know" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Combination true/false/don't-know"
- When I fill in the following:
- | questionName | Combination true - false - don't-know |
- 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[2]" with "Answer false"
- Then I fill in ckeditor field "comment[1]" with "Comment true"
- Then I fill in ckeditor field "comment[2]" with "Comment false"
- And I press "submitQuestion"
- Then I should see "Item added"
- Scenario: Add question "Global multiple answer" to exercise created "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Edit"
- And I follow "Global multiple answer"
- When I fill in the following:
- | questionName | Global multiple answer |
- | weighting[1] | 10 |
- 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[2]" 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 "comment[1]" with "Comment true"
- 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[4]" with "Comment false"
- And I press "submitQuestion"
- Then I should see "Item added"
- 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: Import exercise to test questions categories
- Given I am on "/main/exercise/upload_exercise.php?cidReq=TEMP"
- And I should see "Import quiz from Excel"
- And I attach the file "/tests/behat/uploadable_files/exercise.xls" to "user_upload_quiz"
- When I press "Upload"
- And wait for the page to be loaded
- Then I should see "Exercise for Behat test"
- Scenario: Import exercise from excel
- Given I am on "/main/exercise/upload_exercise.php?cidReq=TEMP"
- Then I should see "Import quiz from Excel"
- Then I attach the file "/main/exercise/quiz_template.xls" to "user_upload_quiz"
- And I press "Upload"
- And wait for the page to be loaded
- Then I should see "Definition of oligarchy"
- Scenario: Try exercise "Exercise 1"
- Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise 1"
- And I follow "Start test"
- # Question 1
- Then I should see "Multiple choice"
- And I check the "Answer true" radio button
- And wait for the page to be loaded
- Then I press "Next question"
- # Question 2
- 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 press "Next question"
- # Question 3
- Then I fill in the following:
- | choice_id_3_0 | Juliet |
- | choice_id_3_1 | Hätten |
- | choice_id_3_2 | möchte |
- | choice_id_3_3 | wäre |
- | choice_id_3_4 | können |
- | choice_id_3_5 | Könnten |
- | choice_id_3_6 | Ärger |
- | choice_id_3_7 | voilà |
- | choice_id_3_8 | müssen |
- | choice_id_3_9 | l'été |
- | choice_id_3_10 | cherchent à |
- | choice_id_3_11 | Übung |
- Then I fill in select bootstrap static by text "#choice_id_3_12" select "Ärger"
- And wait for the page to be loaded
- Then I press "Next question"
- # Question 4 - Matching
- Then I select "A" from "choice_id_4_1"
- Then I select "B" from "choice_id_4_2"
- Then I press "Next question"
- # Question 5 - Open question
- #Then I fill in ckeditor field "<string>" with "<string>"
- Then wait for the page to be loaded
- Then I press "Next question"
- # Question 6 - Oral question
- Then wait for the page to be loaded
- Then I press "Next question"
- # Question 7 - Exact answers combination
- Then I check "Answer true"
- Then I press "Next question"
- Then wait for the page to be loaded
- # Question 8 - Unique answer with unknown
- And I check the "Answer true" radio button
- Then I press "Next question"
- Then wait for the page to be loaded
- # Question 9 - Multiple answer true - false - dont know
- #@todo
- Then I press "Next question"
- # Question 10 - Combination true - false - don't-know
- #@todo
- Then I press "Next question"
- # Question 11 - Global multiple answer
- Then I check "Answer true"
- Then I press "End test"
- Then I should see "Score for the test: 83 / 117"
- 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: 83 / 117"
- Scenario: Create a session "Session Exercise" and add user "acostea"
- Given I am on "/main/session/session_add.php"
- When I fill in the following:
- | name | Session Exercise |
- And I fill in select2 input "#coach_username" with id "1" and value "admin"
- And I press "submit"
- Then wait for the page to be loaded
- Then I should see "Add courses to this session (Session Exercise)"
- Then I select "TEMP (TEMP)" from "NoSessionCoursesList[]"
- And I press "add_course"
- And I press "next"
- Then I should see "Update successful"
- Then I follow "Multiple registration"
- Then I select "Costea Andrea (acostea)" from "nosessionUsersList[]"
- And I press "add_user"
- And I press "next"
- Then I should see "Update successful"
- Scenario: Try exercise with categorized questions as student
- Given I am a student
- And I am on course "TEMP" homepage in session "Session Exercise"
- Then I should see "TEMP (Session Exercise)"
- And I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise for Behat test"
- And I follow "Start test"
- When wait for the page to be loaded
- And I press "Next question"
- And I check "oligarchy"
- And I check "oligopoly"
- And I check "timocracy"
- And I check "autocracy"
- And I press "Next question"
- And I check the "semantics" radio button
- And I press "Next question"
- And I check the "RNASL" radio button
- And I press "Next question"
- And I check the "10" radio button
- And I press "Next question"
- And fill in the following:
- | choice_id_6_0 | words |
- | choice_id_6_1 | fill |
- | choice_id_6_2 | blanks |
- And I press "Next question"
- And I select "A" from "choice_id_7_1"
- And I select "B" from "choice_id_7_2"
- And I select "C" from "choice_id_7_3"
- And I press "Next question"
- And wait for the page to be loaded
- And I check "1"
- And I press "Next question"
- And wait for the page to be loaded
- And I press "End test"
- Then I should see "Score for the test: 190 / 190"
- And I should see the table "#category_results":
- | Categories | Absolute score | Relative score |
- | Categoryname2 | 50 / 70 | 71.43% |
- | Categoryname1 | 60 / 60 | 100% |
- | none | 80 / 60 | 133.33% |
- | Total | 190 / 190 | 100% |
- Scenario: Teacher looks at exercise results by categories
- Given I am on "/user_portal.php"
- And I am on course "TEMP" homepage in session "Session Exercise"
- Then I should see "TEMP (Session Exercise)"
- And I am on "/main/exercise/exercise.php?cidReq=TEMP"
- And I follow "Exercise for Behat test"
- And I follow "Results and feedback"
- Then I should see "Learner score"
- And wait very long for the page to be loaded
- And I follow "Grade activity"
- Then I should see "Score for the test: 190 / 190"
- And I should see the table "#category_results":
- | Categories | Absolute score | Relative score |
- | Categoryname2 | 50 / 70 | 71.43% |
- | Categoryname1 | 60 / 60 | 100% |
- | none | 80 / 60 | 133.33% |
- | Total | 190 / 190 | 100% |
- 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: Delete an exercise category
- Given I am on "/main/exercise/tests_category.php?cidReq=TEMP"
- And I follow "Delete"
- Then I should see "Category deleted"
- Scenario: Delete an exercise category
- Given I am on "/main/exercise/tests_category.php?cidReq=TEMP"
- And I follow "Delete"
- Then I should see "Category deleted"
- Scenario: Delete session
- Given I am on "/main/session/session_list.php?keyword=Session+Exercise"
- And wait for the page to be loaded
- And I follow "Delete"
- And I confirm the popup
- Then I should see "Deleted"
|