itemengine-cypress-automation 1.0.584-IEI-7041-1da58ac.0 → 1.0.584-IEI-7048-098328c.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +1 -4
  2. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +8 -109
  3. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +8 -109
  4. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +8 -109
  5. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/blankResponseScoring.js +2 -7
  6. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +10 -139
  7. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +1 -4
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +9 -124
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +10 -139
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +1 -4
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +9 -124
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +8 -109
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +9 -124
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/allOrNothingForAllViews.smoke.js +2 -243
  15. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +77 -0
  16. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +78 -1
  17. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +78 -1
  18. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +104 -9
  19. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsBasic.js +4 -0
  20. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +95 -0
  21. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +95 -0
  22. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +84 -0
  23. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsBasic.js +4 -0
  24. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +73 -0
  25. package/cypress/e2e/ILC/ListOrderingDropdown/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +84 -0
  26. package/cypress/e2e/ILC/ListOrderingDropdown/allOrNothingForAllViews.smoke.js +187 -2
  27. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +79 -1
  28. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +79 -0
  29. package/cypress/e2e/ILC/ListOrderingNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +79 -0
  30. package/cypress/e2e/ILC/ListOrderingNew/Scoring/manuallyAndNonScored.js +4 -0
  31. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +103 -0
  32. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsBasic.js +4 -0
  33. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
  34. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  35. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
  36. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsBasic.js +4 -0
  37. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
  38. package/cypress/e2e/ILC/ListOrderingNew/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
  39. package/cypress/e2e/ILC/ListOrderingNew/allOrNothingForAllViews.smoke.js +209 -5
  40. package/cypress/e2e/ILC/ListOrderingNew/horizontalOrientationAllOrNothingForAllViews.smoke.js +195 -1
  41. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/HorizontalOrientation/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  42. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +85 -0
  43. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +82 -0
  44. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +85 -0
  45. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +109 -6
  46. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsBasic.js +4 -0
  47. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsEqualToAlternativePoints.js +103 -0
  48. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialDifferentWeightsCorrectPointsGreaterThanAlternativePoints.js +103 -0
  49. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsAlternativePointsGreaterThanCorrectPoints.js +91 -0
  50. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsBasic.js +4 -0
  51. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsEqualToAlternativePoints.js +79 -0
  52. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/Scoring/partialEqualWeightsCorrectPointsGreaterThanAlternativePoints.js +91 -0
  53. package/cypress/e2e/ILC/ListOrderingReorderAsASeperateList/allOrNothingForAllViews.smoke.js +207 -3
  54. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingGroupedScoring.js +9 -1
  55. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
  56. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
  57. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +107 -2
  58. package/cypress/e2e/ILC/Matching/Scoring/blankResponseScoring.js +36 -2
  59. package/cypress/e2e/ILC/Matching/Scoring/checkScoringLabelBannerAndCorrectAnswerSection.js +5 -0
  60. package/cypress/e2e/ILC/Matching/Scoring/manuallyAndNonScored.js +1 -0
  61. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
  62. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
  63. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +115 -2
  64. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +128 -2
  65. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsBasic.js +9 -1
  66. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
  67. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
  68. package/cypress/e2e/ILC/Matching/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
  69. package/cypress/e2e/ILC/Matching/allOrNothingScoringForAllViews.smoke.js +226 -2
  70. package/cypress/e2e/ILC/Matching/maximumCapacityPerDropzoneSection.js +9 -1
  71. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +102 -2
  72. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +102 -2
  73. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +102 -2
  74. package/cypress/e2e/ILC/MatchingDropdown/Scoring/blankResponseScoring.js +32 -5
  75. package/cypress/e2e/ILC/MatchingDropdown/Scoring/manuallyAndNonScored.js +3 -0
  76. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsScoringBasic.js +10 -1
  77. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +128 -2
  78. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternatePoints.js +115 -2
  79. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternatePoints.js +128 -2
  80. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsBasic.js +9 -1
  81. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +115 -2
  82. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +102 -2
  83. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +115 -2
  84. package/cypress/e2e/ILC/MatchingDropdown/allOrNothingScoringForAllViews.smoke.js +216 -2
  85. package/cypress/pages/components/correctIncorrectAnswerLabelComponent.js +18 -1
  86. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +1 -25
  87. package/cypress/pages/listOrderingPage.js +60 -1
  88. package/cypress/pages/matchingPage.js +23 -1
  89. package/package.json +1 -1
