itemengine-cypress-automation 1.0.120 → 1.0.122-updateILCRepo28Feb-2c3e0e3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/editTabBasicSection.js +13 -1
  2. package/cypress/e2e/ILC/AudioResponseNew/gradingViewAndCorrectAnswerViewContents.smoke.js +2 -0
  3. package/cypress/e2e/ILC/AudioResponseNew/previewContentsForAllViews.smoke.js +1 -0
  4. package/cypress/e2e/ILC/AudioResponseNew/standardRecorderStyle.smoke.js +2 -0
  5. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +1 -1
  6. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/clickAndDrop.js +2 -2
  7. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/studentViewSettings.js +1 -4
  8. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/Scoring/allOrNothingForAllViews.smoke.js +273 -0
  9. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/checkAnswerFunctionalityForAllViews.smoke.js +116 -0
  10. package/cypress/e2e/ILC/FillInTheGapsDragAndDropNew/previewContentsForAllViews.smoke.js +136 -0
  11. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +224 -0
  12. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/checkAnswerFunctionalityForAllViews.smoke.js +120 -0
  13. package/cypress/e2e/ILC/FillInTheGapsDropdownNew/previewContentsForAllViews.smoke.js +158 -0
  14. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/backgroundImageAndCanvasProperties.js +1 -1
  15. package/cypress/e2e/ILC/FillInTheGapsOverImageDragAndDrop/studentViewSettings.js +1 -4
  16. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownAndDropdownMenuSection.js +246 -0
  17. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/dropdownOptionsSection.js +332 -0
  18. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +409 -0
  19. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/headerSection.js +80 -0
  20. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/studentViewSettings.js +213 -0
  21. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/HeaderSection.js +1 -1
  22. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialDifferentWeightsBasic.js +2 -2
  23. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/Scoring/partialEqualWeightsBasic.js +1 -1
  24. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/allOrNothingForAllViews.smoke.js +2 -2
  25. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +68 -68
  26. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/editTabScoringSection.js +6 -6
  27. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/previewContentsForAllViews.smoke.js +1 -1
  28. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/setLimitSection.js +3 -289
  29. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specialCharactersSection.js +1 -1
  30. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/specifyCorrectAnswerSection.js +2 -2
  31. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/studentViewSettings.js +2 -23
  32. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +191 -0
  33. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +190 -0
  34. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +284 -0
  35. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/allOrNothingPenaltyScoring.js +52 -0
  36. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/manuallyAndNonScored.js +113 -0
  37. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +217 -0
  38. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsBasic.js +234 -0
  39. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +217 -0
  40. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +217 -0
  41. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsBasic.js +136 -0
  42. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +197 -0
  43. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +169 -0
  44. package/cypress/e2e/ILC/FillInTheGapsTextNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +197 -0
  45. package/cypress/e2e/ILC/FillInTheGapsTextNew/allOrNothingForAllViews.smoke.js +219 -0
  46. package/cypress/e2e/ILC/FillInTheGapsTextNew/checkAnswerFunctionalityForAllViews.smoke.js +115 -0
  47. package/cypress/e2e/ILC/FillInTheGapsTextNew/editTabBasicSection.js +142 -0
  48. package/cypress/e2e/ILC/FillInTheGapsTextNew/previewContentsForAllViews.smoke.js +152 -0
  49. package/cypress/e2e/ILC/FillInTheGapsTextNew/setLimitSection.js +39 -0
  50. package/cypress/e2e/ILC/MultipleSelection/studentViewSettings.js +2 -12
  51. package/cypress/e2e/ILC/ShortTextResponseNew/conditionalCheckboxes.js +497 -0
  52. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +503 -0
  53. package/cypress/e2e/ILC/ShortTextResponseNew/responseAnswersAndAcceptedStudentInput.js +233 -0
  54. package/cypress/e2e/ILC/ShortTextResponseNew/specialCharactersSection.js +291 -0
  55. package/cypress/e2e/ILC/ShortTextResponseNew/studentViewSettings.js +332 -0
  56. package/cypress/e2e/ILC/SingleSelection/studentViewSettings.js +2 -12
  57. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +9 -8
  58. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +4 -4
  59. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -2
  60. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +5 -2
  61. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +334 -0
  62. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +419 -0
  63. package/cypress/e2e/ILC/TextEntryMathWithImage/checkAnswerFunctionalityForAllViews.smoke.js +166 -0
  64. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +166 -0
  65. package/cypress/e2e/ILC/UploadResponse/editTabScoringSection.js +51 -0
  66. package/cypress/e2e/ILC/UploadResponse/gradingViewAndCorrectAnswerViewContents.smoke.js +99 -0
  67. package/cypress/e2e/ILC/UploadResponse/manuallyAndNonScoredScoring.js +71 -0
  68. package/cypress/e2e/ILC/UploadResponse/previewContentsForAllViews.smoke.js +155 -0
  69. package/cypress/e2e/ILC/UploadResponse/uploadResponseHeaderSection.js +66 -0
  70. package/cypress/fixtures/theme/ilc.json +3 -1
  71. package/cypress/pages/audioResponsePage.js +2 -1
  72. package/cypress/pages/components/additionalSettingsPanel.js +27 -0
  73. package/cypress/pages/components/autoScoredPreviewBase.js +1 -1
  74. package/cypress/pages/components/autoScoredScoringSection.js +1 -1
  75. package/cypress/pages/components/autoScoredScoringSectionMultipleResponsesType.js +1 -1
  76. package/cypress/pages/components/autoScoredSetCorrectAnswerSection.js +1 -1
  77. package/cypress/pages/components/autoScoredSpecifyCorrectAnswerSection.js +2 -2
  78. package/cypress/pages/components/autoScoredStudentViewSettings.js +8 -1
  79. package/cypress/pages/components/backgroundImageUploadComponent.js +5 -5
  80. package/cypress/pages/components/createQuestionBasePage.js +8 -2
  81. package/cypress/pages/components/essayResponseCommonComponents.js +6 -0
  82. package/cypress/pages/components/fillInTheGapsCommonComponents.js +13 -0
  83. package/cypress/pages/components/fillInTheGapsDragAndDropCommonComponents.js +40 -0
  84. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +422 -314
  85. package/cypress/pages/components/fillInTheGapsTextCommonComponent.js +438 -710
  86. package/cypress/pages/components/{figOverImageCanvasComponent.js → imageCanvasComponent.js} +274 -272
  87. package/cypress/pages/components/index.js +3 -3
  88. package/cypress/pages/components/maximumRecorderLengthComponent.js +55 -11
  89. package/cypress/pages/components/previewScoringAndShowCorrectAnswerComponent.js +1 -1
  90. package/cypress/pages/components/questionInputFieldComponent.js +49 -23
  91. package/cypress/pages/components/scoringSectionBase.js +1 -1
  92. package/cypress/pages/createItemPage.js +67 -2
  93. package/cypress/pages/fillInTheGapsDragAndDropPage.js +172 -711
  94. package/cypress/pages/fillInTheGapsDropdownPage.js +75 -72
  95. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +4 -4
  96. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +109 -273
  97. package/cypress/pages/fillInTheGapsOverImageTextPage.js +49 -291
  98. package/cypress/pages/fillInTheGapsTextPage.js +52 -199
  99. package/cypress/pages/index.js +5 -5
  100. package/cypress/pages/multipleSelectionPage.js +1 -0
  101. package/cypress/pages/shortTextResponsePage.js +575 -33
  102. package/cypress/pages/singleSelectionGridPage.js +1 -2
  103. package/cypress/pages/singleSelectionPage.js +5 -6
  104. package/cypress/pages/textEntryMathPage.js +46 -22
  105. package/cypress/pages/textEntryMathWithImagePage.js +212 -0
  106. package/cypress/pages/uploadResponsePage.js +74 -21
  107. package/package.json +2 -2
  108. package/cypress/e2e/ILC/AudioResponseNew/minimalRecorderStyle.js +0 -482
  109. package/cypress/e2e/ILC/EssayResponse/essayResponseEquationEditor.smoke.js +0 -412
  110. package/cypress/pages/components/figOverImageCommonComponent.js +0 -1113
  111. package/cypress/pages/dragAndDropIntoCategoriesAllOrNothingScoring.js +0 -1155
  112. package/cypress/pages/dragAndDropIntoCategoriesCellsScoring.js +0 -1561
  113. package/cypress/pages/dragAndDropIntoCategoriesResponseScoring.js +0 -1396
  114. package/cypress/pages/fillInTheGapsScoring.js +0 -5872
  115. package/cypress/pages/fillInTheGapsSetCorrectAnswerSection.js +0 -260
