itemengine-cypress-automation 1.0.579-IEI-7193-main-6a7df51.0 → 1.0.580-IEI-7040-1e744fc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsEqualToAlternativePoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/allOrNothingCorrectPointsGreaterThanAlternativePoints.js +136 -9
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/checkScoringLabelBannerAndCorrectAnswer.js +7 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsAlternativePointsGreaterThanCorrectPoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsEqualToAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialDifferentWeightsWithCorrectPointsGreaterThanAlternativePoints.js +154 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithAlternativePointsGreaterThanCorrectPoints.js +135 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsEqualToAlternativePoints.js +116 -7
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/partialEqualWeightsWithCorrectPointsGreaterThanAlternativePoints.js +136 -8
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/responseLevelAlternateAnswerBasicScoring.js +21 -2
- package/cypress/e2e/ILC/FillInTheGapsDropdownNew/allOrNothingForAllView.smoke.js +190 -2
- package/cypress/e2e/ILC/dataApi/fetchQuestion.js +0 -39
- package/cypress/e2e/ILC/dataApi/saveQuestions.js +0 -53
- package/cypress/pages/fillInTheGapsDropdownPage.js +47 -2
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { fillInTheGapsDropdownPage } from "../../../../pages";
|
|
|
2
2
|
import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
3
3
|
import utilities from "../../../../support/helpers/utilities";
|
|
4
4
|
const css = Cypress.env('css');
|
|
5
|
+
import { showAlternativeAnswersComponent } from "../../../../pages/components";
|
|
5
6
|
|
|
6
7
|
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
|
7
8
|
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
|
@@ -9,6 +10,7 @@ const optionsForDropdown3 = ['Flower', 'Leaf', 'Stem', 'Roots']; //Common answe
|
|
|
9
10
|
const correctAnswerArray = ['Flower', 'Leaf', 'Stem'];
|
|
10
11
|
const alternateAnswerArray = ['Petal', 'Leaves', 'Stem'];
|
|
11
12
|
const incorrectAnswerArray = ['Branch', 'Seed', 'Roots'];
|
|
13
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
12
14
|
|
|
13
15
|
describe('Create item page - Fill in the gaps with dropdown: Partial equal weights with alternative answers', () => {
|
|
14
16
|
before(() => {
|
|
@@ -41,8 +43,26 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
41
43
|
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', () => {
|
|
42
44
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
43
45
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
if (alternativeAnswerCheck) {
|
|
47
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
48
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
49
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
50
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
51
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
52
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
53
|
+
{
|
|
54
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
55
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
59
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
60
|
+
}
|
|
61
|
+
]);
|
|
62
|
+
} else {
|
|
63
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
64
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
65
|
+
}
|
|
46
66
|
});
|
|
47
67
|
|
|
48
68
|
it('When the user attempts the question with responses from the correct accordion, then the user should be awarded full points and on switching to \'Grading\' view, correct icons should be displayed beside all the correct dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed', () => {
|
|
@@ -94,7 +114,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
94
114
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
95
115
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
96
116
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
97
|
-
|
|
117
|
+
if (alternativeAnswerCheck) {
|
|
118
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
119
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
120
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
121
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
122
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
123
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
124
|
+
{
|
|
125
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
126
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
130
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
131
|
+
}
|
|
132
|
+
]);
|
|
133
|
+
} else {
|
|
134
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
135
|
+
}
|
|
98
136
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
99
137
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the correct accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
|
|
100
138
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -114,7 +152,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
114
152
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
115
153
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
116
154
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
117
|
-
|
|
155
|
+
if (alternativeAnswerCheck) {
|
|
156
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
157
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
158
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
159
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
160
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
161
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
162
|
+
{
|
|
163
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
164
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
168
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
169
|
+
}
|
|
170
|
+
]);
|
|
171
|
+
} else {
|
|
172
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
173
|
+
}
|
|
118
174
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
119
175
|
/*cy.log('When the user has attempted the question with partially correct options exclusively from the alternative accordion and clicks on \'Check answer\' button, then correct icon should be displayed besides the correct dropdowns, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section should not be displayed');
|
|
120
176
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -134,7 +190,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
134
190
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
135
191
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
136
192
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
137
|
-
|
|
193
|
+
if (alternativeAnswerCheck) {
|
|
194
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
195
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
196
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
197
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
198
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
199
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
200
|
+
{
|
|
201
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
202
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
206
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
207
|
+
}
|
|
208
|
+
]);
|
|
209
|
+
} else {
|
|
210
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
211
|
+
}
|
|
138
212
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
139
213
|
/*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, correct icon should be displayed besides the correctly answered dropdowns, incorrect icon should be displayed beside alternative accordion responses, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
140
214
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -154,7 +228,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
154
228
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
155
229
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
156
230
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
157
|
-
|
|
231
|
+
if (alternativeAnswerCheck) {
|
|
232
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
233
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
234
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
235
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
236
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
237
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
238
|
+
{
|
|
239
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
240
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
244
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
245
|
+
}
|
|
246
|
+
]);
|
|
247
|
+
} else {
|
|
248
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
249
|
+
}
|
|
158
250
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
159
251
|
/*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 correctly answered dropdown, no icon should be displayed beside unattempted dropdown, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
160
252
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -174,7 +266,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
174
266
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
175
267
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(2);
|
|
176
268
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
177
|
-
|
|
269
|
+
if (alternativeAnswerCheck) {
|
|
270
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
271
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
272
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
273
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
274
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
275
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
276
|
+
{
|
|
277
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
278
|
+
points: ['(15 points)', '(5 points)', '(5 points)', '(5 points)'],
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
correctAnswers: [['Petal'],['Leaves'],['Stem']],
|
|
282
|
+
points: ['(9 points)', '(3 points)', '(3 points)', '(3 points)'],
|
|
283
|
+
}
|
|
284
|
+
]);
|
|
285
|
+
} else {
|
|
286
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
287
|
+
}
|
|
178
288
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
179
289
|
/*cy.log('When the user has attempted the question incorrectly and clicks on \'Check answer\' button, then incorrect icons should be displayed besides all incorrect dropdowns, no icon should be displayed beside unattempted dropdowns, correct/incorrect status message should not be displayed and correct answer section should not be displayed')
|
|
180
290
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
|
@@ -200,7 +310,25 @@ describe('Create item page - Fill in the gaps with dropdown: Partial equal weigh
|
|
|
200
310
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
201
311
|
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(2);
|
|
202
312
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
203
|
-
|
|
313
|
+
if (alternativeAnswerCheck) {
|
|
314
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
315
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
316
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
317
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
318
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
319
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
320
|
+
{
|
|
321
|
+
correctAnswers: [['Flower'],['Leaf'],['Stem']],
|
|
322
|
+
points: ['(23 points)', '(7.67 points)', '(7.67 points)', '(7.67 points)'],
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
correctAnswers: [['Petal'],['Leaves'],['Roots']],
|
|
326
|
+
points: ['(5 points)', '(1.67 points)', '(1.67 points)', '(1.67 points)'],
|
|
327
|
+
}
|
|
328
|
+
]);
|
|
329
|
+
} else {
|
|
330
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
331
|
+
}
|
|
204
332
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
205
333
|
/*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 from the correct accordion overpowers the combined score of the alternative accordion answers and clicks on the \'Check answer\' button, correct icons should be displayed beside correct accordion responses, incorrect icons should be displayed beside alternative accordion responses, correct/incorrect answer label, correct answer container should not be displayed')
|
|
206
334
|
fillInTheGapsDropdownPage.steps.checkAnswer();
|
package/cypress/e2e/ILC/FillInTheGapsDropdownNew/Scoring/responseLevelAlternateAnswerBasicScoring.js
CHANGED
|
@@ -4,6 +4,7 @@ import abortEarlySetup from "../../../../support/helpers/abortEarly";
|
|
|
4
4
|
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
|
5
5
|
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
|
6
6
|
const correctAnswerArray = ['Flower', 'Leaf', 'Stem', 'Petal', 'Leaves'];
|
|
7
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
7
8
|
|
|
8
9
|
describe('Create item page - Fill in the gaps with drop down: Response level alternate answer basic scoring', () => {
|
|
9
10
|
before(() => {
|
|
@@ -33,7 +34,16 @@ describe('Create item page - Fill in the gaps with drop down: Response level alt
|
|
|
33
34
|
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 10);
|
|
34
35
|
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
35
36
|
fillInTheGapsDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
36
|
-
|
|
37
|
+
if (alternativeAnswerCheck) {
|
|
38
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
39
|
+
{
|
|
40
|
+
correctAnswers: [['Flower', 'Petal'], ['Leaf', 'Leaves']],
|
|
41
|
+
points: ['(10 points)'],
|
|
42
|
+
}
|
|
43
|
+
]);
|
|
44
|
+
} else {
|
|
45
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf']);
|
|
46
|
+
}
|
|
37
47
|
});
|
|
38
48
|
|
|
39
49
|
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 the incorrect response, a status message with text \'Your answer is incorrect\' and correct answers section should be displayed with the first correct answer set for the dropdown in specify correct answer section', () => {
|
|
@@ -44,7 +54,16 @@ describe('Create item page - Fill in the gaps with drop down: Response level alt
|
|
|
44
54
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
|
45
55
|
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
46
56
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
47
|
-
|
|
57
|
+
if (alternativeAnswerCheck) {
|
|
58
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
59
|
+
{
|
|
60
|
+
correctAnswers: [['Flower', 'Petal'], ['Leaf', 'Leaves']],
|
|
61
|
+
points: ['(10 points)'],
|
|
62
|
+
}
|
|
63
|
+
]);
|
|
64
|
+
} else {
|
|
65
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(['Flower', 'Leaf']);
|
|
66
|
+
}
|
|
48
67
|
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
49
68
|
});
|
|
50
69
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { dialogBoxBase, fillInTheGapsDropdownPage, gradingViewPage, itemPreviewPage, studentViewPage } from "../../../pages";
|
|
2
2
|
import abortEarlySetup from "../../../support/helpers/abortEarly";
|
|
3
3
|
import utilities from "../../../support/helpers/utilities";
|
|
4
|
+
import { showAlternativeAnswersComponent } from "../../../pages/components";
|
|
4
5
|
const grepTags = Cypress.env('grepTags');
|
|
5
6
|
let correctAnswerViews = ['Question preview', 'Item preview', 'Grading view'];
|
|
6
7
|
const views = utilities.getViews(correctAnswerViews);
|
|
7
8
|
var itemReferenceID = "";
|
|
9
|
+
const alternativeAnswerCheck = Cypress.env('ENABLE_ALTERNATIVE_ANSWER_ENHANCEMENT') === 'true';
|
|
8
10
|
|
|
9
11
|
const optionsForDropdown1 = ['Flower', 'Petal', 'Stem', 'Branch'];
|
|
10
12
|
const optionsForDropdown2 = ['Leaf', 'Leaves', 'Stem', 'Seed'];
|
|
11
13
|
const correctAnswerArray = ['Flower', 'Leaf'];
|
|
14
|
+
const alternateAnswerArray = ['Petal', 'Leaves'];
|
|
12
15
|
const incorrectAnswerArray = ['Branch', 'Seed'];
|
|
13
16
|
|
|
14
17
|
describe('Create item page - Fill in the gaps with dropdown: All or nothing ', () => {
|
|
@@ -107,7 +110,11 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing ', (
|
|
|
107
110
|
fillInTheGapsDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
108
111
|
};
|
|
109
112
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
110
|
-
|
|
113
|
+
if (alternativeAnswerCheck) {
|
|
114
|
+
showAlternativeAnswersComponent.steps.verifyCorrectAnswersLabelAndPointVisible('(20 points)');
|
|
115
|
+
} else {
|
|
116
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
117
|
+
}
|
|
111
118
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
112
119
|
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
113
120
|
});
|
|
@@ -174,6 +181,183 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing ', (
|
|
|
174
181
|
});
|
|
175
182
|
});
|
|
176
183
|
|
|
184
|
+
if (alternativeAnswerCheck) {
|
|
185
|
+
views.forEach((view) => {
|
|
186
|
+
describe(`${view}: Auto scored - All or nothing scoring with alternate answers`, { tags: 'smoke' }, () => {
|
|
187
|
+
abortEarlySetup();
|
|
188
|
+
before(() => {
|
|
189
|
+
switch (view) {
|
|
190
|
+
case 'Question preview':
|
|
191
|
+
fillInTheGapsDropdownPage.steps.navigateToCreateQuestion('fill in the gaps with dropdown');
|
|
192
|
+
cy.barsPreLoaderWait();
|
|
193
|
+
fillInTheGapsDropdownPage.steps.addTextInQuestionInstructionsInputField('Fill in the gaps');
|
|
194
|
+
fillInTheGapsDropdownPage.steps.allotPoints(20);
|
|
195
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(0, optionsForDropdown1);
|
|
196
|
+
fillInTheGapsDropdownPage.steps.addInputToDropdownOptionFields(1, optionsForDropdown2);
|
|
197
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, correctAnswerArray[0]);
|
|
198
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, correctAnswerArray[1]);
|
|
199
|
+
fillInTheGapsDropdownPage.steps.addAlternativeAnswerAccordion(1);
|
|
200
|
+
fillInTheGapsDropdownPage.steps.allotPoints(10);
|
|
201
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(0, alternateAnswerArray[0]);
|
|
202
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownSpecifyCorrectAnswerSection(1, alternateAnswerArray[1]);
|
|
203
|
+
fillInTheGapsDropdownPage.steps.switchToPreviewTab();
|
|
204
|
+
break;
|
|
205
|
+
case 'Item preview':
|
|
206
|
+
cy.visit(`/item-engine/demo/edit-item/${utilities.base64Encoding(itemReferenceID)}`);
|
|
207
|
+
itemPreviewPage.steps.switchToPreviewTab();
|
|
208
|
+
break;
|
|
209
|
+
case 'Grading view':
|
|
210
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
211
|
+
break;
|
|
212
|
+
};
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
beforeEach(() => {
|
|
216
|
+
switch (view) {
|
|
217
|
+
case 'Question preview':
|
|
218
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
219
|
+
fillInTheGapsDropdownPage.steps.resetQuestionPreview();
|
|
220
|
+
break;
|
|
221
|
+
case 'Item preview':
|
|
222
|
+
fillInTheGapsDropdownPage.steps.verifyQuestionPreviewStateWhenSwitchingBackToStudentView();
|
|
223
|
+
itemPreviewPage.steps.resetQuestionPreview();
|
|
224
|
+
break;
|
|
225
|
+
case 'Grading view':
|
|
226
|
+
cy.visit(`/item-engine/demo/render-item/student-view/${utilities.base64Encoding(itemReferenceID)}`);
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
if (view === 'Question preview') {
|
|
232
|
+
after(() => {
|
|
233
|
+
fillInTheGapsDropdownPage.steps.clickOnSaveQuestionButton();
|
|
234
|
+
utilities.verifyElementVisibilityState(itemPreviewPage.referenceID(), 'visible');
|
|
235
|
+
itemReferenceID = itemPreviewPage.steps.getItemReferenceID();
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
it('When the user selects \'Grading\' view without attempting the question, dropdown numeration should be displayed, correct/incorrect status message should not be displayed, correct answers section with a label \'Correct answers\' should be displayed with correct answers and respective option numeration', () => {
|
|
240
|
+
if (view === 'Grading view') {
|
|
241
|
+
studentViewPage.steps.submitResponse();
|
|
242
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
243
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
244
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
245
|
+
};
|
|
246
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
247
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
|
248
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
249
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
250
|
+
};
|
|
251
|
+
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
252
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
253
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
254
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
255
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
256
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
257
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
258
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
259
|
+
{
|
|
260
|
+
correctAnswers: [['Flower'],['Leaf']],
|
|
261
|
+
points: ['(20 points)'],
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
correctAnswers: [['Petal'],['Leaves']],
|
|
265
|
+
points: ['(10 points)'],
|
|
266
|
+
}
|
|
267
|
+
]);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('When the user attempts the question incorrectly, then the user should be awarded 0 points and on switching to \'Grading\' view, incorrect icons should be displayed besides all incorrect responses, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
271
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: incorrectAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
|
272
|
+
if (view === 'Grading view') {
|
|
273
|
+
studentViewPage.steps.submitResponse();
|
|
274
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
275
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
276
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
277
|
+
};
|
|
278
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
279
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
|
280
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
281
|
+
};
|
|
282
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(0);
|
|
283
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
284
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
285
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
286
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
287
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
288
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
289
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
290
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
291
|
+
{
|
|
292
|
+
correctAnswers: [['Flower'],['Leaf']],
|
|
293
|
+
points: ['(20 points)'],
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
correctAnswers: [['Petal'],['Leaves']],
|
|
297
|
+
points: ['(10 points)'],
|
|
298
|
+
}
|
|
299
|
+
]);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it('When the user attempts the question partially correct, then the user should be awarded 0 points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, incorrect icon should be displayed besides incorrect answer response, a status message with text \'Your answer is incorrect\' and correct answer section with all correct answers along with numeration should be displayed', () => {
|
|
303
|
+
if (view === 'Grading view') {
|
|
304
|
+
studentViewPage.steps.clearResponses();
|
|
305
|
+
};
|
|
306
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: incorrectAnswerArray[1] }]);
|
|
307
|
+
if (view === 'Grading view') {
|
|
308
|
+
studentViewPage.steps.submitResponse();
|
|
309
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
310
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
311
|
+
gradingViewPage.steps.verifyGradingViewScore(0, 20);
|
|
312
|
+
};
|
|
313
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
314
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(0, 20);
|
|
315
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
316
|
+
};
|
|
317
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
|
318
|
+
fillInTheGapsDropdownPage.steps.verifyIncorrectOptionIcon(1);
|
|
319
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('incorrect');
|
|
320
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleExists();
|
|
321
|
+
showAlternativeAnswersComponent.steps.disableShowAlternativeAnswersToggle();
|
|
322
|
+
showAlternativeAnswersComponent.steps.verifyShowAlternativeAnswersToggleUnchecked();
|
|
323
|
+
fillInTheGapsDropdownPage.steps.verifyAlternativeAnswersSectionNotExist();
|
|
324
|
+
showAlternativeAnswersComponent.steps.clickShowAlternativeAnswersToggle();
|
|
325
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionWithAlternateAnswer([
|
|
326
|
+
{
|
|
327
|
+
correctAnswers: [['Flower'],['Leaf']],
|
|
328
|
+
points: ['(20 points)'],
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
correctAnswers: [['Petal'],['Leaves']],
|
|
332
|
+
points: ['(10 points)'],
|
|
333
|
+
}
|
|
334
|
+
]);
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it('When the user attempts the question correctly, then the user should be awarded with full points and on switching to \'Grading\' view, correct icon should be displayed besides the correct answer responses, a status message with text \'Your answer is correct\' should be displayed and correct answer section should not be displayed', () => {
|
|
338
|
+
if (view === 'Grading view') {
|
|
339
|
+
studentViewPage.steps.clearResponses();
|
|
340
|
+
};
|
|
341
|
+
fillInTheGapsDropdownPage.steps.selectResponseFromDropdownInPreviewTab([{ dropdownIndex: 0, dropdownOption: correctAnswerArray[0] }, { dropdownIndex: 1, dropdownOption: correctAnswerArray[1] }]);
|
|
342
|
+
if (view === 'Grading view') {
|
|
343
|
+
studentViewPage.steps.submitResponse();
|
|
344
|
+
utilities.verifyElementVisibilityState(dialogBoxBase.dialogBox(), 'visible');
|
|
345
|
+
studentViewPage.steps.clickOnGoToGradingViewButton();
|
|
346
|
+
gradingViewPage.steps.verifyGradingViewScore(20, 20);
|
|
347
|
+
};
|
|
348
|
+
if (view === 'Question preview' || view === 'Item preview') {
|
|
349
|
+
fillInTheGapsDropdownPage.steps.verifyPreviewScore(20, 20);
|
|
350
|
+
fillInTheGapsDropdownPage.steps.switchToGradingView();
|
|
351
|
+
};
|
|
352
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(0);
|
|
353
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectOptionIcon(1);
|
|
354
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectAnswerLabel('correct');
|
|
355
|
+
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerSectionNotExists();
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
};
|
|
360
|
+
|
|
177
361
|
views.forEach((view) => {
|
|
178
362
|
describe(`${view}: Manually scored`, { tags: 'smoke' }, () => {
|
|
179
363
|
abortEarlySetup();
|
|
@@ -311,7 +495,11 @@ describe('Create item page - Fill in the gaps with dropdown: All or nothing ', (
|
|
|
311
495
|
fillInTheGapsDropdownPage.steps.verifyPreviewTabPointsBackgroundForIncorrectOrPartiallyCorrectAnswer();
|
|
312
496
|
};
|
|
313
497
|
fillInTheGapsDropdownPage.steps.verifyDropdownNumerationPreviewTab();
|
|
314
|
-
|
|
498
|
+
if (alternativeAnswerCheck) {
|
|
499
|
+
showAlternativeAnswersComponent.steps.verifyCorrectAnswersLabelAndPointVisible('');
|
|
500
|
+
} else {
|
|
501
|
+
utilities.verifyInnerText(fillInTheGapsDropdownPage.correctAnswersLabel(), 'Correct answers');
|
|
502
|
+
}
|
|
315
503
|
fillInTheGapsDropdownPage.steps.verifyCorrectIncorrectStatusMessageNotExists();
|
|
316
504
|
fillInTheGapsDropdownPage.steps.verifyCorrectAnswerResponsesInCorrectAnswerSectionAndCount(correctAnswerArray);
|
|
317
505
|
});
|
|
@@ -402,43 +402,4 @@ describe('Get Question Data API cases', () => {
|
|
|
402
402
|
.eq(1)
|
|
403
403
|
.should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": 0,\n \"next_token\": null,\n \"timestamp\": ${timestamp}\n },\n \"data\": []\n}\n`);
|
|
404
404
|
});
|
|
405
|
-
|
|
406
|
-
it('Entering a request for a text selection question type', () => {
|
|
407
|
-
cy.get('textarea[class="body-param__text"]')
|
|
408
|
-
.clear()
|
|
409
|
-
.fill(`{\n "item_references": [],\n "references": [],\n "types": ["text selection"],\n "limit": 1,\n "sort_field": "created",\n "sort": "desc"\n}\n`);
|
|
410
|
-
cy.get('.execute')
|
|
411
|
-
.click();
|
|
412
|
-
cy.wait(2000);
|
|
413
|
-
cy.get('.loading-container')
|
|
414
|
-
.should('not.exist');
|
|
415
|
-
cy.get('td[class="response-col_status"]')
|
|
416
|
-
.eq(0)
|
|
417
|
-
.should('have.text', '200');
|
|
418
|
-
cy.get('td.response-col_description')
|
|
419
|
-
.find('code.language-json')
|
|
420
|
-
.eq(0)
|
|
421
|
-
.invoke('text')
|
|
422
|
-
.then((text) => {
|
|
423
|
-
const jsonResponse = JSON.parse(text);
|
|
424
|
-
expect(jsonResponse.data[0]).to.include.keys(
|
|
425
|
-
'reference',
|
|
426
|
-
'type',
|
|
427
|
-
'content',
|
|
428
|
-
'correct_answer',
|
|
429
|
-
'scoring',
|
|
430
|
-
'settings',
|
|
431
|
-
);
|
|
432
|
-
|
|
433
|
-
expect(jsonResponse.data[0].settings).to.include.keys(
|
|
434
|
-
'additional_settings',
|
|
435
|
-
'print_layout_settings',
|
|
436
|
-
'student_view_settings',
|
|
437
|
-
'style_and_layout_customize_settings',
|
|
438
|
-
'tool_settings',
|
|
439
|
-
);
|
|
440
|
-
|
|
441
|
-
expect(jsonResponse.data[0].type).to.equal('text selection');
|
|
442
|
-
});
|
|
443
|
-
});
|
|
444
405
|
});
|
|
@@ -235,57 +235,4 @@ describe('Set Question Data API cases', () => {
|
|
|
235
235
|
.eq(7)
|
|
236
236
|
.should('have.text',"true");
|
|
237
237
|
});
|
|
238
|
-
|
|
239
|
-
it('Creating text selection question and resource from save API', () => {
|
|
240
|
-
unique_reference_id_1 = uuid();
|
|
241
|
-
unique_reference_id_2 = uuid();
|
|
242
|
-
cy.visit('/item-engine/data-api/item-bank/save-questions');
|
|
243
|
-
cy.get('.try-out__btn')
|
|
244
|
-
.click();
|
|
245
|
-
cy.get('textarea[class="body-param__text"]')
|
|
246
|
-
.clear()
|
|
247
|
-
.fill(`{"questions":[{"reference":"${unique_reference_id_1}","type":"text selection","content":{"instruction":"test","acknowledgements":"Acknowledgements and references","sampleAnswer":"Sample Answer","question":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>","highlightedText":"<p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token0'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </span></p><p><span class='word-span highlight_option' role='checkbox' aria-checked='false' id='token1'>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </span></p><p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token2'>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </span></p>"},"correctAnswer":[{"totalPoints":5,"answers":[{"answer":"optiontoken0","points":5}]},{"totalPoints":10,"answers":[{"answer":"optiontoken2","points":10}]},{"totalPoints":3,"answers":[{"answer":"optiontoken0","points":3}]}],"scoring":{"points":10,"scoringType":"auto-scored","subScoringType":"allOrNothing","penaltyPoints":null,"penaltyPointType":"noPenalty","penaltyPointsForEach":null,"minScoreType":"noMinScore","minScorePoints":null,"isRoundingEnabled":true,"roundingType":"none","isNegativeRounded":true,"scoringGuidance":""},"settings":{"studentViewSettings":{"outerBorder":true,"showAvailableSelections":false,"maxNumAnswers":"noLimit","showMaxSelectionLimit":false,"highlightSelectionType":"multipleSelection"},"styleAndLayoutCustomizeSettings":{"borderStyle":"solid","isFontColorWhite":true,"textSelection":"custom","textSelectionStyle":"filledIn","selectionStyleColors":[{"color":"rgba(82, 0, 255, 1)","isSelected":true},{"color":"rgba(0, 112, 128, 1)","isSelected":false},{"color":"rgba(128, 102, 69, 1)","isSelected":false},{"color":"rgba(102, 102, 102, 1)","isSelected":false},{"color":"rgba(0, 0, 0, 1)","isSelected":false}]},"additionalSettings":{"fontSize":"default","nonAccessible":false},"printLayoutSettings":{"excludeFromPrint":false,"printInstruction":"Question instructions for print"},"toolSettings":[{"resource":"ruler","enabled":true},{"resource":"protractor","enabled":true},{"resource":"readingRuler","enabled":false},{"resource":"simpleCalculator","enabled":false},{"resource":"scientificCalculator","enabled":false},{"resource":"compass","enabled":false}]}}]}`);
|
|
248
|
-
cy.get('.execute')
|
|
249
|
-
.click();
|
|
250
|
-
cy.wait(2000);
|
|
251
|
-
cy.get('.loading-container')
|
|
252
|
-
.should('not.exist');
|
|
253
|
-
cy.visit('/item-engine/data-api/item-bank/save-resources');
|
|
254
|
-
cy.get('.try-out__btn')
|
|
255
|
-
.click();
|
|
256
|
-
cy.get('textarea[class="body-param__text"]')
|
|
257
|
-
.clear()
|
|
258
|
-
.fill(`{\n "resources": [\n {\n "type": 1,\n "data": {\n "type": "Passage",\n "heading": "Passage created via save resources data API",\n "content": "This is content of the passage"\n },\n "reference": "${unique_reference_id_2}"\n }\n ],\n "organisation_id": "${Cypress.env('organisation_id')}",\n "meta": {\n "user": {\n "id": "dfbb6366-d88d-416d-9d9c-7ee6420817b3",\n "first_name": "fname",\n "last_name": "lname",\n "email": "user@demo.com"\n }\n }\n}\n`);
|
|
259
|
-
cy.get('.execute')
|
|
260
|
-
.click();
|
|
261
|
-
cy.wait(2000);
|
|
262
|
-
cy.get('.loading-container')
|
|
263
|
-
.should('not.exist');
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
it('Throw validation error while creating text selection question', () => {
|
|
267
|
-
unique_reference_id_1 = uuid();
|
|
268
|
-
cy.visit('/item-engine/data-api/item-bank/save-questions');
|
|
269
|
-
cy.get('.try-out__btn')
|
|
270
|
-
.click();
|
|
271
|
-
cy.get('textarea[class="body-param__text"]')
|
|
272
|
-
.clear()
|
|
273
|
-
.fill(`{"questions":[{"reference":"${unique_reference_id_1}","type":"text selection","content":{"instruction":"test","acknowledgements":"Acknowledgements and references","sampleAnswer":"Sample Answer","question":"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>","highlightedText":"<p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token0'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </span></p><p><span class='word-span highlight_option' role='checkbox' aria-checked='false' id='token1'>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </span></p><p><span class='word-span highlight_option highlighted' role='checkbox' aria-checked='true' id='token2'>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </span></p>"},"correctAnswer":[{"totalPoints":5,"answers":[{"answer":"optiontoken0","points":5}]},{"totalPoints":10,"answers":[{"answer":"optiontoken2","points":10}]},{"totalPoints":3,"answers":[{"answer":"optiontoken6","points":3}]}],"scoring":{"points":10,"scoringType":"auto-scored","subScoringType":"allOrNothing","penaltyPoints":null,"penaltyPointType":"noPenalty","penaltyPointsForEach":null,"minScoreType":"noMinScore","minScorePoints":null,"isRoundingEnabled":true,"roundingType":"none","isNegativeRounded":true,"scoringGuidance":""},"settings":{"studentViewSettings":{"outerBorder":true,"showAvailableSelections":false,"maxNumAnswers":"noLimit","showMaxSelectionLimit":false,"highlightSelectionType":"multipleSelection"},"styleAndLayoutCustomizeSettings":{"borderStyle":"solid","isFontColorWhite":true,"textSelection":"custom","textSelectionStyle":"filledIn","selectionStyleColors":[{"color":"rgba(82, 0, 255, 1)","isSelected":true},{"color":"rgba(0, 112, 128, 1)","isSelected":false},{"color":"rgba(128, 102, 69, 1)","isSelected":false},{"color":"rgba(102, 102, 102, 1)","isSelected":false},{"color":"rgba(0, 0, 0, 1)","isSelected":false}]},"additionalSettings":{"fontSize":"default","nonAccessible":false},"printLayoutSettings":{"excludeFromPrint":false,"printInstruction":"Question instructions for print"},"toolSettings":[{"resource":"ruler","enabled":true},{"resource":"protractor","enabled":true},{"resource":"readingRuler","enabled":false},{"resource":"simpleCalculator","enabled":false},{"resource":"scientificCalculator","enabled":false},{"resource":"compass","enabled":false}]}}]}`);
|
|
274
|
-
cy.get('.execute')
|
|
275
|
-
.click();
|
|
276
|
-
cy.wait(2000);
|
|
277
|
-
cy.get('.loading-container')
|
|
278
|
-
.should('not.exist');
|
|
279
|
-
cy.get('td[class="response-col_status"]')
|
|
280
|
-
.eq(0)
|
|
281
|
-
.should('have.text', '200');
|
|
282
|
-
cy.get('td.response-col_description')
|
|
283
|
-
.find('code.language-json')
|
|
284
|
-
.eq(0)
|
|
285
|
-
.invoke('text')
|
|
286
|
-
.then((text) => {
|
|
287
|
-
const jsonResponse = JSON.parse(text);
|
|
288
|
-
expect(jsonResponse.meta.message).to.equal('Invalid answer "optiontoken6" in question 1. Must match one of the token IDs.');
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
238
|
});
|