@@ -4,6 +4,7 @@ import abortEarlySetup from "../../../../support/helpers/abortEarly";
4
4
  let options = ['sprout', 'plant', 'flower', 'seed'];
5
5
  let correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
6
6
  let alternateCorrectAnswerArray = ['seed', 'flower', 'sprout', 'plant'];
7
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
7
8
 
8
9
  describe('Create Item page - List ordering: Partial equal weights scoring with alternative answer - When correct answer points are more than alternative answer points', () => {
9
10
  before(() => {
@@ -41,6 +42,18 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
41
42
  listOrderingPage.steps.switchToGradingView();
42
43
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
43
44
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
45
+ if (alternativeAnswerCheck === 'true') {
46
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
47
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower']);
48
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
49
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
50
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
51
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
52
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
53
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
54
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
55
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
56
+ }
44
57
  });
45
58
 
46
59
  it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, correct/incorrect status message and correct answer section should not be displayed', () => {
@@ -58,6 +71,9 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
58
71
  listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
59
72
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
60
73
  listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
74
+ if (alternativeAnswerCheck === 'true') {
75
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
76
+ }
61
77
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
62
78
  });
63
79
 
@@ -76,6 +92,9 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
76
92
  listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
77
93
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
78
94
  listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
95
+ if (alternativeAnswerCheck === 'true') {
96
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
97
+ }
79
98
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
80
99
  });
81
100
 
@@ -94,6 +113,18 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
94
113
  listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
95
114
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
96
115
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
116
+ if (alternativeAnswerCheck === 'true') {
117
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
118
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower']);
119
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
120
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
121
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
122
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
123
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
124
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
125
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
126
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
127
+ }
97
128
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
98
129
  });
99
130
 
@@ -112,6 +143,18 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
112
143
  listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
113
144
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
114
145
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
146
+ if (alternativeAnswerCheck === 'true') {
147
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
148
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower']);
149
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
150
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
151
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
152
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
153
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
154
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
155
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
156
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
157
+ }
115
158
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
116
159
  });
117
160
 
@@ -130,6 +173,18 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
130
173
  listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
131
174
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
132
175
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
176
+ if (alternativeAnswerCheck === 'true') {
177
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
178
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower']);
179
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
180
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
181
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
182
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
183
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
184
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
185
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
186
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
187
+ }
133
188
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
134
189
  });
135
190
 
@@ -148,6 +203,18 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
148
203
  listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
149
204
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
150
205
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
206
+ if (alternativeAnswerCheck === 'true') {
207
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
208
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower']);
209
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
210
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
211
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
212
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
213
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
214
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
215
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
216
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
217
+ }
151
218
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
152
219
  });
153
220
 
@@ -166,6 +233,18 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
166
233
  listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
167
234
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
168
235
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
236
+ if (alternativeAnswerCheck === 'true') {
237
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 5 pts)', 0);
238
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower']);
239
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
240
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
241
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
242
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
243
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
244
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
245
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 3 pts)', 1);
246
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
247
+ }
169
248
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
170
249
  });
171
250
 
@@ -197,6 +276,18 @@ describe('Create Item page - List ordering: Partial equal weights scoring with a
197
276
  listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
198
277
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
199
278
  listOrderingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
279
+ if (alternativeAnswerCheck === 'true') {
280
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(Points per response - 12.5 pts)', 0);
281
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower']);
282
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
283
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
284
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
285
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
286
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
287
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
288
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(Points per response - 2.5 pts)', 1);
289
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['plant', 'flower', 'sprout', 'seed']);
290
+ }
200
291
  listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
201
292
  });
202
293
  });
@@ -8,6 +8,8 @@ const views = utilities.getViews(correctAnswerViews);
8
8
  var itemReferenceID = "";
9
9
  const options = ['sprout', 'plant', 'flower', 'seed'];
10
10
  const correctAnswerArray = ['seed', 'sprout', 'plant', 'flower'];
