itemengine-cypress-automation 1.0.237 → 1.0.238

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/cypress/e2e/ILC/AudioResponseNew/studentViewSettings.js +3 -3
  2. package/cypress/e2e/ILC/ChartsBar/labelOptionsSection.js +2 -2
  3. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/Scoring/perDropzoneAlternativePointsGreaterThanCorrectPoints.js +2 -2
  4. package/cypress/e2e/ILC/DragAndDropIntoCategoriesNew/editTabBasicSection.js +14 -13
  5. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/additionalSettingsBasic.js +1 -1
  6. package/cypress/e2e/ILC/FillInTheGapsOverImageDropdownNew/editTabBasicSection.js +5 -3
  7. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/backgroundImageAndCanvasProperties.js +4 -2
  8. package/cypress/e2e/ILC/FillInTheGapsOverImageTextNew/styleAndLayoutCustomization.js +1 -1
  9. package/cypress/e2e/ILC/GridFill/allOrNothingBasicForAllViews.smoke.js +2 -2
  10. package/cypress/e2e/ILC/ImageHighlight/additionalSettingsBasic.js +2 -1
  11. package/cypress/e2e/ILC/ImageHighlight/customiseHighlightStyle.js +6 -3
  12. package/cypress/e2e/ILC/ImageHighlight/imageHighlightStyle.js +2 -1
  13. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +1 -1
  14. package/cypress/e2e/ILC/Matching/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +1 -1
  15. package/cypress/e2e/ILC/Matching/Scoring/partialDifferentWeightsScoringBasic.js +6 -6
  16. package/cypress/e2e/ILC/Matching/minimumScoringPenaltyPointsAndRoundingDropdown.js +8 -4
  17. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithAlternativePointsGreaterThanCorrectPoints.js +144 -0
  18. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsEqualToAlternativePoints.js +144 -0
  19. package/cypress/e2e/ILC/MatchingDropdown/Scoring/allOrNothingWithCorrectPointsGreaterThanAlternativePoints.js +214 -0
  20. package/cypress/e2e/ILC/MatchingDropdown/Scoring/manuallyAndNonScored.js +112 -0
  21. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsScoringBasic.js +397 -0
  22. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithAlternativePointsGreaterThanCorrectPoints.js +179 -0
  23. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternatePoints.js +158 -0
  24. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternatePoints.js +179 -0
  25. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsBasic.js +143 -0
  26. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +167 -0
  27. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +145 -0
  28. package/cypress/e2e/ILC/MatchingDropdown/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +166 -0
  29. package/cypress/e2e/ILC/NumberLine/additionalSettings.js +12 -10
  30. package/cypress/e2e/ILC/NumberLine/lineSettingsSection.js +3 -5
  31. package/cypress/e2e/ILC/NumberLine/verticalNumberLine/numberLineSection.js +3 -3
  32. package/cypress/e2e/ILC/NumberLineLabel/editTabBasicSection.js +2 -2
  33. package/cypress/e2e/ILC/NumberLineLabel/editTabScoring.js +2 -0
  34. package/cypress/e2e/ILC/ShortTextResponseNew/editTabBasicSections.js +1 -1
  35. package/cypress/e2e/ILC/SingleSelectionGridNew/editTabBasicSection.js +2 -1
  36. package/cypress/e2e/ILC/TextEntryMath/allOrNothingBasicForAllViews.smoke.js +6 -0
  37. package/cypress/e2e/ILC/TextEntryMath/editTabBasicSection.js +10 -2
  38. package/cypress/e2e/ILC/TextEntryMath/editTabScoringSection.js +13 -1
  39. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodEquivalentStructures.js +10 -0
  40. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchExact.js +2 -0
  41. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodMatchValue.js +2 -0
  42. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodSymbolsAreEquivalent.js +4 -2
  43. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodValueIsEquivalent.js +2 -0
  44. package/cypress/e2e/ILC/TextEntryMath/evaluationMethodsWithoutSetResponse.js +37 -5
  45. package/cypress/e2e/ILC/TextEntryMath/minimumScoringPenaltyPointsAndRoundingDropdown.js +6 -0
  46. package/cypress/e2e/ILC/TextEntryMath/previewContentsForAllViews.smoke.js +2 -0
  47. package/cypress/e2e/ILC/TextEntryMath/responseEvaluationMethodsAndCustomSettings.js +1 -0
  48. package/cypress/e2e/ILC/TextEntryMath/specifyCorrectAnswerSection.js +4 -5
  49. package/cypress/e2e/ILC/TextEntryMathWithImage/allOrNothingScoringForAllViews.smoke.js +6 -0
  50. package/cypress/e2e/ILC/TextEntryMathWithImage/backgroundImageAndCanvasProperties.js +4 -1
  51. package/cypress/e2e/ILC/TextEntryMathWithImage/previewTabContentsForAllViews.smoke.js +2 -0
  52. package/cypress/e2e/ILC/UploadResponse/uploadedFileProperties.js +1 -1
  53. package/cypress/pages/audioResponsePage.js +1 -0
  54. package/cypress/pages/components/createQuestionBasePage.js +49 -4
  55. package/cypress/pages/components/draggableOptionsStyleAndLayoutComponent.js +1 -1
  56. package/cypress/pages/components/figCommonStyleAndLayoutComponent.js +1 -1
  57. package/cypress/pages/components/fillInTheGapsDropdownCommonComponent.js +22 -0
  58. package/cypress/pages/components/gridQuestionCommonComponent.js +5 -2
  59. package/cypress/pages/components/imageCanvasComponent.js +6 -9
  60. package/cypress/pages/components/numberLineCommonComponent.js +6 -6
  61. package/cypress/pages/components/questionInstructionsComponent.js +3 -2
  62. package/cypress/pages/dragAndDropIntoCategoriesPage.js +2 -2
  63. package/cypress/pages/feedbackScalePage.js +1 -1
  64. package/cypress/pages/fillInTheGapsOverImageDragAndDropPage.js +0 -1
  65. package/cypress/pages/fillInTheGapsOverImageDropdownPage.js +2 -0
  66. package/cypress/pages/geoGebraActivityPage.js +13 -1
  67. package/cypress/pages/imageHighlightPage.js +1 -0
  68. package/cypress/pages/listOrderingPage.js +1 -1
  69. package/cypress/pages/matchingPage.js +21 -0
  70. package/cypress/pages/multipleSelectionGridPage.js +16 -0
  71. package/cypress/pages/numberLineLabelPage.js +16 -3
  72. package/cypress/pages/shortTextResponsePage.js +1 -0
  73. package/package.json +1 -1
  74. /package/cypress/e2e/ILC/NumberLineLabel/verticalNumberLine/{checkAnswerFunctionalityForAllViews.js → checkAnswerFunctionalityForAllViews.smoke.js} +0 -0
