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,334 @@
1
+ import { textEntryMathWithImagePage, gradingViewPage, itemPreviewPage, studentViewPage, dialogBoxBase } from "../../../pages";
2
+ import { equationEditorFlyout } from "../../../pages/components";
3
+ import abortEarlySetup from "../../../support/helpers/abortEarly";
4
+ import utilities from "../../../support/helpers/utilities";
5
+ const grepTags = Cypress.env('grepTags');
6
+ let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
7
+ const views = utilities.getViews(correctAnswerViews);
8
+ var itemReferenceID = "";
9
+
10
+ describe('Create Item page - Text entry math: All or nothing ', () => {
11
+ before(() => {
12
+ cy.loginAs('admin');
13
+ });
14
+
15
+ if (!grepTags || !grepTags.includes('smoke')) {
16
+ describe('Question preview modes: Student view and Grading view', () => {
17
+ abortEarlySetup();
18
+ before(() => {
19
+ textEntryMathWithImagePage.steps.navigateToCreateQuestion('Text Entry Math');
20
+ cy.barsPreLoaderWait();
21
+ textEntryMathWithImagePage.steps.addBackground();
22
+ textEntryMathWithImagePage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
23
+ textEntryMathWithImagePage.steps.uploadFile('highlightImage.jpg');
24
+ textEntryMathWithImagePage.steps.verifyImageIsUploaded();
25
+ textEntryMathWithImagePage.steps.insertResponseArea(10);
26
+ textEntryMathWithImagePage.steps.insertResponseArea(40);
27
+ textEntryMathWithImagePage.steps.switchToPreviewTab();
28
+ });
29
+
30
+ textEntryMathWithImagePage.tests.verifyPreviewModesAndScoreWhenPointsAndCorrectAnswersIsNotSet();
31
+
32
+ it('When the user sets correct answer responses and allots points, then the alloted points should be displayed in the preview tab', () => {
33
+ textEntryMathWithImagePage.steps.switchToEditTab();
34
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
35
+ textEntryMathWithImagePage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
36
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
37
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
38
+ textEntryMathWithImagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
39
+ equationEditorFlyout.steps.enterQuadraticEquation();
40
+ textEntryMathWithImagePage.steps.allotPoints(20);
41
+ textEntryMathWithImagePage.steps.switchToPreviewTab();
42
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
43
+ });
44
+
45
+ it('When the user attempts question in preview tab and switches to edit tab, then on re-switching to the preview tab, users response should not persist', () => {
46
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
47
+ equationEditorFlyout.steps.enterTextInPreviewInputField(0, 'Correct answer 1');
48
+ equationEditorFlyout.steps.clickOnOkButton();
49
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
50
+ equationEditorFlyout.steps.enterQuadraticEquation();
51
+ textEntryMathWithImagePage.steps.resetQuestionPreview();
52
+ textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(0, '');
53
+ textEntryMathWithImagePage.steps.verifyResponseAreaTextContentPreviewTab(1, '');
54
+ });
55
+ });
56
+ };
57
+
58
+ //Failing due to https://redmine.zeuslearning.com/issues/561708, https://redmine.zeuslearning.com/issues/561177
59
+ views.forEach((view) => {
60
+ describe(`Text entry math: all or nothing scoring - ${view}`, { tags: 'smoke' }, () => {
61
+ abortEarlySetup();
62
+ before(() => {
63
+ switch (view) {
64
+ case 'Question preview':
65
+ textEntryMathWithImagePage.steps.navigateToCreateQuestion('Text Entry Math');
66
+ cy.barsPreLoaderWait();
67
+ textEntryMathWithImagePage.steps.addBackground();
68
+ textEntryMathWithImagePage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
69
+ textEntryMathWithImagePage.steps.uploadFile('highlightImage.jpg');
70
+ textEntryMathWithImagePage.steps.verifyImageIsUploaded();
71
+ textEntryMathWithImagePage.steps.insertResponseArea(10);
72
+ textEntryMathWithImagePage.steps.insertResponseArea(40);
73
+ textEntryMathWithImagePage.steps.insertResponseArea(80);
74
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
75
+ textEntryMathWithImagePage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
76
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
77
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
78
+ textEntryMathWithImagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
79
+ equationEditorFlyout.steps.enterQuadraticEquation();
80
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
81
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
82
+ textEntryMathWithImagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
83
+ equationEditorFlyout.steps.enterEquationUsingPiSymbol();
84
+ textEntryMathWithImagePage.steps.allotPoints(20);
85
+ textEntryMathWithImagePage.steps.switchToPreviewTab();
86
+ break;
87
+ case 'Item preview':
88
+ cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
89
+ itemPreviewPage.steps.switchToPreviewTab();
90
+ break;
91
+ case 'Grading view':
92
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
93
+ break;
94
+ }
95
+ });
96
+
97
+ beforeEach(() => {
98
+ switch (view) {
99
+ case 'Question preview':
100
+ textEntryMathWithImagePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
101
+ textEntryMathWithImagePage.steps.resetQuestionPreview();
102
+ break;
103
+ case 'Item preview':
104
+ itemPreviewPage.steps.switchToStudentView();
105
+ itemPreviewPage.steps.resetQuestionPreview();
106
+ break;
107
+ case 'Grading view':
108
+ cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
109
+ break;
110
+ }
111
+ });
112
+
113
+ if (view === 'Question preview') {
114
+ after(() => {
115
+ textEntryMathWithImagePage.steps.clickOnSaveQuestionButton();
116
+ utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
117
+ itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
118
+ });
119
+ };
120
+
121
+ it('When the user selects \'Grading\' view without attempting the question, correct/incorrect icons should not be displayed correct answers section should be displayed with the correct answers, correct answer label and border should not be displayed', () => {
122
+ if (view === 'Grading view') {
123
+ studentViewPage.steps.submitResponse();
124
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
125
+ studentViewPage.steps.clickOnGoToGradingViewButton();
126
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
127
+ }
128
+ if (view === 'Question preview' || view === 'Item preview') {
129
+ textEntryMathWithImagePage.steps.switchToGradingView();
130
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
131
+ }
132
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
133
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
134
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
135
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
136
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectIconNotExist(0);
137
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectIconNotExist(1);
138
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectIconNotExist(2);
139
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabelNotExist();
140
+ });
141
+
142
+ 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, and \'Your answer is incorrect\' label should be displayed', () => {
143
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
144
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 1');
145
+ equationEditorFlyout.steps.clickOnOkButton();
146
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
147
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 2');
148
+ equationEditorFlyout.steps.clickOnOkButton();
149
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
150
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 3');
151
+ equationEditorFlyout.steps.clickOnOkButton();
152
+ if (view === 'Grading view') {
153
+ studentViewPage.steps.submitResponse();
154
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
155
+ studentViewPage.steps.clickOnGoToGradingViewButton();
156
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
157
+ }
158
+ if (view === 'Question preview' || view === 'Item preview') {
159
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
160
+ textEntryMathWithImagePage.steps.switchToGradingView();
161
+ }
162
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(0);
163
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(1);
164
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(2);
165
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
166
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
167
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
168
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
169
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
170
+ });
171
+
172
+ it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icons should be displayed besides the correct responses, incorrect icons should be displayed beside the incorrect responses, and \'Your answer is incorrect\' label should be displayed', () => {
173
+ if (view === 'Grading view') {
174
+ studentViewPage.steps.clearResponses();
175
+ }
176
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
177
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
178
+ equationEditorFlyout.steps.clickOnOkButton();
179
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
180
+ equationEditorFlyout.steps.enterQuadraticEquation();
181
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
182
+ equationEditorFlyout.steps.enterTextInPreviewInputField('6*3.14');
183
+ equationEditorFlyout.steps.clickOnOkButton();
184
+ if (view === 'Grading view') {
185
+ studentViewPage.steps.submitResponse();
186
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
187
+ studentViewPage.steps.clickOnGoToGradingViewButton();
188
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
189
+ }
190
+ if (view === 'Question preview' || view === 'Item preview') {
191
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
192
+ textEntryMathWithImagePage.steps.switchToGradingView();
193
+ }
194
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(0);
195
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(1);
196
+ textEntryMathWithImagePage.steps.verifyIncorrectResponseIcon(2);
197
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
198
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
199
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
200
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
201
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
202
+ });
203
+
204
+ it('When the user attempts the question partially correct with a incomplete response, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icons should be displayed besides the correct responses and unattempted correct options, no icon should be displayed beside unattempted response, \'Your answer is incorrect\' should be displayed', () => {
205
+ if (view === 'Grading view') {
206
+ studentViewPage.steps.clearResponses();
207
+ }
208
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
209
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
210
+ equationEditorFlyout.steps.clickOnOkButton();
211
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
212
+ equationEditorFlyout.steps.enterQuadraticEquation();
213
+ if (view === 'Grading view') {
214
+ studentViewPage.steps.submitResponse();
215
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'exist');
216
+ studentViewPage.steps.clickOnGoToGradingViewButton();
217
+ gradingViewPage.steps.verifyGradingViewScore(0, 20);
218
+ }
219
+ if (view === 'Question preview' || view === 'Item preview') {
220
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
221
+ textEntryMathWithImagePage.steps.switchToGradingView();
222
+ }
223
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(0);
224
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(1);
225
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectIconNotExist(2);
226
+ textEntryMathWithImagePage.steps.verifyResponseFieldNumerationPreviewTab();
227
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Correct answer 1', '2x2y2+4xy+4', '6×π']);
228
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(1, '2 x squared y squared plus 4 x y plus 4');
229
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerResponsesAriaLabel(2, '6 times pi');
230
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
231
+ });
232
+
233
+ 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, and \'Your answer is correct\' should be displayed', () => {
234
+ if (view === 'Grading view') {
235
+ studentViewPage.steps.clearResponses();
236
+ }
237
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
238
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Correct answer 1');
239
+ equationEditorFlyout.steps.clickOnOkButton();
240
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
241
+ equationEditorFlyout.steps.enterQuadraticEquation();
242
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(2);
243
+ equationEditorFlyout.steps.enterEquationUsingPiSymbol();
244
+ if (view === 'Grading view') {
245
+ studentViewPage.steps.submitResponse();
246
+ utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
247
+ studentViewPage.steps.clickOnGoToGradingViewButton();
248
+ gradingViewPage.steps.verifyGradingViewScore(20, 20);
249
+ }
250
+ if (view === 'Question preview' || view === 'Item preview') {
251
+ textEntryMathWithImagePage.steps.verifyPreviewScore(20, 20);
252
+ textEntryMathWithImagePage.steps.switchToGradingView();
253
+ }
254
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(0);
255
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(1);
256
+ textEntryMathWithImagePage.steps.verifyCorrectResponseIcon(2);
257
+ textEntryMathWithImagePage.steps.verifyCorrectIncorrectAnswerLabel('correct');
258
+ textEntryMathWithImagePage.steps.verifyCorrectAnswerSectionNotExists();
259
+ });
260
+ });
261
+ });
262
+
263
+ if (!grepTags || !grepTags.includes('smoke')) {
264
+ describe('Question preview: Auto scored - All or nothing: Minimum scoring', () => {
265
+ abortEarlySetup();
266
+ before(() => {
267
+ textEntryMathWithImagePage.steps.navigateToCreateQuestion('Text Entry Math');
268
+ cy.barsPreLoaderWait();
269
+ textEntryMathWithImagePage.steps.addBackground();
270
+ textEntryMathWithImagePage.steps.addTextInQuestionInstructionsInputField('Enter the correct answer in the response field');
271
+ textEntryMathWithImagePage.steps.uploadFile('highlightImage.jpg');
272
+ textEntryMathWithImagePage.steps.verifyImageIsUploaded();
273
+ textEntryMathWithImagePage.steps.insertResponseArea(10);
274
+ textEntryMathWithImagePage.steps.insertResponseArea(40);
275
+ textEntryMathWithImagePage.steps.insertResponseArea(80);
276
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(0);
277
+ textEntryMathWithImagePage.steps.addInputToResponseAnswerInputFieldSpecifyCorrectAnswer(0, 'Correct answer 1');
278
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(1);
279
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(1);
280
+ textEntryMathWithImagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
281
+ equationEditorFlyout.steps.enterQuadraticEquation();
282
+ textEntryMathWithImagePage.steps.expandResponseAccordionSpecifyCorrectAnswer(2);
283
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldSpecifyCorrectAnswerSection(2);
284
+ textEntryMathWithImagePage.steps.selectEquationEditorOptionFromCKEditorToolbar();
285
+ equationEditorFlyout.steps.enterEquationUsingPiSymbol();
286
+ textEntryMathWithImagePage.steps.allotPoints(20);
287
+ });
288
+
289
+ 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', () => {
290
+ textEntryMathWithImagePage.steps.expandMinimumScoringDropdown();
291
+ textEntryMathWithImagePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
292
+ textEntryMathWithImagePage.steps.allotMinimumPoints(2);
293
+ textEntryMathWithImagePage.steps.switchToPreviewTab();
294
+ textEntryMathWithImagePage.steps.switchToGradingView();
295
+ textEntryMathWithImagePage.steps.verifyPreviewScore(2, 20);
296
+ textEntryMathWithImagePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
297
+ });
298
+
299
+ 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', () => {
300
+ textEntryMathWithImagePage.steps.resetQuestionPreview();
301
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
302
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 1');
303
+ equationEditorFlyout.steps.clickOnOkButton();
304
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
305
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 2');
306
+ equationEditorFlyout.steps.clickOnOkButton();
307
+ textEntryMathWithImagePage.steps.verifyPreviewScore(2, 20);
308
+ textEntryMathWithImagePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
309
+ });
310
+
311
+ 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', () => {
312
+ textEntryMathWithImagePage.steps.switchToEditTab();
313
+ textEntryMathWithImagePage.steps.expandMinimumScoringDropdown();
314
+ textEntryMathWithImagePage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
315
+ textEntryMathWithImagePage.steps.allotMinimumPoints(2);
316
+ textEntryMathWithImagePage.steps.switchToPreviewTab();
317
+ textEntryMathWithImagePage.steps.switchToGradingView();
318
+ textEntryMathWithImagePage.steps.verifyPreviewScore(0, 20);
319
+ textEntryMathWithImagePage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
320
+ });
321
+
322
+ 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', () => {
323
+ textEntryMathWithImagePage.steps.resetQuestionPreview();
324
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(0);
325
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 1');
326
+ equationEditorFlyout.steps.clickOnOkButton();
327
+ textEntryMathWithImagePage.steps.focusInResponseAnswerInputFieldPreviewTab(1);
328
+ equationEditorFlyout.steps.enterTextInPreviewInputField('Incorrect answer 2');
329
+ equationEditorFlyout.steps.clickOnOkButton();
330
+ textEntryMathWithImagePage.steps.verifyPreviewScore(2, 20);
331
+ });
332
+ });
333
+ };
334
+ });