11
+ const alternateCorrectAnswerArray = ['seed', 'flower', 'sprout', 'plant'];
12
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
11
13
 
12
14
  describe('Create item page - List ordering: All or nothing ', () => {
13
15
  before(() => {
@@ -116,7 +118,11 @@ describe('Create item page - List ordering: All or nothing ', () => {
116
118
  listOrderingPage.steps.switchToGradingView();
117
119
  listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
118
120
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
119
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
121
+ if (alternativeAnswerCheck === 'true') {
122
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
123
+ } else {
124
+ utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
125
+ }
120
126
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
121
127
  });
122
128
  };
@@ -194,11 +200,198 @@ describe('Create item page - List ordering: All or nothing ', () => {
194
200
  listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
195
201
  listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
196
202
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
203
+ if (alternativeAnswerCheck === 'true') {
204
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
205
+ }
197
206
  listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
198
207
  });
199
208
  });
200
209
  });
201
210
 
211
+ if (alternativeAnswerCheck === 'true') {
212
+ views.forEach((view) => {
213
+ describe(`${view}: Auto scored - All or nothing scoring`, { tags: 'smoke' }, () => {
214
+ abortEarlySetup();
215
+ before(() => {
216
+ switch (view) {
217
+ case 'Question preview':
218
+ listOrderingPage.steps.navigateToCreateQuestion('list ordering');
219
+ cy.barsPreLoaderWait();
220
+ listOrderingPage.steps.selectOrderingLayoutOption('Reorder as a separate list');
221
+ listOrderingPage.steps.addInputToOptionsInputField(options);
222
+ listOrderingPage.steps.addTextInQuestionInstructionsInputField('Arrange options in correct order.');
223
+ listOrderingPage.steps.allotPoints(20);
224
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
225
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
226
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
227
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
228
+ listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(correctAnswerArray);
229
+ listOrderingPage.steps.addAlternativeAnswerAccordion(1);
230
+ listOrderingPage.steps.allotPoints(12);
231
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
232
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
233
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
234
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
235
+ listOrderingPage.steps.verifyOptionsInDropzoneOrderAsSeperateList(alternateCorrectAnswerArray);
236
+ listOrderingPage.steps.switchToPreviewTab();
237
+ break;
238
+ case 'Item preview':
239
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
240
+ itemPreviewPage.steps.switchToPreviewTab();
241
+ break;
242
+ case 'Grading view':
243
+ cy.wait(5000);
244
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
245
+ break;
246
+ };
247
+ });
248
+
249
+ beforeEach(() => {
250
+ switch (view) {
251
+ case 'Question preview':
252
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
253
+ listOrderingPage.steps.resetQuestionPreview();
254
+ break;
255
+ case 'Item preview':
256
+ listOrderingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
257
+ itemPreviewPage.steps.resetQuestionPreview();
258
+ break;
259
+ case 'Grading view':
260
+ cy.wait(5000);
261
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
262
+ break;
263
+ }
264
+ });
265
+
266
+ if (view === 'Question preview') {
267
+ after(() => {
268
+ listOrderingPage.steps.clickOnSaveQuestionButton();
269
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
270
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
271
+ });
272
+ };
273
+
274
+ if (view === 'Question preview' || view === 'Item preview') {
275
+ it('When the user selects \'Grading\' view without attempting the question, then correct/incorrect icons and correct incorrect status message should not be displayed and correct answer section with all correct answers should be displayed', () => {
276
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
277
+ listOrderingPage.steps.switchToGradingView();
278
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
279
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
280
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
281
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
282
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
283
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower',]);
284
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
285
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
286
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
287
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
288
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
289
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
290
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(12 points)', 1);
291
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
292
+ });
293
+ };
294
+
295
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
296
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
297
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
298
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
299
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
300
+ if (view === 'Grading view') {
301
+ studentViewPage.steps.submitResponse();
302
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
303
+ studentViewPage.steps.clickOnGoToGradingViewButton();
304
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
305
+ };
306
+ if (view === 'Question preview' || view === 'Item preview') {
307
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
308
+ listOrderingPage.steps.switchToGradingView();
309
+ };
310
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
311
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('plant');
312
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
313
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('seed');
314
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
315
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
316
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
317
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower',]);
318
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
319
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
320
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
321
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
322
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
323
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
324
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(12 points)', 1);
325
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
326
+ });
327
+
328
+ it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers should be displayed', () => {
329
+ if (view === 'Grading view') {
330
+ studentViewPage.steps.clearResponses();
331
+ };
332
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
333
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
334
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
335
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
336
+ if (view === 'Grading view') {
337
+ studentViewPage.steps.submitResponse();
338
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
339
+ studentViewPage.steps.clickOnGoToGradingViewButton();
340
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
341
+ };
342
+ if (view === 'Question preview' || view === 'Item preview') {
343
+ listOrderingPage.steps.verifyPreviewScore(0, 20);
344
+ listOrderingPage.steps.switchToGradingView();
345
+ };
346
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
347
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('flower');
348
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
349
+ listOrderingPage.steps.verifyIncorrectOptionIconSeperateList('sprout');
350
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
351
+ listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
352
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
353
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(0, ['seed', 'sprout', 'plant', 'flower',]);
354
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleExists();
355
+ listOrderingPage.steps.disableShowAlternativeAnswersToggle();
356
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
357
+ listOrderingPage.steps.verifyAlternativeAnswersSectionNotExist();
358
+ listOrderingPage.steps.clickShowAlternativeAnswersToggle();
359
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleChecked();
360
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(12 points)', 1);
361
+ listOrderingPage.steps.verifyOptionsInCorrectAndAlternativeAnswerSection(1, ['seed', 'flower', 'sprout', 'plant']);
362
+ });
363
+
364
+ it('When the user attempts the question correctly, the user should be awarded full points and on switching to \'Grading\' view, then correct icons should be displayed beside all the correct responses, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
365
+ if (view === 'Grading view') {
366
+ studentViewPage.steps.clearResponses();
367
+ };
368
+ listOrderingPage.steps.clickAndDropOptionSeperateList('seed');
369
+ listOrderingPage.steps.clickAndDropOptionSeperateList('sprout');
370
+ listOrderingPage.steps.clickAndDropOptionSeperateList('plant');
371
+ listOrderingPage.steps.clickAndDropOptionSeperateList('flower');
372
+ if (view === 'Grading view') {
373
+ studentViewPage.steps.submitResponse();
374
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
375
+ studentViewPage.steps.clickOnGoToGradingViewButton();
376
+ gradingViewPage.steps.verifyGradingViewScore(20, 20);
377
+ };
378
+ if (view === 'Question preview' || view === 'Item preview') {
379
+ listOrderingPage.steps.verifyPreviewScore(20, 20);
380
+ listOrderingPage.steps.switchToGradingView();
381
+ listOrderingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
382
+ };
383
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('seed');
384
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('sprout');
385
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
386
+ listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
387
+ listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
388
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
389
+ listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
390
+ });
391
+ });
392
+ });
393
+ }
394
+
202
395
  views.forEach((view) => {
203
396
  describe(`${view}: List ordering (Reorder as a separate list) - Manually scored`, { tags: 'smoke' }, () => {
204
397
  abortEarlySetup();
@@ -338,7 +531,11 @@ describe('Create item page - List ordering: All or nothing ', () => {
338
531
  if (view === 'Question preview' || view === 'Item preview') {
339
532
  listOrderingPage.steps.checkNonScoredScoringLabel();
340
533
  listOrderingPage.steps.switchToGradingView();
341
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
534
+ if (alternativeAnswerCheck === 'true') {
535
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '', 0);
536
+ } else {
537
+ utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
538
+ }
342
539
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(['seed', 'sprout', 'plant', 'flower']);
343
540
  };
344
541
  });
@@ -415,6 +612,9 @@ describe('Create item page - List ordering: All or nothing ', () => {
415
612
  listOrderingPage.steps.verifyCorrectOptionIconSeperateList('plant');
416
613
  listOrderingPage.steps.verifyCorrectOptionIconSeperateList('flower');
417
614
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
615
+ if (alternativeAnswerCheck === 'true') {
616
+ listOrderingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
617
+ }
418
618
  listOrderingPage.steps.verifyCorrectAnswerSectionNotExists();
419
619
  });
420
620
  });
@@ -532,7 +732,11 @@ describe('Create item page - List ordering: All or nothing ', () => {
532
732
  listOrderingPage.steps.switchToGradingView();
533
733
  listOrderingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
534
734
  listOrderingPage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
535
- utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
735
+ if (alternativeAnswerCheck === 'true') {
736
+ listOrderingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '', 0);
737
+ } else {
738
+ utilities.verifyInnerText(listOrderingPage.correctAnswersLabel(), 'Correct answers');
739
+ }
536
740
  listOrderingPage.steps.verifyOptionsInCorrectAnswerSection(correctAnswerArray);
537
741
  });
