itemengine-cypress-automation 1.0.129 → 1.0.131-updateILCrepo6March-02c78d1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/cypress/e2e/ILC/ContentBlocks/editTabBasics.js +210 -0
  2. package/cypress/e2e/ILC/ContentBlocks/previewContents.smoke.js +91 -0
  3. package/cypress/e2e/ILC/ContentBlocks/styleAndLayoutCustomizationSection.js +392 -0
  4. package/cypress/e2e/ILC/DrawingResponse/drawingResponseAdditionalSettings.js +1 -1
  5. package/cypress/e2e/ILC/DrawingResponse/drawingResponseBackground.js +1 -1
  6. package/cypress/e2e/ILC/DrawingResponse/drawingResponseCustomizeAdditionalOptions.js +2 -1
  7. package/cypress/e2e/ILC/DrawingResponse/drawingResponseGradingViewAndCorrectAnswerViewContents.smoke.js +2 -1
  8. package/cypress/e2e/ILC/EssayResponse/essayResponseSpecialCharacters.js +1 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingGroupedScoring.js +152 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +196 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +195 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +288 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/manuallyAndNonScored.js +141 -0
  14. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +245 -0
  15. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsBasic.js +413 -0
  16. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +218 -0
  17. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +245 -0
  18. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsBasic.js +163 -0
  19. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +224 -0
  20. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +196 -0
  21. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +224 -0
  22. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +83 -0
  23. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/clickAndDrop.js +653 -0
  24. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/draggableOptions.js +180 -0
  25. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/editTabScoringSection.js +229 -0
  26. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/specifyCorrectAnswerSection.js +90 -0
  27. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/switchingCasesBetweenOptionsLayout.js +50 -0
  28. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +204 -0
  29. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +204 -0
  30. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +298 -0
  31. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingPenaltyScoring.js +63 -0
  32. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/manuallyAndNonScored.js +111 -0
  33. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +231 -0
  34. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsBasic.js +90 -0
  35. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  36. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +232 -0
  37. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +231 -0
  38. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsBasic.js +138 -0
  39. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +213 -0
  40. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +186 -0
  41. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
  42. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownAndDropdownMenuSection.js +161 -0
  43. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/dropdownOptionsSection.js +328 -0
  44. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabBasicSection.js +144 -0
  45. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/editTabScoringSection.js +250 -0
  46. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/headerSection.js +75 -0
  47. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  48. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/specifyCorrectAnswerSection.js +74 -0
  49. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/studentViewSettings.js +188 -0
  50. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/clickAndDrop.js +8 -8
  51. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/editTabScoring.js +0 -1
  52. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/specifyCorrectAnswerSection.js +4 -2
  53. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +1 -52
  54. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/responseAnswersAndAcceptedStudentInput.js +3 -211
  55. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +39 -3
  56. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -8
  57. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +3 -1
  58. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -50
  59. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/conditionalCheckboxScoring.js +325 -0
  60. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +1 -146
  61. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsMinimumAndPenaltyScoring.js +300 -0
  62. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/responseLevelAlternateAnswersBasicScoring.js +78 -0
  63. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabScoringSection.js +265 -0
  64. package/cypress/e2e/ILC/FillInTheGapsTextNew/headerSection.js +75 -0
  65. package/cypress/e2e/ILC/FillInTheGapsTextNew/minimumScoringPenaltyPointsAndRoundingDropdown.js +194 -0
  66. package/cypress/e2e/ILC/FillInTheGapsTextNew/responseAnswersAndAcceptedStudentInput.js +56 -0
  67. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +40 -2
  68. package/cypress/e2e/ILC/FillInTheGapsTextNew/specialCharactersSection.js +249 -0
  69. package/cypress/e2e/ILC/FillInTheGapsTextNew/specifyCorrectAnswerSection.js +64 -0
  70. package/cypress/e2e/ILC/FillInTheGapsTextNew/studentViewSettings.js +128 -0
  71. package/cypress/e2e/ILC/Graphing/allOrNothingForAllViews.smoke.js +889 -0
  72. package/cypress/e2e/ILC/Graphing/checkAnswerFunctionalityForAllViews.smoke.js +168 -0
  73. package/cypress/e2e/ILC/Graphing/gradingViewAndCorrectAnswerView.smoke.js +203 -0
  74. package/cypress/e2e/ILC/Graphing/previewContentsForAllViews.smoke.js +222 -0
  75. package/cypress/e2e/ILC/SimpleCalculator/calculatorFunctionality.js +349 -0
  76. package/cypress/e2e/ILC/SimpleCalculator/previewContents.smoke.js +132 -0
  77. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +35 -7
  78. package/cypress/e2e/ILC/UploadResponse/studentViewSettingsSection.js +213 -0
  79. package/cypress/e2e/ILC/UploadResponse/uploadResponseAdditionalSettings.js +41 -0
  80. package/cypress/e2e/ILC/UploadResponse/uploadResponseEditTabBasicSections.js +377 -0
  81. package/cypress/e2e/ILC/UploadResponse/uploadResponsePreview.js +161 -0
  82. package/cypress/e2e/ILC/UploadResponse/uplodResponsePreviewUploadedFileProperties.js +250 -0
  83. package/cypress/fixtures/drawingToolbarOptionsAdditionalOptionsAndSpecialAndMathCharacters.js +2 -2
  84. package/cypress/fixtures/theme/ilc.json +6 -1
  85. package/cypress/fixtures/uploadResponseFileType.js +5 -0
  86. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +13 -13
  87. package/cypress/pages/components/customizeSpecialCharacterComponent.js +24 -6
  88. package/cypress/pages/components/draggableOptionContainer.js +1 -0
  89. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +42 -4
  90. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +149 -5
  91. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +954 -77
  92. package/cypress/pages/components/questionInputFieldComponent.js +1 -1
  93. package/cypress/pages/components/questionInstructionsComponent.js +2 -1
  94. package/cypress/pages/contentBlocksPage.js +515 -0
  95. package/cypress/pages/drawingResponsePage.js +2 -2
  96. package/cypress/pages/fillInTheGapsDragAndDropPage.js +359 -3
  97. package/cypress/pages/fillInTheGapsDropdownPage.js +21 -1
  98. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +5 -57
  99. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +3 -24
  100. package/cypress/pages/fillInTheGapsOverImageTextPage.js +1 -435
  101. package/cypress/pages/fillInTheGapsTextPage.js +9 -2
  102. package/cypress/pages/graphingPage.js +484 -0
  103. package/cypress/pages/index.js +4 -1
  104. package/cypress/pages/simpleCalculatorPage.js +310 -0
  105. package/cypress/pages/uploadResponsePage.js +260 -92
  106. package/package.json +2 -2
  107. package/cypress/e2e/ILC/Passage/multipageContentEditTab.js +0 -242
  108. package/cypress/e2e/ILC/Passage/passageAdditionalSettings.js +0 -99
  109. package/cypress/e2e/ILC/Passage/passageEditTab.js +0 -241
  110. package/cypress/e2e/ILC/Passage/passageHeaderSection.js +0 -73
  111. package/cypress/e2e/ILC/Passage/passagePreviewTab.js +0 -246