@@ -0,0 +1,217 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with text: Partial different weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial different weight - When \'Correct answer\' points are equal to \'Alternative answer\' points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
15
+ fillInTheGapsTextPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
16
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
17
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 6, 1: 5, 2: 4 });
18
+ fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
19
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
20
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 7, 1: 5, 2: 3 });
21
+ fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
22
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration, correct answers section with correct answers from the correct accordion and respective response area numeration should be displayed', () => {
26
+ fillInTheGapsTextPage.steps.switchToGradingView();
27
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
28
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
29
+ });
30
+
31
+ 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', () => {
32
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
33
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
34
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
35
+ fillInTheGapsTextPage.steps.switchToGradingView();
36
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
37
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
38
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
39
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
40
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
41
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
42
+ 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, correct/incorrect status message and correct answer section should not be displayed')
43
+ fillInTheGapsTextPage.steps.checkAnswer();
44
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
45
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
46
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
47
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
49
+ });
50
+
51
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points specified for alternative accordion (less than 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', () => {
52
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
53
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
54
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
55
+ fillInTheGapsTextPage.steps.switchToGradingView();
56
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
57
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
58
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
59
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
60
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
61
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
62
+ 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, correct/incorrect status message and correct answer section should not be displayed')
63
+ fillInTheGapsTextPage.steps.checkAnswer();
64
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
65
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
66
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
67
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
69
+ });
70
+
71
+ 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 answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
72
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
73
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
74
+ fillInTheGapsTextPage.steps.verifyPreviewScore(11, 15);
75
+ fillInTheGapsTextPage.steps.switchToGradingView();
76
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
77
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
78
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
79
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
80
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
81
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
82
+ 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, correct/incorrect status message and correct answer section should not be displayed')
83
+ fillInTheGapsTextPage.steps.checkAnswer();
84
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
85
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
86
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
87
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
89
+ });
90
+
91
+ 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 answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
92
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
93
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }]);
94
+ fillInTheGapsTextPage.steps.verifyPreviewScore(7, 15);
95
+ fillInTheGapsTextPage.steps.switchToGradingView();
96
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
97
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
98
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
99
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
100
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
101
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
102
+ 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 beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
103
+ fillInTheGapsTextPage.steps.checkAnswer();
104
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
105
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
106
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
107
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
109
+ });
110
+
111
+ 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 response field with correct answer responses, incorrect icon should be displayed beside responses from the alternative tab, correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
112
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
113
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaves' }]);
114
+ fillInTheGapsTextPage.steps.verifyPreviewScore(6, 15);
115
+ fillInTheGapsTextPage.steps.switchToGradingView();
116
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
117
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
118
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
119
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
120
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
121
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
122
+ 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 correct/incorrect status message and correct answer section should not be displayed')
123
+ fillInTheGapsTextPage.steps.checkAnswer();
124
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
125
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
126
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
127
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
129
+ });
130
+
131
+ 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 response field with alternative responses, incorrect icon should be displayed beside responses from the correct responses, correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
132
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
133
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaf' }]);
134
+ fillInTheGapsTextPage.steps.verifyPreviewScore(7, 15);
135
+ fillInTheGapsTextPage.steps.switchToGradingView();
136
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
137
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
138
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
139
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
140
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
141
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
142
+ 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')
143
+ fillInTheGapsTextPage.steps.checkAnswer();
144
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
145
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
146
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
147
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
148
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
149
+ });
150
+
151
+ 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 response, status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
152
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
153
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
154
+ fillInTheGapsTextPage.steps.verifyPreviewScore(4, 15);
155
+ fillInTheGapsTextPage.steps.switchToGradingView();
156
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
157
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
158
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
159
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
160
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
161
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
162
+ 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 answer responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
163
+ fillInTheGapsTextPage.steps.checkAnswer();
164
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
165
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
166
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
167
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
168
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
169
+ });
170
+
171
+ 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 responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section with all correct answers from correct accordion along with response area numeration should be displayed', () => {
172
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
173
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
174
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 15);
175
+ fillInTheGapsTextPage.steps.switchToGradingView();
176
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
177
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
178
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
179
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
180
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
181
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
182
+ 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 responses, no icon should be displayed beside unattempted response, correct/incorrect status message and correct answer section should not be displayed')
183
+ fillInTheGapsTextPage.steps.checkAnswer();
184
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
185
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
186
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
187
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
188
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
189
+ });
190
+
191
+ 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 response area numeration should be displayed', () => {
192
+ 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')
193
+ fillInTheGapsTextPage.steps.switchToEditTab();
194
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 2, responseText: 'Branch' }]);
195
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 4.1, 1: 5.4, 2: 5.5 });
196
+ fillInTheGapsTextPage.steps.expandCorrectAnswerAccordion();
197
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 12.6, 1: 1.2, 2: 1.2 });
198
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
199
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Branch' }]);
200
+ fillInTheGapsTextPage.steps.verifyPreviewScore(12.6, 15);
201
+ fillInTheGapsTextPage.steps.switchToGradingView();
202
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
203
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
204
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
205
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
206
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
207
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
208
+ 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 answer status message should not be displayed and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed')
209
+ fillInTheGapsTextPage.steps.checkAnswer();
210
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
211
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
212
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
213
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
214
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
215
+ });
216
+ });
217
+ });
@@ -0,0 +1,217 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with text: Partial different weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Question preview: Auto scored - Partial different weights - When \'Correct answer\' points are greater than \'Alternative answer\' points', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
15
+ fillInTheGapsTextPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
16
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
17
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 6, 1: 4, 2: 5 });
18
+ fillInTheGapsTextPage.steps.addAlternativeAnswerAccordion(1);
19
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
20
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 7, 1: 1, 2: 5 });
21
+ fillInTheGapsTextPage.steps.checkAllowStudentToCheckAnswerCheckbox();
22
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
23
+ });
24
+
25
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers from the correct accordion and respective response area numeration', () => {
26
+ fillInTheGapsTextPage.steps.switchToGradingView();
27
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
28
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
29
+ });
30
+
31
+ 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', () => {
32
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
33
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
34
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
35
+ fillInTheGapsTextPage.steps.switchToGradingView();
36
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
37
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
38
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
39
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
40
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
41
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
42
+ 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, correct/incorrect status message and correct answer section should not be displayed')
43
+ fillInTheGapsTextPage.steps.checkAnswer();
44
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
45
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
46
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
47
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
49
+ });
50
+
51
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with points specified for alternative accordion (less than 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', () => {
52
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
53
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
54
+ fillInTheGapsTextPage.steps.verifyPreviewScore(13, 15);
55
+ fillInTheGapsTextPage.steps.switchToGradingView();
56
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
57
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
58
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
59
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
60
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
61
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
62
+ 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, correct/incorrect status message and correct answer section should not be displayed')
63
+ fillInTheGapsTextPage.steps.checkAnswer();
64
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
65
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
66
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
67
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
68
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
69
+ });
70
+
71
+ it('When the user attempts the question with partially correct options exclusively from the correct accordion, then the user should be awarded with points of the correct responses and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
72
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
73
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }]);
74
+ fillInTheGapsTextPage.steps.verifyPreviewScore(10, 15);
75
+ fillInTheGapsTextPage.steps.switchToGradingView();
76
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
77
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
78
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
79
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
80
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
81
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
82
+ 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, correct/incorrect status message and correct answer section should not be displayed')
83
+ fillInTheGapsTextPage.steps.checkAnswer();
84
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
85
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
86
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
87
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
89
+ });
90
+
91
+ it('When the user attempts the question with partially correct options exclusively from the alternative accordion, then the user should be awarded with points of and on switching to \'Grading\' view, correct icon should be displayed besides the alternative answer responses, no icon should be displayed beside unattempted response correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
92
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
93
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }]);
94
+ fillInTheGapsTextPage.steps.verifyPreviewScore(7, 15);
95
+ fillInTheGapsTextPage.steps.switchToGradingView();
96
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
97
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
98
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
99
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
100
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
101
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
102
+ 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 beside unattempted response correct/incorrect status message and correct answer section should not be displayed')
103
+ fillInTheGapsTextPage.steps.checkAnswer();
104
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
105
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
106
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
107
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
108
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
109
+ });
110
+
111
+ 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 alternative accordion as points from the alternative accordion are more than the correct accordion and on switching to \'Grading\' view, correct icon icon should be displayed besides response field with alternative answer responses, incorrect icon should be displayed beside responses from the correct accordion, correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
112
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
113
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaf' }]);
114
+ fillInTheGapsTextPage.steps.verifyPreviewScore(7, 15);
115
+ fillInTheGapsTextPage.steps.switchToGradingView();
116
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
117
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
118
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
119
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
120
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
121
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
122
+ 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 should be displayed beside empty responses correct/incorrect status message and correct answer section should not be displayed')
123
+ fillInTheGapsTextPage.steps.checkAnswer();
124
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
125
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
126
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
127
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
129
+ });
130
+
131
+ 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 correct accordion as points from the correct accordion are more than the alternative accordion and on switching to \'Grading\' view, correct icon icon should be displayed besides response field with correct answer responses, incorrect icon should be displayed beside responses from the alternative accordion, correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
132
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
133
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaves' }]);
134
+ fillInTheGapsTextPage.steps.verifyPreviewScore(6, 15);
135
+ fillInTheGapsTextPage.steps.switchToGradingView();
136
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
137
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
138
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
139
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
140
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
141
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
142
+ 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 should be displayed beside empty responses correct/incorrect status message and correct answer section should not be displayed')
143
+ fillInTheGapsTextPage.steps.checkAnswer();
144
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
145
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
146
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
147
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
148
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
149
+ });
150
+
151
+ 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 of the accordion with more 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 response, \'Your answer is incorrect\' and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
152
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
153
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 2, responseText: 'Stem' }]);
154
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
155
+ fillInTheGapsTextPage.steps.switchToGradingView();
156
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
157
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
158
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
159
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
160
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
161
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
162
+ 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 answer responses, no icon should be displayed beside unattempted response correct/incorrect status message and correct answer section should not be displayed')
163
+ fillInTheGapsTextPage.steps.checkAnswer();
164
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(0);
165
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
166
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
167
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
168
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
169
+ });
170
+
171
+ 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 responses, no icon should be displayed beside unattempted response correct/incorrect status message and correct answer section with all correct answers from the correct accordion along with response area numeration should be displayed', () => {
172
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
173
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
174
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 15);
175
+ fillInTheGapsTextPage.steps.switchToGradingView();
176
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
177
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
178
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
179
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
180
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
181
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
182
+ 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 responses, no icon should be displayed beside unattempted response correct/incorrect status message and correct answer section should not be displayed')
183
+ fillInTheGapsTextPage.steps.checkAnswer();
184
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
185
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
186
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
187
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
188
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
189
+ });
190
+
191
+ 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 on switching to the \'Grading view\', then points awarded should be of the correct accordion, correct icon 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 response area numeration should be displayed', () => {
192
+ cy.log('Pre-step: Switching to Edit tab and allotting points to alternative accordion such that the difference between the points is substantial and the points per response are in decimal')
193
+ fillInTheGapsTextPage.steps.switchToEditTab();
194
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 2, responseText: 'Branch' }]);
195
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 1.2, 1: 2.2, 2: 1.6 });
196
+ fillInTheGapsTextPage.steps.expandCorrectAnswerAccordion();
197
+ fillInTheGapsTextPage.steps.allotPartialDifferentWeightsPoints({ 0: 11.4, 1: 1.2, 2: 10.4 });
198
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
199
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Petals' }, { responseIndex: 1, responseText: 'Leaves' }, { responseIndex: 2, responseText: 'Stem' }]);
200
+ fillInTheGapsTextPage.steps.verifyPreviewScore(10.4, 23);
201
+ fillInTheGapsTextPage.steps.switchToGradingView();
202
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
203
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
204
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
205
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
206
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
207
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
208
+ 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 the \'Check answer\' button, correct icon icons should be displayed for the correct accordion response, incorrect icon should be displayed for the alternative accordion responses, correct/incorrect answer status message and correct answer section should not be displayed')
209
+ fillInTheGapsTextPage.steps.checkAnswer();
210
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
211
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(1);
212
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
213
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
214
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
215
+ });
216
+ });
217
+ });
@@ -0,0 +1,136 @@
1
+ import { fillInTheGapsTextPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+
4
+ describe('Create item page - Fill in the gaps with text: Partial equal weights', () => {
5
+ before(() => {
6
+ cy.loginAs('admin');
7
+ });
8
+
9
+ describe('Auto scored - Partial equal weights', () => {
10
+ abortEarlySetup();
11
+ before(() => {
12
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
13
+ cy.barsPreLoaderWait();
14
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
15
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
16
+ fillInTheGapsTextPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
17
+ fillInTheGapsTextPage.steps.allotPoints(15);
18
+ fillInTheGapsTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
19
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
20
+ });
21
+
22
+ it('When the user selects \'Grading\' view without attempting the question, response area numeration should be displayed, correct answers section should be displayed with correct answers and respective response area numeration', () => {
23
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 15);
24
+ fillInTheGapsTextPage.steps.switchToGradingView();
25
+ fillInTheGapsTextPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
26
+ fillInTheGapsTextPage.steps.verifyResponseAreaNumeration();
27
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
28
+ });
29
+
30
+ 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, correct/incorrect status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
31
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
32
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 15);
33
+ fillInTheGapsTextPage.steps.switchToGradingView();
34
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
35
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
36
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
37
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
38
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
39
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
40
+ cy.log('When the user attempts the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect responses, correct/incorrect status message and correct answer section should not be displayed')
41
+ fillInTheGapsTextPage.steps.checkAnswer();
42
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(0);
43
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
44
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(2);
45
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
46
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
47
+ });
48
+
49
+ it('When the user attempts the question partially correct, 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 answer responses, incorrect icon should be displayed besides incorrect answer response, correct/incorrect status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
50
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
51
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 2, responseText: 'Roots' }]);
52
+ fillInTheGapsTextPage.steps.verifyPreviewScore(5, 15);
53
+ fillInTheGapsTextPage.steps.switchToGradingView();
54
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
55
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
56
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
57
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
58
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf', 'Stem']);
59
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
60
+ cy.log('When the user attempts the question partially correct and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, correct/incorrect status message and correct answer section should not be displayed')
61
+ fillInTheGapsTextPage.steps.checkAnswer();
62
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
63
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectIconNotExist(1);
64
+ fillInTheGapsTextPage.steps.verifyIncorrectOptionIcon(2);
65
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
66
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
67
+ });
68
+
69
+ it('When 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/incorrect status message and correct answer section should not be displayed', () => {
70
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
71
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
72
+ fillInTheGapsTextPage.steps.verifyPreviewScore(15, 15);
73
+ fillInTheGapsTextPage.steps.switchToGradingView();
74
+ fillInTheGapsTextPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
75
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
76
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
77
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
78
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
79
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
80
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
81
+ cy.log('When user clicks on Check answer button after he attempts the question correctly, then correct icon should be displayed besides the correct answer responses, correct/incorrect status message and correct answer section should not be displayed')
82
+ fillInTheGapsTextPage.steps.checkAnswer();
83
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(0);
84
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(1);
85
+ fillInTheGapsTextPage.steps.verifyCorrectOptionIcon(2);
86
+ fillInTheGapsTextPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
87
+ fillInTheGapsTextPage.steps.verifyCorrectAnswerSectionNotExists();
88
+ });
89
+ });
90
+
91
+ describe('Question preview: Auto scored - Partial equal weights: Minimum scoring', () => {
92
+ abortEarlySetup();
93
+ before(() => {
94
+ fillInTheGapsTextPage.steps.navigateToCreateQuestion('fill in the gaps with text');
95
+ cy.barsPreLoaderWait();
96
+ fillInTheGapsTextPage.steps.addResponseAreaInQuestionField();
97
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsSpecifyCorrectAnswerSection([{ responseIndex: 0, responseText: 'Flower' }, { responseIndex: 1, responseText: 'Leaf' }, { responseIndex: 2, responseText: 'Stem' }]);
98
+ fillInTheGapsTextPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
99
+ fillInTheGapsTextPage.steps.allotPoints(20);
100
+ fillInTheGapsTextPage.steps.checkAllowStudentsToCheckAnswerCheckbox();
101
+ });
102
+
103
+ 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', () => {
104
+ fillInTheGapsTextPage.steps.expandMinimumScoringDropdown();
105
+ fillInTheGapsTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
106
+ fillInTheGapsTextPage.steps.allotMinimumPoints(2);
107
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
108
+ fillInTheGapsTextPage.steps.switchToGradingView();
109
+ fillInTheGapsTextPage.steps.verifyPreviewScore(2, 20);
110
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
111
+ });
112
+
113
+ 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', () => {
114
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
115
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
116
+ fillInTheGapsTextPage.steps.verifyPreviewScore(2, 20);
117
+ });
118
+
119
+ 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', () => {
120
+ fillInTheGapsTextPage.steps.switchToEditTab();
121
+ fillInTheGapsTextPage.steps.expandMinimumScoringDropdown();
122
+ fillInTheGapsTextPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
123
+ fillInTheGapsTextPage.steps.allotMinimumPoints(2);
124
+ fillInTheGapsTextPage.steps.switchToPreviewTab();
125
+ fillInTheGapsTextPage.steps.switchToGradingView();
126
+ fillInTheGapsTextPage.steps.verifyPreviewScore(0, 20);
127
+ fillInTheGapsTextPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
128
+ });
129
+
130
+ 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', () => {
131
+ fillInTheGapsTextPage.steps.resetQuestionPreview();
132
+ fillInTheGapsTextPage.steps.enterTextInAnswerInputFieldsPreviewTab([{ responseIndex: 0, responseText: 'Roots' }]);
133
+ fillInTheGapsTextPage.steps.verifyPreviewScore(2, 20);
134
+ });
135
+ });
136
+ });