@@ -0,0 +1,158 @@
1
+ import { matchingPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
6
+ const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
7
+
8
+ describe('Create item page - Matching: Partial different weights', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Question preview: Auto scored - Partial different weights - When \'Correct answer\' points are equal to \'Alternative answer\' points', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ matchingPage.steps.navigateToCreateQuestion('matching');
17
+ cy.barsPreLoaderWait();
18
+ matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
19
+ matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
20
+ matchingPage.steps.addMultipleOptionFields(3);
21
+ matchingPage.steps.enterTextInPromptInputField(promptTextArray);
22
+ matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
23
+ matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
24
+ matchingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
25
+ matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 4, 1: 5, 2: 6 });
26
+ matchingPage.steps.addAlternativeAnswerAccordion(1);
27
+ matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
28
+ matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 3, 1: 5, 2: 7 });
29
+ matchingPage.steps.switchToPreviewTab();
30
+ });
31
+
32
+ it('When the user selects \'Grading\' view without attempting the question, dropzone numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective dropdown numeration', () => {
33
+ matchingPage.steps.switchToGradingView();
34
+ matchingPage.steps.verifyDropdownNumeration(0);
35
+ matchingPage.steps.verifyDropdownNumeration(1);
36
+ matchingPage.steps.verifyDropdownNumeration(2);
37
+ utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
38
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
39
+ });
40
+
41
+ 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, green check-marks should be displayed beside all the correct responses, a status message and correct answer section should not be displayed', () => {
42
+ matchingPage.steps.resetQuestionPreview();
43
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
44
+ matchingPage.steps.verifyPreviewScore(15, 15);
45
+ matchingPage.steps.switchToGradingView();
46
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
47
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
48
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
49
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
50
+ matchingPage.steps.verifyCorrectAnswerSectionNotExists();
51
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
52
+ });
53
+
54
+ it('When the user attempts the question with responses from the alternative accordion, then the user should be awarded with full points and on switching to \'Grading\' view, green check-marks should be displayed beside all the correct responses, a status message and correct answer section should not be displayed', () => {
55
+ matchingPage.steps.resetQuestionPreview();
56
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
57
+ matchingPage.steps.verifyPreviewScore(15, 15);
58
+ matchingPage.steps.switchToGradingView();
59
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
60
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
61
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
62
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
63
+ matchingPage.steps.verifyCorrectAnswerSectionNotExists();
64
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
65
+ });
66
+
67
+ 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, green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
68
+ matchingPage.steps.resetQuestionPreview();
69
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }]);
70
+ matchingPage.steps.verifyPreviewScore(9, 15);
71
+ matchingPage.steps.switchToGradingView();
72
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
73
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
74
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
75
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
76
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
77
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
78
+ });
79
+
80
+ 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, green check-mark should be displayed besides the alternative answer responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
81
+ matchingPage.steps.resetQuestionPreview();
82
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }]);
83
+ matchingPage.steps.verifyPreviewScore(8, 15);
84
+ matchingPage.steps.switchToGradingView();
85
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
86
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
87
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
88
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
89
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
90
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
91
+ });
92
+
93
+ it('When the user attempts the question partially correct with all the responses correct as per the alternative accordion but one response incomplete, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, green check-mark should be displayed besides the response from the correct accordion and alternative accordion and no icon should be displayed beside unattempted response, a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
94
+ matchingPage.steps.resetQuestionPreview();
95
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
96
+ matchingPage.steps.verifyPreviewScore(10, 15);
97
+ matchingPage.steps.switchToGradingView();
98
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
99
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
100
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
101
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
102
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
103
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
104
+ });
105
+
106
+ 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 tha correct accordion and on switching to \'Grading\' view, green check-mark icon should be displayed besides response field with alternative answer responses, red cross-mark icon should be displayed beside responses from the correct accordion, a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
107
+ matchingPage.steps.resetQuestionPreview();
108
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
109
+ matchingPage.steps.verifyPreviewScore(12, 15);
110
+ matchingPage.steps.switchToGradingView();
111
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
112
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
113
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
114
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
115
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
116
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
117
+ });
118
+
119
+ 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, green check-mark icon should be displayed besides response field with correct answer responses, red cross-mark icon should be displayed beside responses from the alternative tab, a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
120
+ matchingPage.steps.resetQuestionPreview();
121
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
122
+ matchingPage.steps.verifyPreviewScore(11, 15);
123
+ matchingPage.steps.switchToGradingView();
124
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
125
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
126
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
127
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
129
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
130
+ });
131
+
132
+ 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 tab with more points alloted to the response and on switching to \'Grading\' view, green check-mark 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 dropdown numeration should be displayed', () => {
133
+ matchingPage.steps.resetQuestionPreview();
134
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
135
+ matchingPage.steps.verifyPreviewScore(7, 15);
136
+ matchingPage.steps.switchToGradingView();
137
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
138
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
139
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
140
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
141
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
142
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
143
+ });
144
+
145
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, red cross-marks should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section with all correct answers along with dropdown numeration should be displayed', () => {
146
+ matchingPage.steps.resetQuestionPreview();
147
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
148
+ matchingPage.steps.verifyPreviewScore(0, 15);
149
+ matchingPage.steps.switchToGradingView();
150
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
151
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
152
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
153
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
154
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
155
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
156
+ });
157
+ });
158
+ });
@@ -0,0 +1,179 @@
1
+ import { matchingPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
6
+ const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
7
+
8
+ describe('Create item page - Matching: Partial different weights', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Question preview: Auto scored - Partial different weights - When \'Correct answer\' points are greater than \'Alternative answer\' points', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ matchingPage.steps.navigateToCreateQuestion('matching');
17
+ cy.barsPreLoaderWait();
18
+ matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
19
+ matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
20
+ matchingPage.steps.addMultipleOptionFields(3);
21
+ matchingPage.steps.enterTextInPromptInputField(promptTextArray);
22
+ matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
23
+ matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
24
+ matchingPage.steps.selectAutoScoredScoringSubtype('Partial different weights');
25
+ matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 4, 1: 5, 2: 6 });
26
+ matchingPage.steps.addAlternativeAnswerAccordion(1);
27
+ matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
28
+ matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 1, 1: 5, 2: 7 });
29
+ matchingPage.steps.switchToPreviewTab();
30
+ });
31
+
32
+ it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers from the correct accordion and respective dropdown numeration', () => {
33
+ matchingPage.steps.switchToGradingView();
34
+ matchingPage.steps.verifyDropdownNumeration(0);
35
+ matchingPage.steps.verifyDropdownNumeration(1);
36
+ matchingPage.steps.verifyDropdownNumeration(2);
37
+ utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
38
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
39
+ });
40
+
41
+ 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, green check-marks should be displayed beside all the correct responses, a status message and correct answer section should not be displayed', () => {
42
+ matchingPage.steps.resetQuestionPreview();
43
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
44
+ matchingPage.steps.verifyPreviewScore(15, 15);
45
+ matchingPage.steps.switchToGradingView();
46
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
47
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
48
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
49
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
50
+ matchingPage.steps.verifyCorrectAnswerSectionNotExists();
51
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
52
+ });
53
+
54
+ 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, green check-marks should be displayed beside all the correct responses, a status message and correct answer section should not be displayed', () => {
55
+ matchingPage.steps.resetQuestionPreview();
56
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
57
+ matchingPage.steps.verifyPreviewScore(13, 15);
58
+ matchingPage.steps.switchToGradingView();
59
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
60
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
61
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
62
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
63
+ matchingPage.steps.verifyCorrectAnswerSectionNotExists();
64
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
65
+ });
66
+
67
+ 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, green check-mark should be displayed besides the correct answer responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
68
+ matchingPage.steps.resetQuestionPreview();
69
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }]);
70
+ matchingPage.steps.verifyPreviewScore(9, 15);
71
+ matchingPage.steps.switchToGradingView();
72
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
73
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
74
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
75
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
76
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
77
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
78
+ });
79
+
80
+ 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, green check-mark should be displayed besides the alternative answer responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
81
+ matchingPage.steps.resetQuestionPreview();
82
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }]);
83
+ matchingPage.steps.verifyPreviewScore(6, 15);
84
+ matchingPage.steps.switchToGradingView();
85
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
86
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
87
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
88
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
89
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
90
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
91
+ });
92
+
93
+ it('When the user attempts the question partially correct with all the responses correct as per the alternative accordion but one response incomplete, then the user should be awarded points of the correctly attempted responses and on switching to \'Grading\' view, green check-mark should be displayed besides the response from the correct accordion and alternative accordion and no icon should be displayed beside unattempted response, a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
94
+ matchingPage.steps.resetQuestionPreview();
95
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
96
+ matchingPage.steps.verifyPreviewScore(8, 15);
97
+ matchingPage.steps.switchToGradingView();
98
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
99
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
100
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
101
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
102
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
103
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
104
+ });
105
+
106
+ 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 tha correct accordion and on switching to \'Grading\' view, green check-mark icon should be displayed besides response field with alternative answer responses, red cross-mark icon should be displayed beside responses from the correct accordion, a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
107
+ matchingPage.steps.resetQuestionPreview();
108
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
109
+ matchingPage.steps.verifyPreviewScore(12, 15);
110
+ matchingPage.steps.switchToGradingView();
111
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
112
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
113
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
114
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
115
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
116
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
117
+ });
118
+
119
+ 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, green check-mark icon should be displayed besides response field with correct answer responses, red cross-mark icon should be displayed beside responses from the alternative tab, a status message should not be displayed and correct answer section with all correct answers from the correct accordion along with dropdown numeration should be displayed', () => {
120
+ matchingPage.steps.resetQuestionPreview();
121
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
122
+ matchingPage.steps.verifyPreviewScore(11, 15);
123
+ matchingPage.steps.switchToGradingView();
124
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
125
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
126
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
127
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
128
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
129
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
130
+ });
131
+
132
+ 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 tab with more points alloted to the response and on switching to \'Grading\' view, green check-mark 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 dropdown numeration should be displayed', () => {
133
+ matchingPage.steps.resetQuestionPreview();
134
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
135
+ matchingPage.steps.verifyPreviewScore(7, 15);
136
+ matchingPage.steps.switchToGradingView();
137
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
138
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
139
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
140
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
141
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
142
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
143
+ });
144
+
145
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, red cross-marks should be displayed besides all incorrect responses, no icon should be displayed beside unattempted response a status message should not be displayed and correct answer section with all correct answers along with dropdown numeration should be displayed', () => {
146
+ matchingPage.steps.resetQuestionPreview();
147
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
148
+ matchingPage.steps.verifyPreviewScore(0, 15);
149
+ matchingPage.steps.switchToGradingView();
150
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
151
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
152
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
153
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
154
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
155
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
156
+ });
157
+
158
+ 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, green check-mark icons should be displayed for the correct accordion response, red cross-mark icon should be displayed for the alternative accordion responses, correct/incorrect answer label and its border should not be displayed and correct answer container should be displayed with correct accordion answers for the responses marked incorrect', () => {
159
+ 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')
160
+ matchingPage.steps.switchToEditTab();
161
+ matchingPage.steps.deleteAlternativeAnswerAccordion(0);
162
+ matchingPage.steps.addAlternativeAnswerAccordion(1);
163
+ matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
164
+ matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 1.2, 1: 2.2, 2: 1.6 });
165
+ matchingPage.steps.expandCorrectAnswerAccordion();
166
+ matchingPage.steps.allotPartialDifferentWeightsPoints({ 0: 11.4, 1: 1.2, 2: 10.4 });
167
+ matchingPage.steps.switchToPreviewTab();
168
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[5] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
169
+ matchingPage.steps.verifyPreviewScore(10.4, 23);
170
+ matchingPage.steps.switchToGradingView();
171
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
172
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(1);
173
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
174
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
175
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
176
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
177
+ });
178
+ });
179
+ });
@@ -0,0 +1,143 @@
1
+ import { matchingPage } from "../../../../pages";
2
+ import abortEarlySetup from "../../../../support/helpers/abortEarly";
3
+ import utilities from "../../../../support/helpers/utilities";
4
+ const css = Cypress.env('css');
5
+ const promptTextArray = ['Wild', 'Aquatic', 'Pet'];
6
+ const optionsArray = ['Cat', 'Elephant', 'Fish', 'Bear', 'Eagle', 'Penguin'];
7
+
8
+ describe('Create item page - Matching: Partial equal weights', () => {
9
+ before(() => {
10
+ cy.loginAs('admin');
11
+ });
12
+
13
+ describe('Auto scored - Partial equal weights', () => {
14
+ abortEarlySetup();
15
+ before(() => {
16
+ matchingPage.steps.navigateToCreateQuestion('matching');
17
+ cy.barsPreLoaderWait();
18
+ matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
19
+ matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
20
+ matchingPage.steps.addMultipleOptionFields(3);
21
+ matchingPage.steps.enterTextInPromptInputField(promptTextArray);
22
+ matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
23
+ matchingPage.steps.selectAutoScoredScoringSubtype('Partial equal weights');
24
+ matchingPage.steps.allotPoints(15);
25
+ matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
26
+ matchingPage.steps.switchToPreviewTab();
27
+ });
28
+
29
+ it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
30
+ matchingPage.steps.verifyPreviewScore(0, 15);
31
+ matchingPage.steps.switchToGradingView();
32
+ matchingPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
33
+ matchingPage.steps.verifyDropdownNumeration(0);
34
+ matchingPage.steps.verifyDropdownNumeration(1);
35
+ matchingPage.steps.verifyDropdownNumeration(2);
36
+ utilities.verifyInnerText(matchingPage.correctAnswersLabel(), 'Correct answers');
37
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
38
+ });
39
+
40
+ it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
41
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[4] }]);
42
+ matchingPage.steps.verifyPreviewScore(0, 15);
43
+ matchingPage.steps.switchToGradingView();
44
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(0);
45
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
46
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(2);
47
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
48
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
49
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
50
+ });
51
+
52
+ it('When the user attempts the question partially correct with some correct, some incomplete, some incorrect options, 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, a status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
53
+ matchingPage.steps.resetQuestionPreview();
54
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 2, dropdownOption: optionsArray[4] }]);
55
+ matchingPage.steps.verifyPreviewScore(5, 15);
56
+ matchingPage.steps.switchToGradingView();
57
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
58
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(1);
59
+ matchingPage.steps.verifyIncorrectOptionIconDropdown(2);
60
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
61
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
62
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
63
+ });
64
+
65
+ it('When the user attempts the question partially correct with all the dropzone correctly attempted but one dropzone incomplete, 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, a status message should not be displayed and correct answer section with all correct answers along with numeration should be displayed', () => {
66
+ matchingPage.steps.resetQuestionPreview();
67
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
68
+ matchingPage.steps.verifyPreviewScore(10, 15);
69
+ matchingPage.steps.switchToGradingView();
70
+ matchingPage.steps.verifyCorrectIncorrectIconNotExistDropdown(0);
71
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
72
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
73
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
74
+ matchingPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount([['Elephant'], ['Fish'], ['Cat']]);
75
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
76
+ });
77
+
78
+ 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 icon should be displayed besides the correct answer responses, a status message and correct answer section should not be displayed', () => {
79
+ matchingPage.steps.resetQuestionPreview();
80
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
81
+ matchingPage.steps.verifyPreviewScore(15, 15);
82
+ matchingPage.steps.switchToGradingView();
83
+ matchingPage.steps.verifyPreviewTabPointsBackgroundForCorrectAnswer();
84
+ matchingPage.steps.verifyCorrectOptionIconDropdown(0);
85
+ matchingPage.steps.verifyCorrectOptionIconDropdown(1);
86
+ matchingPage.steps.verifyCorrectOptionIconDropdown(2);
87
+ matchingPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
88
+ matchingPage.steps.verifyCorrectAnswerSectionNotExists();
89
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
90
+ });
91
+ });
92
+
93
+ describe('Question preview: Auto scored - Partial equal weights: Minimum scoring', () => {
94
+ abortEarlySetup();
95
+ before(() => {
96
+ matchingPage.steps.navigateToCreateQuestion('matching');
97
+ cy.barsPreLoaderWait();
98
+ matchingPage.steps.addTextInQuestionInstructionsInputField('Fill the categories with the right answer.');
99
+ matchingPage.steps.selectOptionLayoutToggleButton('Dropdown menu');
100
+ matchingPage.steps.addMultipleOptionFields(3);
101
+ matchingPage.steps.enterTextInPromptInputField(promptTextArray);
102
+ matchingPage.steps.enterTextInOptionInputFieldDropdown(optionsArray);
103
+ matchingPage.steps.selectResponseFromDropdownInSpecifyCorrectAnswerSection([{ dropdownIndex: 0, dropdownOption: optionsArray[1] }, { dropdownIndex: 1, dropdownOption: optionsArray[2] }, { dropdownIndex: 2, dropdownOption: optionsArray[0] }]);
104
+ matchingPage.steps.selectAutoScoredScoringSubtype('Partial equal weights')
105
+ matchingPage.steps.allotPoints(20);
106
+ });
107
+
108
+ 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', () => {
109
+ matchingPage.steps.expandMinimumScoringDropdown();
110
+ matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score');
111
+ matchingPage.steps.allotMinimumPoints(2);
112
+ matchingPage.steps.switchToPreviewTab();
113
+ matchingPage.steps.switchToGradingView();
114
+ matchingPage.steps.verifyPreviewScore(2, 20);
115
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
116
+ });
117
+
118
+ 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', () => {
119
+ matchingPage.steps.resetQuestionPreview();
120
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
121
+ matchingPage.steps.verifyPreviewScore(2, 20);
122
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
123
+ });
124
+
125
+ 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', () => {
126
+ matchingPage.steps.switchToEditTab();
127
+ matchingPage.steps.expandMinimumScoringDropdown();
128
+ matchingPage.steps.selectOptionFromMinimumScoringDropdown('Award minimum score only if attempted');
129
+ matchingPage.steps.allotMinimumPoints(2);
130
+ matchingPage.steps.expandAdditionalSettings();
131
+ matchingPage.steps.switchToPreviewTab();
132
+ matchingPage.steps.switchToGradingView();
133
+ matchingPage.steps.verifyPreviewScore(0, 20);
134
+ matchingPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
135
+ });
136
+
137
+ 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', () => {
138
+ matchingPage.steps.resetQuestionPreview();
139
+ matchingPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: optionsArray[3] }, { dropdownIndex: 1, dropdownOption: optionsArray[4] }, { dropdownIndex: 2, dropdownOption: optionsArray[2] }]);
140
+ matchingPage.steps.verifyPreviewScore(2, 20);
141
+ });
142
+ });
143
+ });