itemengine-cypress-automation 1.0.579-IEI-7105-043279f.0 → 1.0.579-IEI-7193-1dd98c9.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.
|
@@ -134,30 +134,30 @@ describe('Get Question Data API cases', () => {
|
|
|
134
134
|
|
|
135
135
|
it('All the questions of the entered item reference should be returned in the response with status code 200', () => {
|
|
136
136
|
cy.get('pre[class="microlight"]')
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
137
|
+
.eq(1)
|
|
138
|
+
.invoke('text')
|
|
139
|
+
.then((text) => {
|
|
140
|
+
// Parse the JSON from the DOM
|
|
141
|
+
const actualResponse = JSON.parse(text);
|
|
142
|
+
|
|
143
|
+
// Extract dynamic values from the parsed object
|
|
144
|
+
const { records, timestamp, next_token } = actualResponse.meta;
|
|
145
|
+
const test1Data = actualResponse.data.DataApiGetQuestionTest1[0];
|
|
146
|
+
const { dt_created, dt_updated, reference: ref1 } = test1Data;
|
|
147
|
+
const test2Data = actualResponse.data.DataApiGetQuestionTest2[0];
|
|
148
|
+
const { reference: ref2 } = test2Data;
|
|
149
|
+
questionRef1 = ref1;
|
|
150
|
+
questionRef2 = ref2;
|
|
151
|
+
|
|
152
|
+
// First, assert the status code is 200
|
|
153
|
+
cy.get('td[class="response-col_status"]')
|
|
154
|
+
.eq(0)
|
|
155
|
+
.should('have.text', '200');
|
|
156
|
+
cy.get('pre[class="microlight"]')
|
|
157
|
+
.eq(1)
|
|
158
|
+
.should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": ${records},\n \"next_token\": ${next_token ? `[\n ${next_token[0]},\n \"${next_token[1]}\"\n ]` : null},\n \"timestamp\": ${timestamp}\n },\n \"data\": {\n \"DataApiGetQuestionTest1\": [\n {\n \"reference\": \"${ref1}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ],\n \"DataApiGetQuestionTest2\": [\n {\n \"reference\": \"${ref2}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ]\n }\n}\n`);
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
161
|
|
|
162
162
|
it('Entering the request with multiple item references, filtered by type', () => {
|
|
163
163
|
cy.get('textarea[class="body-param__text"]')
|
|
@@ -172,29 +172,29 @@ describe('Get Question Data API cases', () => {
|
|
|
172
172
|
|
|
173
173
|
it('All the questions of the entered item reference, filtered by the entered type should be returned in the response, with a status code 200', () => {
|
|
174
174
|
cy.get('pre[class="microlight"]')
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
175
|
+
.eq(1)
|
|
176
|
+
.invoke('text')
|
|
177
|
+
.then((text) => {
|
|
178
|
+
// Parse the JSON from the DOM
|
|
179
|
+
const actualResponse = JSON.parse(text);
|
|
180
|
+
|
|
181
|
+
// Extract dynamic values from the parsed object
|
|
182
|
+
const { records, timestamp, next_token } = actualResponse.meta;
|
|
183
|
+
const test1Data = actualResponse.data.DataApiGetQuestionTest1[0];
|
|
184
|
+
const { dt_created, dt_updated, reference: ref1 } = test1Data;
|
|
185
|
+
const test2Data = actualResponse.data.DataApiGetQuestionTest2[0];
|
|
186
|
+
const { reference: ref2 } = test2Data;
|
|
187
|
+
questionRef1 = ref1;
|
|
188
|
+
questionRef2 = ref2;
|
|
189
|
+
|
|
190
|
+
// First, assert the status code is 200
|
|
191
|
+
cy.get('td[class="response-col_status"]')
|
|
192
|
+
.eq(0)
|
|
193
|
+
.should('have.text', '200');
|
|
194
|
+
cy.get('pre[class="microlight"]')
|
|
195
|
+
.eq(1)
|
|
196
|
+
.should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": ${records},\n \"next_token\": ${next_token ? `[\n ${next_token[0]},\n \"${next_token[1]}\"\n ]` : null},\n \"timestamp\": ${timestamp}\n },\n \"data\": {\n \"DataApiGetQuestionTest1\": [\n {\n \"reference\": \"${ref1}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ],\n \"DataApiGetQuestionTest2\": [\n {\n \"reference\": \"${ref2}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ]\n }\n}\n`);
|
|
197
|
+
});
|
|
198
198
|
});
|
|
199
199
|
|
|
200
200
|
it('Entering the request with multiple item references, filtered by type and sorted by item name ascending', () => {
|
|
@@ -210,29 +210,29 @@ describe('Get Question Data API cases', () => {
|
|
|
210
210
|
|
|
211
211
|
it('All the questions of the entered item reference, filtered by the entered type should be returned in the response sorted by item name ascending', () => {
|
|
212
212
|
cy.get('pre[class="microlight"]')
|
|
213
|
-
.eq(1)
|
|
214
|
-
.invoke('text')
|
|
215
|
-
.then((text) => {
|
|
216
|
-
// Parse the JSON from the DOM
|
|
217
|
-
const actualResponse = JSON.parse(text);
|
|
218
|
-
|
|
219
|
-
// Extract dynamic values from the parsed object
|
|
220
|
-
const { records, timestamp, next_token } = actualResponse.meta;
|
|
221
|
-
const test1Data = actualResponse.data.DataApiGetQuestionTest1[0];
|
|
222
|
-
const { dt_created, dt_updated, reference: ref1 } = test1Data;
|
|
223
|
-
const test2Data = actualResponse.data.DataApiGetQuestionTest2[0];
|
|
224
|
-
const { reference: ref2 } = test2Data;
|
|
225
|
-
questionRef1 = ref1;
|
|
226
|
-
questionRef2 = ref2;
|
|
227
|
-
|
|
228
|
-
// First, assert the status code is 200
|
|
229
|
-
cy.get('td[class="response-col_status"]')
|
|
230
|
-
.eq(0)
|
|
231
|
-
.should('have.text', '200');
|
|
232
|
-
cy.get('pre[class="microlight"]')
|
|
233
213
|
.eq(1)
|
|
234
|
-
.
|
|
235
|
-
|
|
214
|
+
.invoke('text')
|
|
215
|
+
.then((text) => {
|
|
216
|
+
// Parse the JSON from the DOM
|
|
217
|
+
const actualResponse = JSON.parse(text);
|
|
218
|
+
|
|
219
|
+
// Extract dynamic values from the parsed object
|
|
220
|
+
const { records, timestamp, next_token } = actualResponse.meta;
|
|
221
|
+
const test1Data = actualResponse.data.DataApiGetQuestionTest1[0];
|
|
222
|
+
const { dt_created, dt_updated, reference: ref1 } = test1Data;
|
|
223
|
+
const test2Data = actualResponse.data.DataApiGetQuestionTest2[0];
|
|
224
|
+
const { reference: ref2 } = test2Data;
|
|
225
|
+
questionRef1 = ref1;
|
|
226
|
+
questionRef2 = ref2;
|
|
227
|
+
|
|
228
|
+
// First, assert the status code is 200
|
|
229
|
+
cy.get('td[class="response-col_status"]')
|
|
230
|
+
.eq(0)
|
|
231
|
+
.should('have.text', '200');
|
|
232
|
+
cy.get('pre[class="microlight"]')
|
|
233
|
+
.eq(1)
|
|
234
|
+
.should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": ${records},\n \"next_token\": ${next_token ? `[\n ${next_token[0]},\n \"${next_token[1]}\"\n ]` : null},\n \"timestamp\": ${timestamp}\n },\n \"data\": {\n \"DataApiGetQuestionTest1\": [\n {\n \"reference\": \"${ref1}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ],\n \"DataApiGetQuestionTest2\": [\n {\n \"reference\": \"${ref2}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ]\n }\n}\n`);
|
|
235
|
+
});
|
|
236
236
|
});
|
|
237
237
|
|
|
238
238
|
it('Entering the request with multiple item references, filtered by type and question reference id', () => {
|
|
@@ -257,25 +257,25 @@ describe('Get Question Data API cases', () => {
|
|
|
257
257
|
|
|
258
258
|
it('All the questions of the entered item reference, filtered by the entered type and question reference should be returned in the response, with a status code 200', () => {
|
|
259
259
|
cy.get('pre[class="microlight"]')
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
260
|
+
.eq(1)
|
|
261
|
+
.invoke('text')
|
|
262
|
+
.then((text) => {
|
|
263
|
+
// Parse the JSON from the DOM
|
|
264
|
+
const actualResponse = JSON.parse(text);
|
|
265
|
+
|
|
266
|
+
// Extract dynamic values from the parsed object
|
|
267
|
+
const { records, timestamp, next_token } = actualResponse.meta;
|
|
268
|
+
const test1Data = actualResponse.data.DataApiGetQuestionTest1[0];
|
|
269
|
+
const { dt_created, dt_updated, reference: ref1 } = test1Data;
|
|
270
|
+
const test2Data = actualResponse.data.DataApiGetQuestionTest2[0];
|
|
271
|
+
const { reference: ref2 } = test2Data;
|
|
272
|
+
cy.get('td[class="response-col_status"]')
|
|
273
|
+
.eq(0)
|
|
274
|
+
.should('have.text', '200');
|
|
275
|
+
cy.get('pre[class="microlight"]')
|
|
276
|
+
.eq(1)
|
|
277
|
+
.should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": ${records},\n \"next_token\": ${next_token ? `[\n ${next_token[0]},\n \"${next_token[1]}\"\n ]` : null},\n \"timestamp\": ${timestamp}\n },\n \"data\": {\n \"DataApiGetQuestionTest1\": [\n {\n \"reference\": \"${ref1}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ],\n \"DataApiGetQuestionTest2\": [\n {\n \"reference\": \"${ref2}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ]\n }\n}\n`);
|
|
278
|
+
});
|
|
279
279
|
});
|
|
280
280
|
|
|
281
281
|
it('Entering request with an invalid question type', () => {
|
|
@@ -349,29 +349,29 @@ describe('Get Question Data API cases', () => {
|
|
|
349
349
|
|
|
350
350
|
it('The question as per the entered question reference, should be returned in the response, with a status code 200', () => {
|
|
351
351
|
cy.get('pre[class="microlight"]')
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
352
|
+
.eq(1)
|
|
353
|
+
.invoke('text')
|
|
354
|
+
.then((text) => {
|
|
355
|
+
// Parse the JSON from the DOM
|
|
356
|
+
const actualResponse = JSON.parse(text);
|
|
357
|
+
|
|
358
|
+
// Extract dynamic values from the parsed object
|
|
359
|
+
const { records, timestamp, next_token } = actualResponse.meta;
|
|
360
|
+
const test1Data = actualResponse.data.DataApiGetQuestionTest1[0];
|
|
361
|
+
const { dt_created, dt_updated, reference: ref1 } = test1Data;
|
|
362
|
+
const test2Data = actualResponse.data.DataApiGetQuestionTest2[0];
|
|
363
|
+
const { reference: ref2 } = test2Data;
|
|
364
|
+
questionRef1 = ref1;
|
|
365
|
+
questionRef2 = ref2;
|
|
366
|
+
|
|
367
|
+
// First, assert the status code is 200
|
|
368
|
+
cy.get('td[class="response-col_status"]')
|
|
369
|
+
.eq(0)
|
|
370
|
+
.should('have.text', '200');
|
|
371
|
+
cy.get('pre[class="microlight"]')
|
|
372
|
+
.eq(1)
|
|
373
|
+
.should('have.text', `{\n \"meta\": {\n \"status\": true,\n \"records\": ${records},\n \"next_token\": ${next_token ? `[\n ${next_token[0]},\n \"${next_token[1]}\"\n ]` : null},\n \"timestamp\": ${timestamp}\n },\n \"data\": {\n \"DataApiGetQuestionTest1\": [\n {\n \"reference\": \"${ref1}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ],\n \"DataApiGetQuestionTest2\": [\n {\n \"reference\": \"${ref2}\",\n \"type\": \"multiple selection\",\n \"dt_created\": \"${dt_created}\",\n \"dt_updated\": \"${dt_updated}\",\n \"scoring_type\": \"Auto-scored\",\n \"points\": 2,\n \"penalty_points\": null,\n \"min_score_if_attempted\": null,\n \"min_score_type\": 1,\n \"penalty_point_type\": 1,\n \"is_auto_penalty_setting\": false,\n \"is_negative_rounded\": true,\n \"specific_penalty_type\": 1,\n \"penalty_points_for_each\": null,\n \"scoring_guidance\": \"\",\n \"sample_response\": \"\",\n \"data\": \"<assessmentItem xmlns=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2\\\" xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xsi:schemaLocation=\\\"http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2p2.xsd\\\" identifier=\\\"choiceMultiple\\\" title=\\\"Welcome to Biodome\\\" timeDependent=\\\"false\\\"><responseDeclaration identifier=\\\"RESPONSE\\\" cardinality=\\\"multiple\\\" baseType=\\\"identifier\\\"><correctResponse><value>ChoiceA</value><value>ChoiceB</value></correctResponse></responseDeclaration><outcomeDeclaration identifier=\\\"SCORE\\\" cardinality=\\\"single\\\" baseType=\\\"float\\\"/><itemBody><choiceInteraction responseIdentifier=\\\"RESPONSE\\\" orientation=\\\"horizontal\\\"><prompt></prompt><simpleChoice identifier=\\\"ChoiceA\\\">1</simpleChoice><simpleChoice identifier=\\\"ChoiceB\\\">2</simpleChoice><simpleChoice identifier=\\\"ChoiceC\\\">3</simpleChoice><simpleChoice identifier=\\\"ChoiceD\\\">4</simpleChoice></choiceInteraction></itemBody><responseProcessing template=\\\"http://www.imsglobal.org/question/qti_v2p2/rptemplates/map_response\\\"/></assessmentItem>\"\n }\n ]\n }\n}\n`);
|
|
374
|
+
});
|
|
375
375
|
});
|
|
376
376
|
|
|
377
377
|
it('Entering request with an invalid combination of item and question reference', () => {
|
|
@@ -402,4 +402,43 @@ 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
|
+
});
|
|
405
444
|
});
|
|
@@ -235,4 +235,57 @@ 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
|
+
});
|
|
238
291
|
});
|