toolExercise.feature 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. Feature: Exercise tool
  2. In order to use the exercise tool
  3. The teachers should be able to create exercises
  4. Background:
  5. Given I am a platform administrator
  6. And I am on course "TEMP" homepage
  7. Scenario: Create a question category
  8. Given I am on "/main/exercise/tests_category.php?action=addcategory&cidReq=TEMP"
  9. And wait for the page to be loaded
  10. When I fill in the following:
  11. | category_name | Category 1 |
  12. And I fill in ckeditor field "category_description" with "Category 1 description"
  13. And I press "SubmitNote"
  14. Then I should see "Category added"
  15. Scenario: Create a second question category
  16. Given I am on "/main/exercise/tests_category.php?action=addcategory&cidReq=TEMP"
  17. And wait for the page to be loaded
  18. When I fill in the following:
  19. | category_name | Category 2 |
  20. And I fill in ckeditor field "category_description" with "Category 2 description"
  21. And I press "SubmitNote"
  22. Then I should see "Category added"
  23. Scenario: Create an exercise
  24. Given I am on "/main/exercise/exercise_admin.php?cidReq=TEMP"
  25. And I press advanced settings
  26. When I fill in the following:
  27. | exercise_title | Exercise 1 |
  28. And I fill in ckeditor field "exerciseDescription" with "Exercise description"
  29. And I press "submitExercise"
  30. Then I should see "Exercise added"
  31. Scenario: Edit an exercise
  32. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  33. And I follow "Exercise 1"
  34. And I follow "Edit"
  35. And I follow "Edit test name and settings"
  36. And I press "submitExercise"
  37. Then I should see "Test name and settings have been saved."
  38. Scenario: Add question "Multiple choice" to exercise created "Exercise 1"
  39. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  40. And I follow "Exercise 1"
  41. And I follow "Edit"
  42. And I follow "Multiple choice"
  43. When I fill in the following:
  44. | questionName | Multiple choice |
  45. | weighting[1] | 10 |
  46. Then I fill in ckeditor field "answer[1]" with "Answer true"
  47. Then I fill in ckeditor field "answer[2]" with "Answer false"
  48. Then I fill in ckeditor field "answer[3]" with "Answer false"
  49. Then I fill in ckeditor field "answer[4]" with "Answer false"
  50. Then I fill in ckeditor field "comment[1]" with "Comment true"
  51. Then I fill in ckeditor field "comment[2]" with "Comment false"
  52. Then I fill in ckeditor field "comment[3]" with "Comment false"
  53. Then I fill in ckeditor field "comment[4]" with "Comment false"
  54. And I press "submit-question"
  55. Then I should see "Item added"
  56. Scenario: Add question "Multiple answer" to exercise created "Exercise 1"
  57. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  58. And I follow "Exercise 1"
  59. And I follow "Edit"
  60. And I follow "Multiple answer"
  61. When I fill in the following:
  62. | questionName | Multiple answers |
  63. | weighting[1] | 10 |
  64. Then I check the "correct[1]" radio button
  65. Then I fill in ckeditor field "answer[1]" with "Answer true"
  66. Then I fill in ckeditor field "answer[2]" with "Answer false"
  67. Then I fill in ckeditor field "answer[3]" with "Answer false"
  68. Then I fill in ckeditor field "answer[4]" with "Answer false"
  69. Then I fill in ckeditor field "comment[1]" with "Comment true"
  70. Then I fill in ckeditor field "comment[2]" with "Comment false"
  71. Then I fill in ckeditor field "comment[3]" with "Comment false"
  72. Then I fill in ckeditor field "comment[4]" with "Comment false"
  73. And I press "submit-question"
  74. Then I should see "Item added"
  75. Scenario: Add question "Fill in blanks" to "Exercise 1"
  76. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  77. And I follow "Exercise 1"
  78. And I follow "Edit"
  79. And I follow "Fill blanks or form"
  80. When I fill in the following:
  81. | questionName | Fill blanks |
  82. Then I fill in ckeditor field "answer" with "Romeo and [Juliet]"
  83. And I press "submitQuestion"
  84. Then I should see "Item added"
  85. Scenario: Add question "Matching" to exercise created "Exercise 1"
  86. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  87. And I follow "Exercise 1"
  88. And I follow "Edit"
  89. And I follow "Matching"
  90. When I fill in the following:
  91. | questionName | Matching |
  92. And I fill in ckeditor field "answer[1]" with "Answer A"
  93. And I fill in ckeditor field "answer[2]" with "Answer B"
  94. And I fill in ckeditor field "option[1]" with "Option A"
  95. And I fill in ckeditor field "option[2]" with "Option B"
  96. And I fill in select bootstrap static input "#matches_2" select "2"
  97. And I press "submitQuestion"
  98. Then I should see "Item added"
  99. Scenario: Add question "Open" to exercise created "Exercise 1"
  100. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  101. And I follow "Exercise 1"
  102. And I follow "Edit"
  103. And I follow "Open"
  104. When I fill in the following:
  105. | questionName | Open question |
  106. | weighting | 10 |
  107. And I press "submitQuestion"
  108. Then I should see "Item added"
  109. Scenario: Add question "Oral expression" to exercise created "Exercise 1"
  110. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  111. And I follow "Exercise 1"
  112. And I follow "Edit"
  113. And I follow "Oral expression"
  114. When I fill in the following:
  115. | questionName | Oral expression question |
  116. | weighting | 10 |
  117. And I press "submitQuestion"
  118. Then I should see "Item added"
  119. Scenario: Add question "Exact answers combination" to exercise created "Exercise 1"
  120. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  121. And I follow "Exercise 1"
  122. And I follow "Edit"
  123. And I follow "Exact Selection"
  124. When I fill in the following:
  125. | questionName | Exact answers combination |
  126. Then I check the "correct[1]" radio button
  127. Then I fill in ckeditor field "answer[1]" with "Answer true"
  128. Then I fill in ckeditor field "answer[2]" with "Answer false"
  129. Then I fill in ckeditor field "comment[1]" with "Comment true"
  130. Then I fill in ckeditor field "comment[2]" with "Comment false"
  131. And I press "submitQuestion"
  132. Then I should see "Item added"
  133. Scenario: Add question "Unique answer with unknown" to exercise created "Exercise 1"
  134. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  135. And I follow "Exercise 1"
  136. And I follow "Edit"
  137. And I follow "Unique answer with unknown"
  138. When I fill in the following:
  139. | questionName | Unique answer with unknown |
  140. | weighting[1] | 10 |
  141. Then I check the "correct" radio button
  142. Then I fill in ckeditor field "answer[1]" with "Answer true"
  143. Then I fill in ckeditor field "answer[2]" with "Answer false"
  144. Then I fill in ckeditor field "answer[3]" with "Answer false"
  145. Then I fill in ckeditor field "comment[1]" with "Comment true"
  146. Then I fill in ckeditor field "comment[2]" with "Comment false"
  147. Then I fill in ckeditor field "comment[3]" with "Comment false"
  148. And I press "submitQuestion"
  149. Then I should see "Item added"
  150. Scenario: Add question "Multiple answer true/false/don't know" to exercise created "Exercise 1"
  151. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  152. And I follow "Exercise 1"
  153. And I follow "Edit"
  154. And I follow "Multiple answer true/false/don't know"
  155. When I fill in the following:
  156. | questionName | Multiple answer true - false - dont know |
  157. Then I check the "correct[1]" radio button
  158. Then I check the "correct[2]" radio button
  159. Then I check the "correct[3]" radio button
  160. Then I check the "correct[4]" radio button
  161. Then I fill in ckeditor field "answer[1]" with "Answer true"
  162. Then I fill in ckeditor field "answer[2]" with "Answer true"
  163. Then I fill in ckeditor field "answer[3]" with "Answer true"
  164. Then I fill in ckeditor field "answer[4]" with "Answer true"
  165. Then I fill in ckeditor field "comment[1]" with "Comment true"
  166. Then I fill in ckeditor field "comment[2]" with "Comment true"
  167. Then I fill in ckeditor field "comment[3]" with "Comment true"
  168. Then I fill in ckeditor field "comment[4]" with "Comment true"
  169. And I press "submitQuestion"
  170. Then I should see "Item added"
  171. Scenario: Add question "Combination true/false/don't-know" to exercise created "Exercise 1"
  172. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  173. And I follow "Exercise 1"
  174. And I follow "Edit"
  175. And I follow "Combination true/false/don't-know"
  176. When I fill in the following:
  177. | questionName | Combination true - false - don't-know |
  178. Then I check the "correct[1]" radio button
  179. Then I fill in ckeditor field "answer[1]" with "Answer true"
  180. Then I fill in ckeditor field "answer[2]" with "Answer false"
  181. Then I fill in ckeditor field "comment[1]" with "Comment true"
  182. Then I fill in ckeditor field "comment[2]" with "Comment false"
  183. And I press "submitQuestion"
  184. Then I should see "Item added"
  185. Scenario: Add question "Global multiple answer" to exercise created "Exercise 1"
  186. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  187. And I follow "Exercise 1"
  188. And I follow "Edit"
  189. And I follow "Global multiple answer"
  190. When I fill in the following:
  191. | questionName | Global multiple answer |
  192. | weighting[1] | 10 |
  193. Then I check the "correct[1]" radio button
  194. Then I fill in ckeditor field "answer[1]" with "Answer true"
  195. Then I fill in ckeditor field "answer[2]" with "Answer false"
  196. Then I fill in ckeditor field "answer[3]" with "Answer false"
  197. Then I fill in ckeditor field "answer[4]" with "Answer false"
  198. Then I fill in ckeditor field "comment[1]" with "Comment true"
  199. Then I fill in ckeditor field "comment[2]" with "Comment false"
  200. Then I fill in ckeditor field "comment[3]" with "Comment false"
  201. Then I fill in ckeditor field "comment[4]" with "Comment false"
  202. And I press "submitQuestion"
  203. Then I should see "Item added"
  204. Scenario: Try exercise "Exercise 1"
  205. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  206. And I follow "Exercise 1"
  207. And I follow "Start test"
  208. # Question 1
  209. Then I should see "Multiple choice"
  210. And I check the "Answer true" radio button
  211. And wait for the page to be loaded
  212. Then I press "Next question"
  213. # Question 2
  214. And wait for the page to be loaded
  215. And I check the "Answer true" radio button
  216. And wait for the page to be loaded
  217. Then I press "Next question"
  218. # Question 3
  219. Then I fill in the following:
  220. | choice_id_3_0 | Juliet |
  221. And wait for the page to be loaded
  222. Then I press "Next question"
  223. # Question 4 - Matching
  224. Then I select "A" from "choice_id_4_1"
  225. Then I select "B" from "choice_id_4_2"
  226. Then I press "Next question"
  227. # Question 5 - Open question
  228. #Then I fill in ckeditor field "<string>" with "<string>"
  229. Then wait for the page to be loaded
  230. Then I press "Next question"
  231. # Question 6 - Oral question
  232. Then wait for the page to be loaded
  233. Then I press "Next question"
  234. # Question 7 - Exact answers combination
  235. #Then I check radio button with label "Answer true"
  236. Then I press "Next question"
  237. # Question 8 - Unique answer with unknown
  238. #@todo
  239. Then I press "Next question"
  240. # Question 9 - Multiple answer true - false - dont know
  241. #@todo
  242. Then I press "Next question"
  243. # Question 10 - Combination true - false - don't-know
  244. #@todo
  245. Then I press "Next question"
  246. # Question 11 - Global multiple answer
  247. #Then I check radio button with label "Answer true"
  248. Then I press "End test"
  249. Then I should see "Score for the test: 41 / 105"
  250. Scenario: Check exercise result
  251. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  252. And I follow "Exercise 1"
  253. And I follow "Edit"
  254. And I follow "Results and feedback"
  255. Then I should see "Learner score"
  256. And wait for the page to be loaded
  257. And I follow "Grade activity"
  258. Then I should see "Score for the test: 41 / 105"
  259. Scenario: Duplicate exercise
  260. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  261. And I follow "Copy this exercise as a new one"
  262. And I confirm the popup
  263. Then I should see "Exercise copied"
  264. And I should see "Exercise 1 - Copy"
  265. Scenario: Delete an exercise
  266. Given I am on "/main/exercise/exercise.php?cidReq=TEMP"
  267. And I follow "Delete"
  268. And I confirm the popup
  269. Then I should see "The test has been deleted"
  270. Scenario: Delete an exercise category
  271. Given I am on "/main/exercise/tests_category.php?cidReq=TEMP"
  272. And I follow "Delete"
  273. Then I should see "Category deleted"
  274. Scenario: Delete an exercise category
  275. Given I am on "/main/exercise/tests_category.php?cidReq=TEMP"
  276. And I follow "Delete"
  277. Then I should see "Category deleted"