538
742
  };
@@ -1,6 +1,7 @@
1
1
  import { matchingPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
4
5
 
5
6
  describe('Create item page - Matching: All or nothing with grouped options layout', () => {
6
7
  before(() => {
@@ -28,7 +29,11 @@ describe('Create item page - Matching: All or nothing with grouped options layou
28
29
  matchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
29
30
  matchingPage.steps.verifyDropzoneNumeration();
30
31
  utilities.verifyElementVisibilityState(matchingPage.correctIncorrectAnswerLabel(), 'notExist');
31
- utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
32
+ if(alternativeAnswerCheck === 'true') {
33
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
34
+ } else {
35
+ utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
36
+ }
32
37
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
33
38
  });
34
39
 
@@ -143,6 +148,9 @@ describe('Create item page - Matching: All or nothing with grouped options layou
143
148
  matchingPage.steps.verifyCorrectOptionIcon(2);
144
149
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
145
150
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
151
+ if (alternativeAnswerCheck === 'true') {
152
+ matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
153
+ }
146
154
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
147
155
  /*cy.log('When user attempts the question correctly and clicks on \'Check answer\' button, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed')
148
156
  matchingPage.steps.checkAnswer();
@@ -2,6 +2,7 @@ import { matchingPage } from "../../../../pages";
2
2
  import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
3
  import utilities from "../../../../support/helpers/utilities";
4
4
  const css = Cypress.env('css');
5
+ const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT');
5
6
  const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
6
7
  const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
7
8
 
@@ -32,8 +33,23 @@ describe('Create item page - Matching: All or nothing with alternative answers',
32
33
  matchingPage.steps.switchToGradingView();
33
34
  matchingPage.steps.verifyDropzoneNumeration();
34
35
  utilities.verifyElementVisibilityState(matchingPage.correctIncorrectAnswerLabel(), 'notExist');
35
- utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
36
- matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
36
+ if (alternativeAnswerCheck === 'true') {
37
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
38
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
39
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
40
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
41
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
42
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
43
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
44
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
45
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
46
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']], 1);
47
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
48
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
49
+ } else {
50
+ utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
51
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
52
+ }
37
53
  });
38
54
 
39
55
  it('When the user attempts the question with responses from the correct accordion, then the user should be awarded points of the correct tab and on switching to \'Grading\' view, correct icons should be displayed beside all the correct responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed', () => {
@@ -46,6 +62,9 @@ describe('Create item page - Matching: All or nothing with alternative answers',
46
62
  matchingPage.steps.verifyCorrectOptionIcon(2);
47
63
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
48
64
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
65
+ if (alternativeAnswerCheck === 'true') {
66
+ matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
67
+ }
49
68
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
50
69
  /*cy.log('When the user has attempted the question with responses from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
51
70
  matchingPage.steps.checkAnswer();
@@ -66,6 +85,9 @@ describe('Create item page - Matching: All or nothing with alternative answers',
66
85
  matchingPage.steps.verifyCorrectOptionIcon(2);
67
86
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
68
87
  matchingPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ if (alternativeAnswerCheck === 'true') {
89
+ matchingPage.steps.verifyShowAlternativeAnswersToggleNotExists();
90
+ }
69
91
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
70
92
  /*cy.log('When the user has attempted the question with responses from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' and correct answer section should not be displayed')
71
93
  matchingPage.steps.checkAnswer();
@@ -86,6 +108,19 @@ describe('Create item page - Matching: All or nothing with alternative answers',
86
108
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
87
109
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
88
110
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
111
+ if (alternativeAnswerCheck === 'true') {
112
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
113
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
114
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
115
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
116
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
117
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
118
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
119
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
120
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']], 1);
121
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
122
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
123
+ }
89
124
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
90
125
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed for unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
91
126
  matchingPage.steps.checkAnswer();
@@ -106,6 +141,19 @@ describe('Create item page - Matching: All or nothing with alternative answers',
106
141
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
107
142
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
108
143
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
144
+ if (alternativeAnswerCheck === 'true') {
145
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
146
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
147
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
148
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
149
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
150
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
151
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
152
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
153
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']], 1);
154
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
155
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
156
+ }
109
157
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
110
158
  /*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed for unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
111
159
  matchingPage.steps.checkAnswer();
@@ -126,6 +174,19 @@ describe('Create item page - Matching: All or nothing with alternative answers',
126
174
  matchingPage.steps.verifyCorrectOptionIcon(2);
127
175
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
128
176
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
177
+ if (alternativeAnswerCheck === 'true') {
178
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
179
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
180
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
181
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
182
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
183
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
184
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
185
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
186
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']], 1);
187
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
188
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
189
+ }
129
190
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
130
191
  /*cy.log('When the user has attempted the question with partially correct with all the response correct as per the alternative accordion but one response incomplete and clicks on \'Check answer\' button, then correct icon should be displayed besides the response from the correct accordion, incorrect icon should be displayed besides the responses from the alternative accordion and no icon should be displayed for unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
131
192
  matchingPage.steps.checkAnswer();
@@ -146,6 +207,19 @@ describe('Create item page - Matching: All or nothing with alternative answers',
146
207
  matchingPage.steps.verifyCorrectOptionIcon(2);
147
208
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
148
209
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
210
+ if (alternativeAnswerCheck === 'true') {
211
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
212
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
213
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
214
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
215
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
216
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
217
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
218
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
219
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']], 1);
220
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
221
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
222
+ }
149
223
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
150
224
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed beside empty responses a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
151
225
  matchingPage.steps.checkAnswer();
@@ -166,6 +240,19 @@ describe('Create item page - Matching: All or nothing with alternative answers',
166
240
  matchingPage.steps.verifyCorrectOptionIcon(2);
167
241
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
168
242
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
243
+ if (alternativeAnswerCheck === 'true') {
244
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
245
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
246
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
247
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
248
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
249
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
250
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
251
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
252
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']], 1);
253
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
254
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
255
+ }
169
256
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
170
257
  /*cy.log('When the user has attempted the question with equal number of correct responses from correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, no icon should be displayed for unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
171
258
  matchingPage.steps.checkAnswer();
@@ -186,6 +273,19 @@ describe('Create item page - Matching: All or nothing with alternative answers',
186
273
  matchingPage.steps.verifyIncorrectOptionIconForEmptyOption(2);
187
274
  matchingPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
188
275
  matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Bear'], ['Penguin'], ['Cat']]);
276
+ if (alternativeAnswerCheck === 'true') {
277
+ matchingPage.steps.verifyAnswerLabelAndPoints('Correct answer', '(20 points)', 0);
278
+ matchingPage.steps.verifyShowAlternativeAnswersToggleExists();
279
+ matchingPage.steps.disableShowAlternativeAnswersToggle();
280
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
281
+ matchingPage.steps.verifyAlternativeAnswersSectionNotExist();
282
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
283
+ matchingPage.steps.verifyShowAlternativeAnswersToggleChecked();
284
+ matchingPage.steps.verifyAnswerLabelAndPoints('Alternative answer', '(10 points)', 1);
285
+ matchingPage.steps.verifyAlternativeAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']], 1);
286
+ matchingPage.steps.clickShowAlternativeAnswersToggle();
287
+ matchingPage.steps.verifyShowAlternativeAnswersToggleUnchecked();
288
+ }
189
289
  matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
190
290
  /*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, no icon should be displayed for unattempted response a status message with text \'Your answer is incorrect\' and correct answer section should not be displayed')
191
291
  matchingPage.steps.checkAnswer();