@@ -0,0 +1,300 @@
1
+ import { fillInTheGapsDropdownPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with dropdown: Partial different weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial different weights: Minimum scoring', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
15
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
16
+ fillInTheGapsDropdownPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
17
+ fillInTheGapsDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 1, 1: 6, 2: 5 });
18
+ fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
19
+ });
20
+
21
+ it('When the user selects \'Award minimum score\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with minimum points', () => {
22
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
23
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
24
+ fillInTheGapsDropdownPage.steps.allotMinimumPoints(2);
25
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
26
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
27
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 12);
28
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
29
+ });
30
+
31
+ it('When the user has selected \'Award minimum score\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
32
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
33
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 2, responseText: 'Roots' }]);
34
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 12);
35
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
36
+ });
37
+
38
+ it('When the user selects \'Award minimum score only if attempted\' from the minimum scoring dropdown, does not attempt the question and switches to grading view, then the user should be awarded with 0 points', () => {
39
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
40
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
41
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
42
+ fillInTheGapsDropdownPage.steps.allotMinimumPoints(2);
43
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
44
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
45
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 12);
46
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
47
+ });
48
+
49
+ it('When the user has selected \'Award minimum score only if attempted\' from the minimum scoring dropdown, attempts the question incorrectly and switches to grading view, the user should be awarded with minimum points', () => {
50
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
51
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 2, responseText: 'Roots' }]);
52
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 12);
53
+ });
54
+
55
+ it('When the user attempts the question partially correct such that points of the correctly attempted option are greater than minimum points, then the user should be awarded with points as per the correctly attempted response', () => {
56
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
57
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
58
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 12);
59
+ });
60
+
61
+ it('When the user attempts the question partially correct such that minimum points are greater than points of the correctly attempted option, then the user should be awarded with minimum points', () => {
62
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
63
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
64
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 12);
65
+ });
66
+ });
67
+
68
+ describe('Question preview: Auto scored - Partial different weights: Rounding', () => {
69
+ abortEarlySetup();
70
+ before(() => {
71
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
72
+ cy.barsPreLoaderWait();
73
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
74
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
75
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }, { responseIndex: 3, responseText: 'Roots' }]);
76
+ fillInTheGapsDropdownPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
77
+ fillInTheGapsDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 2.67, 1: 1.99, 2: 1.34, 3: 4.5 });
78
+ });
79
+
80
+ it('When the user sets \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.5 and less than 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
81
+ fillInTheGapsDropdownPage.steps.expandRoundingDropdown();
82
+ fillInTheGapsDropdownPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.99');
83
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
84
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
85
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(2, 10.5);
86
+ });
87
+
88
+ it('When the user has set \'Rounding\' to \'Round down if <=0.99\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.99, then the points awarded should be rounded down to the nearest integer value', () => {
89
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
90
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 1, responseText: 'Leaf' }]);
91
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(1, 10.5);
92
+ });
93
+
94
+ it('When the user sets \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
95
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
96
+ fillInTheGapsDropdownPage.steps.expandRoundingDropdown();
97
+ fillInTheGapsDropdownPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50');
98
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
99
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
100
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(1, 10.5);
101
+ });
102
+
103
+ it('When the user has set \'Rounding\' to \'Round down if <=0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
104
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
105
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 3, responseText: 'Roots' }]);
106
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(4, 10.5);
107
+ });
108
+
109
+ it('When the user sets \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value less than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
110
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
111
+ fillInTheGapsDropdownPage.steps.expandRoundingDropdown();
112
+ fillInTheGapsDropdownPage.steps.selectOptionFromRoundingDropdown('round down if <= 0.50; Round up if > 0.50');
113
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
114
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
115
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(1, 10.5);
116
+ });
117
+
118
+ it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value equal to 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
119
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
120
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 3, responseText: 'Roots' }]);
121
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(4, 10.5);
122
+ });
123
+
124
+ it('When the user has set \'Rounding\' to \'Round down if <=0.50, Round up if > 0.50\', attempts the question partially correct with an option such that points of the correctly attempted options has decimal value greater than 0.50, then the points awarded should be rounded down to the nearest integer value', () => {
125
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
126
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }]);
127
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(3, 10.5);
128
+ });
129
+
130
+ it('When \'Round negative score to zero\' is in checked state and the user attempts the question incorrectly, then the user should be awarded with 0 points', () => {
131
+ cy.log('Pre-step: Setting penalty scoring to \'Penalty points for the entire question\', allotting penalty points')
132
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
133
+ fillInTheGapsDropdownPage.steps.expandPenaltyScoringDropdown();
134
+ fillInTheGapsDropdownPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
135
+ fillInTheGapsDropdownPage.steps.allotPenaltyPoints(4);
136
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
137
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Seed' }]);
138
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 10.5);
139
+ });
140
+
141
+ it('When the user unchecks \'Round negative score to zero\' checkbox and the user attempts the question incorrectly, then the user should be awarded with negative points', () => {
142
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
143
+ fillInTheGapsDropdownPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
144
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
145
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Seed' }]);
146
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(-4, 10.5);
147
+ });
148
+ });
149
+
150
+ describe('Question preview: Auto scored - Partial different weights: Penalty scoring with \'Round negative score to zero\' unchecked', () => {
151
+ abortEarlySetup();
152
+ before(() => {
153
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
154
+ cy.barsPreLoaderWait();
155
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
156
+ fillInTheGapsDropdownPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
157
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
158
+ fillInTheGapsDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 9, 1: 6, 2: 5 });
159
+ fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
160
+ });
161
+
162
+ //Penalty points for the entire question
163
+ it('When the user sets penalty scoring to \'Penalty points for the entire question\', allots penalty points and attempts the question incorrectly, then the user should be awarded with negative points', () => {
164
+ fillInTheGapsDropdownPage.steps.expandPenaltyScoringDropdown();
165
+ fillInTheGapsDropdownPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for the entire question');
166
+ fillInTheGapsDropdownPage.steps.uncheckRoundNegativeScoresToZeroCheckbox();
167
+ fillInTheGapsDropdownPage.steps.allotPenaltyPoints(4);
168
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
169
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Seed' }]);
170
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(-4, 20);
171
+ });
172
+
173
+ it('When the user attempts the question correctly along with an incorrect response, then penalty points should get deducted from the awarded points', () => {
174
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
175
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Seed' }]);
176
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 20);
177
+ });
178
+
179
+ it('When the user attempts the question correctly along with multiple incorrect responses, then penalty points should get deducted from the awarded points only once, the deducted penalty points should not increase as per number of attempted incorrect responses', () => {
180
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
181
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Seed' }, { responseIndex: 2, responseText: 'Branch' }]);
182
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(5, 20);
183
+ });
184
+
185
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
186
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
187
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
188
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
189
+ fillInTheGapsDropdownPage.steps.allotMinimumPoints(3);
190
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
191
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
192
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(3, 20);
193
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
194
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
195
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
196
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
197
+ });
198
+
199
+ //Penalty points for each incorrect dropdown - Specify total penalty points
200
+ it('When the user sets penalty scoring to \'Penalty points for each incorrect dropdown\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points of all the empty and incorrect dropdown', () => {
201
+ fillInTheGapsDropdownPage.steps.expandPenaltyScoringDropdown();
202
+ fillInTheGapsDropdownPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect dropdown');
203
+ fillInTheGapsDropdownPage.steps.allotTotalPenaltyPoints(4);
204
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
205
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
206
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(-3.99, 20);
207
+ });
208
+
209
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
210
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
211
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Roots' }]);
212
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(12.67, 20);
213
+ });
214
+
215
+ it('When the user attempts the question correctly along with multiple incorrect options, then Penalty points for each incorrect dropdown should get deducted from the awarded points', () => {
216
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
217
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Seed' }, { responseIndex: 2, responseText: 'Branch' }]);
218
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(12.67, 20);
219
+ });
220
+
221
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
222
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
223
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
224
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
225
+ fillInTheGapsDropdownPage.steps.allotMinimumPoints(3);
226
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
227
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
228
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(3, 20);
229
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
230
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
231
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
232
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
233
+ });
234
+
235
+ //Penalty points for each incorrect dropdown - Specify points for each incorrect dropdown
236
+ it('When the user has set penalty scoring to \'Penalty points for each incorrect dropdown\', and \'Specify total penalty points\' radio button in checked state, allots total penalty points and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropzone', () => {
237
+ fillInTheGapsDropdownPage.steps.selectOptionFromPenaltyScoringDropdown('Penalty points for each incorrect dropdown');
238
+ fillInTheGapsDropdownPage.steps.allotPenaltyPointsForEachIncorrectDropdown(4);
239
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
240
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
241
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(-12, 20);
242
+ });
243
+
244
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
245
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
246
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Roots' }]);
247
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(10, 20);
248
+ });
249
+
250
+ it('When the user attempts the question correctly along with multiple incorrect options, then Penalty points for each incorrect dropdown should get deducted from the awarded points', () => {
251
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
252
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Branch' }, { responseIndex: 2, responseText: 'Roots' }]);
253
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(1, 20);
254
+ });
255
+
256
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
257
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
258
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
259
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
260
+ fillInTheGapsDropdownPage.steps.allotMinimumPoints(3);
261
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
262
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
263
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(3, 20);
264
+ cy.log('Post step: Switching to edit tab and resetting minimum scoring to "No minimum score"')
265
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
266
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
267
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('No minimum score');
268
+ });
269
+
270
+ // Penalty points for each incorrect dropdown - Automatically set penalty for each incorrect dropdown to total points / no. of incorrect dropdown
271
+ it('When the user has set penalty scoring to \'Penalty points for each incorrect dropdown\', and checks \'Automatically set penalty for each incorrect dropdown to total points / no. of incorrect dropdown\' checkbox and attempts the question incorrectly, then the user should be awarded with negative points for the incorrect and empty dropzone', () => {
272
+ fillInTheGapsDropdownPage.steps.checkAutomaticallySetPenaltyPointsCheckbox();
273
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
274
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
275
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(-20.01, 20);
276
+ });
277
+
278
+ it('When the user attempts the question correctly along with an incorrect option, then penalty points should get deducted from the awarded points', () => {
279
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
280
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Roots' }]);
281
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(7.33, 20);
282
+ });
283
+
284
+ it('When the user attempts the question correctly along with multiple incorrect options, then penalty points for each incorrect option should get deducted from the awarded points', () => {
285
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
286
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Branch' }, { responseIndex: 2, responseText: 'Roots' }]);
287
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(-4.34, 20);
288
+ });
289
+
290
+ it('When the user has defined penalty points and also sets minimum scoring to \'Award minimum score only if attempted\' and allots minimum points, then on attempting the question incorrectly, minimum points should be awarded', () => {
291
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
292
+ fillInTheGapsDropdownPage.steps.expandMinimumScoringDropdown();
293
+ fillInTheGapsDropdownPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
294
+ fillInTheGapsDropdownPage.steps.allotMinimumPoints(3);
295
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
296
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
297
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(3, 20);
298
+ });
299
+ });
300
+ });
@@ -0,0 +1,232 @@
1
+ import { fillInTheGapsDropdownPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ const css = Cypress.env('css');
4
+
5
+ const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
6
+ const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
7
+ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answer
8
+ const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
9
+ const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
10
+ const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
11
+
12
+ describe('Create item page - Fill in the gaps with dropdown: Partial different weights', () => {
13
+ before(() => {
14
+ cy.loginAs('admin');
15
+ });
16
+
17
+ describe('Question preview: Auto scored - Partial different weight - When \'Correct answer\' points are equal to \'Alternative answer\' points', () => {
18
+ abortEarlySetup();
19
+ before(() => {
20
+ fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
21
+ cy.barsPreLoaderWait();
22
+ fillInTheGapsDropdownPage.steps.addResponseAreaInQuestionField();
23
+ fillInTheGapsDropdownPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
24
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
25
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
26
+ fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(2, optionsForDropdown3);
27
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
28
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
29
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, correctAnswerArray[2]);
30
+ fillInTheGapsDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 6, 1: 5, 2: 4 });
31
+ fillInTheGapsDropdownPage.steps.addAlternativeAnswerAccordion(1);
32
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
33
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
34
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, alternateAnswerArray[2]);
35
+ fillInTheGapsDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 7, 1: 5, 2: 3 });
36
+ fillInTheGapsDropdownPage.steps.checkAllowStudentToCheckAnswerCheckbox();
37
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
38
+ });
39
+
40
+ it('When the user selects \'Grading\' view without attempting the question, dropdown numeration, correct answers section with correct answers from the correct accordion and respective dropdown numeration should be displayed', () => {
41
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
42
+ fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
43
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
44
+ });
45
+
46
+ 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 dropdowns, correct/incorrect status message and correct answer section should not be displayed', () => {
47
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
48
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
49
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(15, 15);
50
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
51
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
52
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
53
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
54
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
55
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
56
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
57
+ 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 dropdowns, correct/incorrect status message and correct answer section should not be displayed')
58
+ fillInTheGapsDropdownPage.steps.checkAnswer();
59
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
60
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
61
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
62
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
63
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
64
+ });
65
+
66
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, correct/incorrect status message and correct answer section should not be displayed', () => {
67
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
68
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: alternateAnswerArray[2] }]);
69
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(15, 15);
70
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
71
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
72
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
73
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
74
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
75
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
76
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
77
+ 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 dropdowns, correct/incorrect status message and correct answer section should not be displayed')
78
+ fillInTheGapsDropdownPage.steps.checkAnswer();
79
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
80
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
81
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
82
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
83
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
84
+ });
85
+
86
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded points alloted to the responses and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
87
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
88
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
89
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(11, 15);
90
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
91
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
92
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
93
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
94
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
95
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
96
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
97
+ 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 dropdowns, correct/incorrect status message and correct answer section should not be displayed')
98
+ fillInTheGapsDropdownPage.steps.checkAnswer();
99
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
100
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
101
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
102
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
103
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
104
+ });
105
+
106
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
107
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
108
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }]);
109
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(7, 15);
110
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
111
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
112
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
113
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
114
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
115
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
116
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
117
+ 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 dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
118
+ fillInTheGapsDropdownPage.steps.checkAnswer();
119
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
120
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
121
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
122
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
123
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
124
+ });
125
+
126
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with points of the correctly attempted responses from the correct accordion as points achieved from the correct accordion is more tha alternative accordion and on switching to \'Grading\' view, correct icon icon should be displayed besides the correct dropdowns, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
127
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
128
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }]);
129
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(6, 15);
130
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
131
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
132
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
133
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
134
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
135
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
136
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
137
+ 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 dropdowns, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect status message and correct answer section should not be displayed')
138
+ fillInTheGapsDropdownPage.steps.checkAnswer();
139
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
140
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
141
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
142
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
143
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
144
+ });
145
+
146
+ it('When the user has attempted the question with equal number of correct responses from correct and alternative accordion, then the user should be awarded with points of the correctly attempted responses from the alternative accordion as points achieved from the alternative accordion is more than correct accordion and on switching to \'Grading\' view, correct icon icon should be displayed besides dropdown with alternative responses, incorrect icon should be displayed beside responses from the correct accordion, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
147
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
148
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
149
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(7, 15);
150
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
151
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
152
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
153
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
154
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
155
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
156
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
157
+ 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 alternative responses, incorrect icon should be displayed beside correct accordion responses, correct/incorrect status message and correct answer section should not be displayed')
158
+ fillInTheGapsDropdownPage.steps.checkAnswer();
159
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
160
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
161
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
162
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
163
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
164
+ });
165
+
166
+ it('Race condition : When the user attempts the question with the common response between correct and alternative accordion, then the user should be awarded with points from the accordion with maximum points alloted to the response and on switching to \'Grading\' view, correct icon icon should be besides the common response, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
167
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
168
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
169
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(4, 15);
170
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
171
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
172
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
173
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
174
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
175
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
176
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
177
+ cy.log('When the user has attempted the question with common response between correct and alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
178
+ fillInTheGapsDropdownPage.steps.checkAnswer();
179
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(0);
180
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(1);
181
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
182
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
183
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
184
+ });
185
+
186
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icon should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section with all correct answers from correct accordion along with dropdown numeration should be displayed', () => {
187
+ fillInTheGapsDropdownPage.steps.resetQuestionPreview();
188
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
189
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 15);
190
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
191
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
192
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
193
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
194
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
195
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
196
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
197
+ cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icon should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message and correct answer section should not be displayed')
198
+ fillInTheGapsDropdownPage.steps.checkAnswer();
199
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
200
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
201
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectIconNotExist(2);
202
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
203
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
204
+ });
205
+
206
+ it('Overachiever case: When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response selected from the correct accordion overpowers the combined score of the alternative accordion answers, then points awarded should be of the correct accordion and on switching to \'Grading\' view, correct icons should be displayed for the correct accordion response, incorrect icon should be displayed for the alternative accordion responses, correct/incorrect answer status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
207
+ cy.log('Pre-step: Switching to \'Edit\' tab and updating the correct answers such that there are no common answers across both the accordions and allotting points to alternate accordion such that the difference between the points is substantial')
208
+ fillInTheGapsDropdownPage.steps.switchToEditTab();
209
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(2, optionsForDropdown3[3]);
210
+ fillInTheGapsDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 4.1, 1: 5.4, 2: 5.5 });
211
+ fillInTheGapsDropdownPage.steps.expandCorrectAnswerAccordion();
212
+ fillInTheGapsDropdownPage.steps.allotPartialDifferentWeightsPoints({ 0: 1.2, 1: 1.2, 2: 12.6 });
213
+ fillInTheGapsDropdownPage.steps.switchToPreviewTab();
214
+ fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: alternateAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: alternateAnswerArray[1] }, { dropdownIndex: 2, dropdownOption: correctAnswerArray[2] }]);
215
+ fillInTheGapsDropdownPage.steps.verifyPreviewScore(12.6, 15);
216
+ fillInTheGapsDropdownPage.steps.switchToGradingView();
217
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
218
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
219
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
220
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
221
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
222
+ fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
223
+ cy.log('When the user attempts the question with more number of correct responses from the alternative accordion than the correct accordion but the score of the individual response selected from the correct accordion overpowers the combined score of the alternative accordion answers and clicks on \'Check answer\' button, then correct icons should be displayed for the correct accordion response, incorrect icon should be displayed for the alternative accordion responses, correct/incorrect status message and correct answer section should not be displayed')
224
+ fillInTheGapsDropdownPage.steps.checkAnswer();
225
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
226
+ fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
227
+ fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
228
+ fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
229
+ fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
230
+ });
231
+ });
232
+ });