@digabi/exam-engine-core 19.7.1 → 19.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/AnsweringInstructions.test.js +11 -11
- package/dist/__tests__/AnsweringInstructions.test.js.map +1 -1
- package/dist/__tests__/examServerApi.js +2 -2
- package/dist/__tests__/examServerApi.js.map +1 -1
- package/dist/__tests__/renderAnnotations.test.js +18 -18
- package/dist/__tests__/results/AnnotationList.test.js +27 -27
- package/dist/__tests__/results/ResultsContext.test.js +37 -37
- package/dist/__tests__/results/ResultsContext.test.js.map +1 -1
- package/dist/__tests__/results/ResultsExamQuestionAutoScore.test.js +4 -4
- package/dist/__tests__/results/ResultsExamQuestionManualScore.test.js +19 -19
- package/dist/__tests__/testExamRendering.js +14 -16
- package/dist/__tests__/testExamRendering.js.map +1 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/__tests__/validateAnswers.test.js +28 -28
- package/dist/__tests__/validateAnswers.test.js.map +1 -1
- package/dist/components/AnswerToolbar.d.ts +1 -1
- package/dist/components/AnswerToolbar.d.ts.map +1 -1
- package/dist/components/AnswerToolbar.js +2 -2
- package/dist/components/AnswerToolbar.js.map +1 -1
- package/dist/components/AnsweringInstructions.js +1 -1
- package/dist/components/AnsweringInstructions.js.map +1 -1
- package/dist/components/DocumentTitle.js +1 -1
- package/dist/components/DocumentTitle.js.map +1 -1
- package/dist/components/SectionElement.js +1 -1
- package/dist/components/SectionElement.js.map +1 -1
- package/dist/components/attachments/Attachments.js +1 -1
- package/dist/components/attachments/ExternalMaterial.d.ts.map +1 -1
- package/dist/components/attachments/ExternalMaterial.js +5 -1
- package/dist/components/attachments/ExternalMaterial.js.map +1 -1
- package/dist/components/attachments/Question.js +1 -1
- package/dist/components/attachments/Question.js.map +1 -1
- package/dist/components/context/CommonExamContext.js +1 -1
- package/dist/components/context/ExamContext.js +1 -1
- package/dist/components/context/QuestionContext.js +1 -1
- package/dist/components/context/ResultsContext.js +6 -6
- package/dist/components/context/ResultsContext.js.map +1 -1
- package/dist/components/context/SectionContext.js +2 -2
- package/dist/components/context/SectionContext.js.map +1 -1
- package/dist/components/exam/ChoiceAnswer.js +6 -6
- package/dist/components/exam/ChoiceAnswer.js.map +1 -1
- package/dist/components/exam/DropdownAnswer.js +10 -10
- package/dist/components/exam/DropdownAnswer.js.map +1 -1
- package/dist/components/exam/Exam.d.ts.map +1 -1
- package/dist/components/exam/Exam.js +6 -2
- package/dist/components/exam/Exam.js.map +1 -1
- package/dist/components/exam/ExternalMaterial.js +1 -1
- package/dist/components/exam/Hints.js +3 -3
- package/dist/components/exam/Hints.js.map +1 -1
- package/dist/components/exam/Question.js +1 -1
- package/dist/components/exam/QuestionTitle.js +1 -1
- package/dist/components/exam/RichTextAnswer.d.ts +6 -1
- package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
- package/dist/components/exam/RichTextAnswer.js +1 -1
- package/dist/components/exam/RichTextAnswer.js.map +1 -1
- package/dist/components/exam/Section.js +2 -2
- package/dist/components/exam/Section.js.map +1 -1
- package/dist/components/exam/internal/ErrorIndicator.d.ts +1 -1
- package/dist/components/exam/internal/ErrorIndicator.d.ts.map +1 -1
- package/dist/components/exam/internal/ErrorIndicator.js +4 -4
- package/dist/components/exam/internal/ErrorIndicator.js.map +1 -1
- package/dist/components/exam/internal/ProgressBar.js +1 -1
- package/dist/components/exam/internal/ProgressBar.js.map +1 -1
- package/dist/components/exam/internal/TextAnswerInput.js +6 -6
- package/dist/components/exam/internal/TextAnswerInput.js.map +1 -1
- package/dist/components/grading/AnswerCharacterCounter.d.ts +1 -1
- package/dist/components/grading/AnswerCharacterCounter.d.ts.map +1 -1
- package/dist/components/grading/AnswerCharacterCounter.js +3 -3
- package/dist/components/grading/AnswerCharacterCounter.js.map +1 -1
- package/dist/components/grading/GradingAnswer.js +9 -9
- package/dist/components/grading/GradingAnswer.js.map +1 -1
- package/dist/components/grading/GradingAnswerAnnotationList.d.ts +1 -1
- package/dist/components/grading/GradingAnswerAnnotationList.d.ts.map +1 -1
- package/dist/components/grading/GradingAnswerAnnotationList.js +2 -2
- package/dist/components/grading/GradingAnswerAnnotationList.js.map +1 -1
- package/dist/components/grading/editAnnotations.js +14 -14
- package/dist/components/grading/editAnnotations.js.map +1 -1
- package/dist/components/grading/largeImageDetector.js +2 -2
- package/dist/components/grading/largeImageDetector.js.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.js +6 -2
- package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
- package/dist/components/grading-instructions/Question.js +1 -1
- package/dist/components/grading-instructions/QuestionTitle.js +1 -1
- package/dist/components/results/ChoiceAnswer.js +7 -7
- package/dist/components/results/ChoiceAnswer.js.map +1 -1
- package/dist/components/results/DropdownAnswer.js +5 -5
- package/dist/components/results/DropdownAnswer.js.map +1 -1
- package/dist/components/results/Question.js +2 -2
- package/dist/components/results/Question.js.map +1 -1
- package/dist/components/results/QuestionTitle.js +1 -1
- package/dist/components/results/Results.d.ts.map +1 -1
- package/dist/components/results/Results.js +5 -1
- package/dist/components/results/Results.js.map +1 -1
- package/dist/components/results/Section.js +1 -1
- package/dist/components/results/Section.js.map +1 -1
- package/dist/components/results/SingleLineAnswer.d.ts +1 -1
- package/dist/components/results/SingleLineAnswer.d.ts.map +1 -1
- package/dist/components/results/SingleLineAnswer.js +1 -1
- package/dist/components/results/SingleLineAnswer.js.map +1 -1
- package/dist/components/results/internal/AnnotationList.js +2 -2
- package/dist/components/results/internal/AnnotationList.js.map +1 -1
- package/dist/components/results/internal/QuestionManualScore.js +3 -3
- package/dist/components/results/internal/QuestionScoresContainer.d.ts +1 -1
- package/dist/components/results/internal/QuestionScoresContainer.d.ts.map +1 -1
- package/dist/components/results/internal/QuestionScoresContainer.js +2 -2
- package/dist/components/results/internal/QuestionScoresContainer.js.map +1 -1
- package/dist/components/shared/AnnotationLists.d.ts +1 -1
- package/dist/components/shared/AnnotationLists.d.ts.map +1 -1
- package/dist/components/shared/AnnotationLists.js +1 -1
- package/dist/components/shared/AnnotationLists.js.map +1 -1
- package/dist/components/shared/AttachmentLink.js +1 -1
- package/dist/components/shared/AttachmentLink.js.map +1 -1
- package/dist/components/shared/AttachmentLinks.js +3 -3
- package/dist/components/shared/AttachmentLinks.js.map +1 -1
- package/dist/components/shared/ExamTranslation.d.ts +6 -0
- package/dist/components/shared/ExamTranslation.d.ts.map +1 -0
- package/dist/components/shared/ExamTranslation.js +10 -0
- package/dist/components/shared/ExamTranslation.js.map +1 -0
- package/dist/components/shared/ImageOverlay.js +3 -3
- package/dist/components/shared/ImageOverlay.js.map +1 -1
- package/dist/components/shared/QuestionNumber.d.ts +4 -0
- package/dist/components/shared/QuestionNumber.d.ts.map +1 -0
- package/dist/components/shared/QuestionNumber.js +12 -0
- package/dist/components/shared/QuestionNumber.js.map +1 -0
- package/dist/components/shared/Reference.js +1 -1
- package/dist/components/shared/References.js +1 -1
- package/dist/components/shared/References.js.map +1 -1
- package/dist/components/shared/Score.js +1 -1
- package/dist/components/shared/TableOfContents.js +2 -2
- package/dist/components/shared/internal/ResponsiveMediaContainer.js +3 -3
- package/dist/components/shared/internal/ResponsiveMediaContainer.js.map +1 -1
- package/dist/components/shared/internal/RestrictedAudioPlayer.d.ts +1 -1
- package/dist/components/shared/internal/RestrictedAudioPlayer.d.ts.map +1 -1
- package/dist/components/shared/internal/RestrictedAudioPlayer.js +2 -2
- package/dist/components/shared/internal/RestrictedAudioPlayer.js.map +1 -1
- package/dist/dom-utils.js +1 -1
- package/dist/dom-utils.js.map +1 -1
- package/dist/fonts.js +1 -1
- package/dist/fonts.js.map +1 -1
- package/dist/i18n/A_E.js +2 -2
- package/dist/i18n/BA.js +1 -1
- package/dist/i18n/CA.js +1 -1
- package/dist/i18n/EA.js +2 -2
- package/dist/i18n/FA.js +2 -2
- package/dist/i18n/GC.js +2 -2
- package/dist/i18n/I.js +3 -3
- package/dist/i18n/M.js +1 -1
- package/dist/i18n/O_E.js +2 -2
- package/dist/i18n/PA.js +2 -2
- package/dist/i18n/SA.js +2 -2
- package/dist/i18n/TC.js +2 -2
- package/dist/i18n/VA.js +2 -2
- package/dist/i18n/Z.js +3 -3
- package/dist/i18n/fi-FI.js +13 -13
- package/dist/i18n/index.d.ts +2 -137
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +8 -8
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/sv-FI.js +13 -13
- package/dist/main-bundle.js +1 -1
- package/dist/main-bundle.js.LICENSE.txt +0 -5
- package/dist/main.css +1 -1
- package/dist/parser/parseExam.js +5 -5
- package/dist/parser/parseExam.js.map +1 -1
- package/dist/parser/parseExamStructure.js +4 -4
- package/dist/renderAnnotations.js +8 -8
- package/dist/renderAnnotations.js.map +1 -1
- package/dist/store/answers/reducer.js +2 -2
- package/dist/store/audio/reducer.js +3 -3
- package/dist/store/audio/sagas.js +1 -1
- package/dist/store/audio/sagas.js.map +1 -1
- package/dist/store/cas/reducer.js +1 -1
- package/dist/store/cas/sagas.js +1 -1
- package/dist/store/countdown.js +1 -1
- package/dist/store/countdown.js.map +1 -1
- package/dist/store/index.js +4 -4
- package/dist/validateAnswers.js +8 -8
- package/dist/validateAnswers.js.map +1 -1
- package/package.json +18 -18
@@ -41,17 +41,17 @@ beforeAll(async () => {
|
|
41
41
|
{
|
42
42
|
questions: [
|
43
43
|
(0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)({ maxLength: 3 })]),
|
44
|
-
(0, exam_engine_generator_1.question)({ questions: [(0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)({ maxLength: 3 })]), (0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)()])] })
|
45
|
-
]
|
44
|
+
(0, exam_engine_generator_1.question)({ questions: [(0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)({ maxLength: 3 })]), (0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)()])] })
|
45
|
+
]
|
46
46
|
},
|
47
47
|
{
|
48
48
|
maxAnswers: 1,
|
49
49
|
questions: [
|
50
50
|
(0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)()]),
|
51
|
-
(0, exam_engine_generator_1.question)({ maxAnswers: 1, questions: [(0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)()]), (0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)()])] })
|
52
|
-
]
|
53
|
-
}
|
54
|
-
]
|
51
|
+
(0, exam_engine_generator_1.question)({ maxAnswers: 1, questions: [(0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)()]), (0, exam_engine_generator_1.question)([(0, exam_engine_generator_1.textAnswer)()])] })
|
52
|
+
]
|
53
|
+
}
|
54
|
+
]
|
55
55
|
});
|
56
56
|
const [masteringResult] = await (0, exam_engine_mastering_1.masterExam)(exam, () => '', () => {
|
57
57
|
throw new Error('Boom!');
|
@@ -65,8 +65,8 @@ describe('Answer length validation', () => {
|
|
65
65
|
{
|
66
66
|
displayNumber: '1',
|
67
67
|
type: 'AnswerTooLong',
|
68
|
-
characterCount: 8
|
69
|
-
}
|
68
|
+
characterCount: 8
|
69
|
+
}
|
70
70
|
]);
|
71
71
|
});
|
72
72
|
it('returns multiple errors if multiple answers are too long', () => {
|
@@ -74,13 +74,13 @@ describe('Answer length validation', () => {
|
|
74
74
|
{
|
75
75
|
displayNumber: '1',
|
76
76
|
type: 'AnswerTooLong',
|
77
|
-
characterCount: 8
|
77
|
+
characterCount: 8
|
78
78
|
},
|
79
79
|
{
|
80
80
|
displayNumber: '2.1',
|
81
81
|
type: 'AnswerTooLong',
|
82
|
-
characterCount: 8
|
83
|
-
}
|
82
|
+
characterCount: 8
|
83
|
+
}
|
84
84
|
]);
|
85
85
|
});
|
86
86
|
it('does not return errors if answer is short enough', () => {
|
@@ -118,7 +118,7 @@ describe('Extra answers validation', () => {
|
|
118
118
|
['1', '4.2'],
|
119
119
|
['2.1', '4.2'],
|
120
120
|
['2.2', '4.2'],
|
121
|
-
['2.1', '2.2', '4.2']
|
121
|
+
['2.1', '2.2', '4.2']
|
122
122
|
];
|
123
123
|
const invalidAnswerCombinations = _.differenceWith(allAnswerCombinations, validAnswerCombinations, _.isEqual);
|
124
124
|
for (const questions of validAnswerCombinations) {
|
@@ -136,8 +136,8 @@ describe('Extra answers validation', () => {
|
|
136
136
|
maxAnswers: 1,
|
137
137
|
minAnswers: undefined,
|
138
138
|
elementType: 'question',
|
139
|
-
type: 'ExtraAnswer'
|
140
|
-
}
|
139
|
+
type: 'ExtraAnswer'
|
140
|
+
}
|
141
141
|
]);
|
142
142
|
});
|
143
143
|
it('returns an error if section has too many answers', () => {
|
@@ -148,8 +148,8 @@ describe('Extra answers validation', () => {
|
|
148
148
|
maxAnswers: 1,
|
149
149
|
minAnswers: 0,
|
150
150
|
elementType: 'section',
|
151
|
-
type: 'ExtraAnswer'
|
152
|
-
}
|
151
|
+
type: 'ExtraAnswer'
|
152
|
+
}
|
153
153
|
]);
|
154
154
|
});
|
155
155
|
it('returns an error if exam has too many answers', () => {
|
@@ -160,8 +160,8 @@ describe('Extra answers validation', () => {
|
|
160
160
|
maxAnswers: 2,
|
161
161
|
minAnswers: undefined,
|
162
162
|
elementType: 'exam',
|
163
|
-
type: 'ExtraAnswer'
|
164
|
-
}
|
163
|
+
type: 'ExtraAnswer'
|
164
|
+
}
|
165
165
|
]);
|
166
166
|
});
|
167
167
|
it('returns two errors if both exam and section have too many answers', () => {
|
@@ -172,7 +172,7 @@ describe('Extra answers validation', () => {
|
|
172
172
|
maxAnswers: 2,
|
173
173
|
minAnswers: undefined,
|
174
174
|
elementType: 'exam',
|
175
|
-
type: 'ExtraAnswer'
|
175
|
+
type: 'ExtraAnswer'
|
176
176
|
},
|
177
177
|
{
|
178
178
|
childQuestions: ['3', '4'],
|
@@ -180,8 +180,8 @@ describe('Extra answers validation', () => {
|
|
180
180
|
maxAnswers: 1,
|
181
181
|
minAnswers: 0,
|
182
182
|
elementType: 'section',
|
183
|
-
type: 'ExtraAnswer'
|
184
|
-
}
|
183
|
+
type: 'ExtraAnswer'
|
184
|
+
}
|
185
185
|
]);
|
186
186
|
});
|
187
187
|
it('returns three errors if exam, section and question have too many answers', () => {
|
@@ -192,7 +192,7 @@ describe('Extra answers validation', () => {
|
|
192
192
|
maxAnswers: 2,
|
193
193
|
minAnswers: undefined,
|
194
194
|
elementType: 'exam',
|
195
|
-
type: 'ExtraAnswer'
|
195
|
+
type: 'ExtraAnswer'
|
196
196
|
},
|
197
197
|
{
|
198
198
|
childQuestions: ['3', '4'],
|
@@ -200,7 +200,7 @@ describe('Extra answers validation', () => {
|
|
200
200
|
maxAnswers: 1,
|
201
201
|
minAnswers: 0,
|
202
202
|
elementType: 'section',
|
203
|
-
type: 'ExtraAnswer'
|
203
|
+
type: 'ExtraAnswer'
|
204
204
|
},
|
205
205
|
{
|
206
206
|
childQuestions: ['4.1', '4.2'],
|
@@ -208,23 +208,23 @@ describe('Extra answers validation', () => {
|
|
208
208
|
maxAnswers: 1,
|
209
209
|
minAnswers: undefined,
|
210
210
|
elementType: 'question',
|
211
|
-
type: 'ExtraAnswer'
|
212
|
-
}
|
211
|
+
type: 'ExtraAnswer'
|
212
|
+
}
|
213
213
|
]);
|
214
214
|
});
|
215
215
|
});
|
216
216
|
const answerQuestions = (...displayNumbers) => answerQuestionsWithText('foo', ...displayNumbers);
|
217
217
|
const answerQuestionsWithText = (text, ...displayNumbers) => {
|
218
|
-
const findQuestionId = (displayNumber) => gradingStructure.questions.find(
|
218
|
+
const findQuestionId = (displayNumber) => gradingStructure.questions.find(q => q.displayNumber === displayNumber).id;
|
219
219
|
const createAnswer = (questionId) => ({
|
220
220
|
questionId,
|
221
221
|
type: 'text',
|
222
222
|
value: text,
|
223
|
-
characterCount: text.length
|
223
|
+
characterCount: text.length
|
224
224
|
});
|
225
225
|
const questionIds = displayNumbers.map(findQuestionId);
|
226
226
|
const answers = questionIds.map(createAnswer);
|
227
227
|
return _.zipObject(questionIds, answers);
|
228
228
|
};
|
229
|
-
const subsets = (array) => array.reduce((subsets, value) => subsets.concat(subsets.map(
|
229
|
+
const subsets = (array) => array.reduce((subsets, value) => subsets.concat(subsets.map(set => [...set, value])), [[]]);
|
230
230
|
//# sourceMappingURL=validateAnswers.test.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validateAnswers.test.js","sourceRoot":"","sources":["../../__tests__/validateAnswers.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAwD;AACxD,wEAA+C;AAC/C,yEAAkF;AAClF,yEAAkF;AAClF,yEAA0D;AAE1D,0CAA2B;AAE3B,IAAI,aAA0B,CAAA;AAC9B,IAAI,gBAAkC,CAAA;AAEtC,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAAM,IAAI,GAAG,IAAA,oCAAY,EAAC;QACxB,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE;YACR;gBACE,SAAS,EAAE;oBACT,IAAA,gCAAQ,EAAC,CAAC,IAAA,kCAAU,EAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBACxC,IAAA,gCAAQ,EAAC,EAAE,SAAS,EAAE,CAAC,IAAA,gCAAQ,EAAC,CAAC,IAAA,kCAAU,EAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAA,gCAAQ,EAAC,CAAC,IAAA,kCAAU,GAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC9F;aACF;YACD;gBACE,UAAU,EAAE,CAAC;gBACb,SAAS,EAAE;oBACT,IAAA,gCAAQ,EAAC,CAAC,IAAA,kCAAU,GAAE,CAAC,CAAC;oBACxB,IAAA,gCAAQ,EAAC,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,IAAA,gCAAQ,EAAC,CAAC,IAAA,kCAAU,GAAE,CAAC,CAAC,EAAE,IAAA,gCAAQ,EAAC,CAAC,IAAA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;YACtF;gBACE,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;gBAC1B,aAAa,EAAE,EAAE;gBACjB,UAAU,EAAE,CAAC;gBACb,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,MAAM;gBACnB,IAAI,EAAE,aAAa;aACpB;YACD;gBACE,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;gBAC1B,aAAa,EAAE,GAAG;gBAClB,UAAU,EAAE,CAAC;gBACb,UAAU,EAAE,CAAC;gBACb,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,aAAa;aACpB;YACD;gBACE,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC9B,aAAa,EAAE,GAAG;gBAClB,UAAU,EAAE,CAAC;gBACb,UAAU,EAAE,SAAS;gBACrB,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,aAAa;aACpB;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC,GAAG,cAAwB,EAA8B,EAAE,CAClF,uBAAuB,CAAC,KAAK,EAAE,GAAG,cAAc,CAAC,CAAA;AAEnD,MAAM,uBAAuB,GAAG,CAAC,IAAY,EAAE,GAAG,cAAwB,EAA8B,EAAE;IACxG,MAAM,cAAc,GAAG,CAAC,aAAqB,EAAE,EAAE,CAC/C,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,
|
1
|
+
{"version":3,"file":"validateAnswers.test.js","sourceRoot":"","sources":["../../__tests__/validateAnswers.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAAwD;AACxD,wEAA+C;AAC/C,yEAAkF;AAClF,yEAAkF;AAClF,yEAA0D;AAE1D,0CAA2B;AAE3B,IAAI,aAA0B,CAAA;AAC9B,IAAI,gBAAkC,CAAA;AAEtC,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,MAA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?: boolean;
|
14
14
|
}
|
15
|
-
declare function AnswerToolbar({ answer, element, screenshotError, validationError, selectAnswerVersion, showAnswerHistory, supportsAnswerHistory
|
15
|
+
declare function AnswerToolbar({ answer, element, screenshotError, validationError, selectAnswerVersion, showAnswerHistory, supportsAnswerHistory }: AnswerToolbarProps): JSX.Element;
|
16
16
|
declare const _default: React.MemoExoticComponent<typeof AnswerToolbar>;
|
17
17
|
export default _default;
|
18
18
|
//# sourceMappingURL=AnswerToolbar.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnswerToolbar.d.ts","sourceRoot":"","sources":["../../src/components/AnswerToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AAG/C,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,UAAU,GAAG,cAAc,CAAA;IACpC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,eAAe,CAAC,EAAE,aAAa,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,mBAAmB,CAAC,EAAE,OAAO,OAAO,CAAC,mBAAmB,CAAA;IACxD,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,iBAAyB,EACzB,qBAA6B,
|
1
|
+
{"version":3,"file":"AnswerToolbar.d.ts","sourceRoot":"","sources":["../../src/components/AnswerToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AAG/C,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,UAAU,kBAAkB;IAC1B,MAAM,CAAC,EAAE,UAAU,GAAG,cAAc,CAAA;IACpC,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,eAAe,CAAC,EAAE,aAAa,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,mBAAmB,CAAC,EAAE,OAAO,OAAO,CAAC,mBAAmB,CAAA;IACxD,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,iBAAyB,EACzB,qBAA6B,EAC9B,EAAE,kBAAkB,eAoDpB;;AAED,wBAAwC"}
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
3
3
|
import { findChildElement, getNumericAttribute, NBSP, queryAncestors } from '../dom-utils';
|
4
4
|
import { useExamTranslation } from '../i18n';
|
5
|
-
function AnswerToolbar({ answer, element, screenshotError, validationError, selectAnswerVersion, showAnswerHistory = false, supportsAnswerHistory = false
|
5
|
+
function AnswerToolbar({ answer, element, screenshotError, validationError, selectAnswerVersion, showAnswerHistory = false, supportsAnswerHistory = false }) {
|
6
6
|
const { t } = useExamTranslation();
|
7
7
|
const answerLength = answer === null || answer === void 0 ? void 0 : answer.characterCount;
|
8
8
|
const maxLength = getNumericAttribute(element, 'max-length');
|
@@ -11,7 +11,7 @@ function AnswerToolbar({ answer, element, screenshotError, validationError, sele
|
|
11
11
|
answer != null
|
12
12
|
? t(maxLength != null ? 'answer-length-with-max-length' : 'answer-length', {
|
13
13
|
count: answerLength,
|
14
|
-
maxLength: maxLength
|
14
|
+
maxLength: maxLength
|
15
15
|
})
|
16
16
|
: NBSP,
|
17
17
|
screenshotError ? (React.createElement("span", { className: "e-color-error", role: "alert" },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnswerToolbar.js","sourceRoot":"","sources":["../../src/components/AnswerToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAe5C,SAAS,aAAa,CAAC,EACrB,MAAM,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,iBAAiB,GAAG,KAAK,EACzB,qBAAqB,GAAG,KAAK,
|
1
|
+
{"version":3,"file":"AnswerToolbar.js","sourceRoot":"","sources":["../../src/components/AnswerToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAe5C,SAAS,aAAa,CAAC,EACrB,MAAM,EACN,OAAO,EACP,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,iBAAiB,GAAG,KAAK,EACzB,qBAAqB,GAAG,KAAK,EACV;IACnB,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,YAAY,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,CAAA;IAC3C,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC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AAC,WAAY,CAAC,CAAA;iBACnE;YACH,CAAC,IAEA,CAAC,CAAC,0BAA0B,CAAC,CACvB,CACV,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CACG,CACP,CACG,CACF,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA"}
|
@@ -2,7 +2,7 @@ import * as _ from 'lodash-es';
|
|
2
2
|
import React from 'react';
|
3
3
|
import { useExamTranslation } from '../i18n';
|
4
4
|
function AnsweringInstructions({ maxAnswers, minAnswers, elementType, childQuestions }) {
|
5
|
-
const childDisplayNumbers = childQuestions.map(
|
5
|
+
const childDisplayNumbers = childQuestions.map(question => _.isString(question) ? question : question.getAttribute('display-number'));
|
6
6
|
const { t } = useExamTranslation();
|
7
7
|
const possibleTranslationStrings = cartesian([childDisplayNumbers.length, '*'], [maxAnswers, '*'], [minAnswers != null ? minAnswers : maxAnswers, '*']).map(([childQuestionCount, maxAnswerCount, minAnswerCount]) => `answering-instructions.${elementType}_${childQuestionCount}_${minAnswerCount}_${maxAnswerCount}`);
|
8
8
|
const answerCount = [minAnswers, maxAnswers];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnsweringInstructions.js","sourceRoot":"","sources":["../../src/components/AnsweringInstructions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAS5C,SAAS,qBAAqB,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAA6B;IAC/G,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAAC,
|
1
|
+
{"version":3,"file":"AnsweringInstructions.js","sourceRoot":"","sources":["../../src/components/AnsweringInstructions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,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E;QAClB,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE;YAClB,KAAK,MAAM,CAAC,IAAI,EAAE,EAAE;gBAClB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;aACvB;SACF;KACF;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useLayoutEffect, useRef } from 'react';
|
2
2
|
/** A helper component that sets document.title based on its contents. */
|
3
|
-
const DocumentTitle =
|
3
|
+
const DocumentTitle = props => {
|
4
4
|
const ref = useRef(null);
|
5
5
|
useLayoutEffect(() => {
|
6
6
|
if (ref.current) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DocumentTitle.js","sourceRoot":"","sources":["../../src/components/DocumentTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAItD,yEAAyE;AACzE,MAAM,aAAa,GAAgD,
|
1
|
+
{"version":3,"file":"DocumentTitle.js","sourceRoot":"","sources":["../../src/components/DocumentTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAItD,yEAAyE;AACzE,MAAM,aAAa,GAAgD,KAAK,CAAC,EAAE;IACzE,MAAM,GAAG,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAA;IAC5C,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,GAAG,CAAC,OAAO,EAAE;YACf,QAAQ,CAAC,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,WAAY,CAAA;SAC1C;IACH,CAAC,CAAC,CAAA;IACF,OAAO,+BAAQ,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CAAA;AACpC,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import classNames from 'classnames';
|
2
2
|
import React from 'react';
|
3
|
-
const SectionElement =
|
3
|
+
const SectionElement = props => {
|
4
4
|
const className = classNames('e-section e-bg-color-off-white e-pad-6', props.className);
|
5
5
|
return React.createElement("section", { ...props, className }, props.children);
|
6
6
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SectionElement.js","sourceRoot":"","sources":["../../src/components/SectionElement.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,cAAc,GAEhB,
|
1
|
+
{"version":3,"file":"SectionElement.js","sourceRoot":"","sources":["../../src/components/SectionElement.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,cAAc,GAEhB,KAAK,CAAC,EAAE;IACV,MAAM,SAAS,GAAG,UAAU,CAAC,wCAAwC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;IACvF,OAAO,iCAAe,GAAG,KAAK,EAAE,SAAS,IAAK,KAAK,CAAC,QAAQ,CAAW,CAAA;AACzE,CAAC,CAAA;AAED,eAAe,cAAc,CAAA"}
|
@@ -21,7 +21,7 @@ const renderChildNodes = createRenderChildNodes({
|
|
21
21
|
'external-material': AttachmentsExternalMaterial,
|
22
22
|
'question-title': AttachmentsQuestionTitle,
|
23
23
|
question: AttachmentsQuestion,
|
24
|
-
section: withSectionContext(RenderChildNodes)
|
24
|
+
section: withSectionContext(RenderChildNodes)
|
25
25
|
});
|
26
26
|
const Attachments = () => {
|
27
27
|
const { root, language, date, dateTimeFormatter, dayCode, examCode, resolveAttachment, subjectLanguage } = useContext(CommonExamContext);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExternalMaterial.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/ExternalMaterial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAA0B,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;
|
1
|
+
{"version":3,"file":"ExternalMaterial.d.ts","sourceRoot":"","sources":["../../../src/components/attachments/ExternalMaterial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAA0B,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAoCzF,UAAU,gCAAiC,SAAQ,kBAAkB;IACnE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,iBAAS,gBAAgB,CAAC,EAAE,OAAO,EAAE,WAAmB,EAAE,EAAE,gCAAgC,sBAe3F;;AAED,wBAA2C"}
|
@@ -15,6 +15,8 @@ import surround from '../surround';
|
|
15
15
|
import Video from '../shared/Video';
|
16
16
|
import ImageOverlay from '../shared/ImageOverlay';
|
17
17
|
import RenderChildNodes from '../RenderChildNodes';
|
18
|
+
import { QuestionNumber } from '../shared/QuestionNumber';
|
19
|
+
import ExamTranslation from '../shared/ExamTranslation';
|
18
20
|
const renderChildNodes = createRenderChildNodes({
|
19
21
|
'attachment-link': mkAttachmentLink('link'),
|
20
22
|
'attachment-links': mkAttachmentLinks('link'),
|
@@ -26,8 +28,10 @@ const renderChildNodes = createRenderChildNodes({
|
|
26
28
|
image: Image,
|
27
29
|
video: Video,
|
28
30
|
formula: Formula,
|
31
|
+
'question-number': QuestionNumber,
|
32
|
+
translation: ExamTranslation,
|
29
33
|
reference: surround(Reference, 'div', { className: 'e-mrg-y-2 e-font-size-s' }),
|
30
|
-
'image-overlay': ImageOverlay
|
34
|
+
'image-overlay': ImageOverlay
|
31
35
|
});
|
32
36
|
function ExternalMaterial({ element, forceRender = false }) {
|
33
37
|
if (queryAncestors(element, 'question') == null && !forceRender) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExternalMaterial.js","sourceRoot":"","sources":["../../../src/components/attachments/ExternalMaterial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAsB,MAAM,8BAA8B,CAAA;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,oBAAoB,MAAM,0BAA0B,CAAA;AAC3D,OAAO,IAAI,MAAM,gBAAgB,CAAA;AACjC,OAAO,OAAO,MAAM,mBAAmB,CAAA;AACvC,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,SAAS,MAAM,qBAAqB,CAAA;AAC3C,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,YAAY,MAAM,wBAAwB,CAAA;AACjD,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;
|
1
|
+
{"version":3,"file":"ExternalMaterial.js","sourceRoot":"","sources":["../../../src/components/attachments/ExternalMaterial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAsB,MAAM,8BAA8B,CAAA;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,UAAU,MAAM,cAAc,CAAA;AACrC,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,oBAAoB,MAAM,0BAA0B,CAAA;AAC3D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AoB,IAAO,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,GAAM,CAC3F;QACA,gBAAgB,CAAC,OAAO,CAAC,CACzB,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA"}
|
@@ -10,7 +10,7 @@ function Question({ element, renderChildNodes }) {
|
|
10
10
|
function isTopmostQuestionContainingExternalMaterial(element, hasExternalMaterial, level) {
|
11
11
|
return (hasExternalMaterial &&
|
12
12
|
(level === 0 ||
|
13
|
-
parentElements(element).every(
|
13
|
+
parentElements(element).every(parent => parent.localName === 'question' ? !findChildElement(parent, 'external-material') : true)));
|
14
14
|
}
|
15
15
|
export default React.memo(withQuestionContext(Question));
|
16
16
|
//# sourceMappingURL=Question.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../../src/components/attachments/Question.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACjF,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C,SAAS,QAAQ,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACjE,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAEjF,OAAO,2CAA2C,CAAC,OAAO,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CACxF,oBAAC,cAAc,IAAC,EAAE,EAAE,aAAa,qBAAmB,eAAe,CAAC,aAAa,CAAC,IAC/E,gBAAgB,CAAC,OAAO,iCAAyB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MAAM,CAAC,EAAE,CACrC,MAAM,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI,CACxF,CAAC,CACL,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAA"}
|
@@ -5,7 +5,7 @@ export const withExamContext = withContext(ExamContext, (props) => {
|
|
5
5
|
const { casCountdownDuration, examServerApi } = props;
|
6
6
|
return {
|
7
7
|
casCountdownDuration: casCountdownDuration || 60,
|
8
|
-
examServerApi
|
8
|
+
examServerApi
|
9
9
|
};
|
10
10
|
});
|
11
11
|
//# sourceMappingURL=ExamContext.js.map
|
@@ -21,7 +21,7 @@ export const withQuestionContext = withContext(QuestionContext, ({ element }) =>
|
|
21
21
|
maxScore: getNumericAttribute(element, 'max-score'),
|
22
22
|
level: parentElements(element, 'question').length,
|
23
23
|
childQuestions,
|
24
|
-
questionLabelIds
|
24
|
+
questionLabelIds
|
25
25
|
};
|
26
26
|
});
|
27
27
|
//# sourceMappingURL=QuestionContext.js.map
|
@@ -13,11 +13,11 @@ export const withResultsContext = withContext(ResultsContext, ({ scores, doc, gr
|
|
13
13
|
scores,
|
14
14
|
totalScore,
|
15
15
|
gradingText,
|
16
|
-
singleGrading
|
16
|
+
singleGrading
|
17
17
|
};
|
18
18
|
});
|
19
19
|
export function findMultiChoiceFromGradingStructure(gradingStructure, id) {
|
20
|
-
const choiceGroups = gradingStructure.questions.filter(
|
20
|
+
const choiceGroups = gradingStructure.questions.filter(v => v.type === 'choicegroup');
|
21
21
|
for (let i = 0, length = choiceGroups.length; i < length; i++) {
|
22
22
|
const choiceGroup = choiceGroups[i];
|
23
23
|
for (let j = 0, choicesLength = choiceGroup.choices.length; j < choicesLength; j++) {
|
@@ -29,15 +29,15 @@ export function findMultiChoiceFromGradingStructure(gradingStructure, id) {
|
|
29
29
|
return undefined;
|
30
30
|
}
|
31
31
|
export function findScore(scores, questionId) {
|
32
|
-
return scores.find(
|
32
|
+
return scores.find(a => a.questionId === questionId);
|
33
33
|
}
|
34
34
|
export function calculateQuestionsTotalSumScore(topLevelQuestions, gradingStructure, scores, answersByQuestionId) {
|
35
|
-
return _.sum(topLevelQuestions.map(
|
35
|
+
return _.sum(topLevelQuestions.map(question => calculateQuestionSumScore(question, gradingStructure, scores, answersByQuestionId)));
|
36
36
|
}
|
37
37
|
export function calculateQuestionSumScore(questionElement, gradingStructure, scores, answersById) {
|
38
38
|
const choiceQuestionScore = (questionId, scoredAnswer) => {
|
39
39
|
const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionId);
|
40
|
-
return choice ? choice.options.find(
|
40
|
+
return choice ? choice.options.find(o => o.id === Number(scoredAnswer.value)).score : 0;
|
41
41
|
};
|
42
42
|
const textQuestionScore = (questionId) => {
|
43
43
|
var _a, _b;
|
@@ -46,7 +46,7 @@ export function calculateQuestionSumScore(questionElement, gradingStructure, sco
|
|
46
46
|
? ((_b = [score.inspection, (_a = score.censoring) === null || _a === void 0 ? void 0 : _a.scores[0], score.autograding, score.pregrading].find(Boolean)) === null || _b === void 0 ? void 0 : _b.score) || 0
|
47
47
|
: 0;
|
48
48
|
};
|
49
|
-
const sumScore = _.sum(findChildrenAnswers(questionElement).map(
|
49
|
+
const sumScore = _.sum(findChildrenAnswers(questionElement).map(answer => {
|
50
50
|
const questionId = getNumericAttribute(answer, 'question-id');
|
51
51
|
const scoredAnswer = answersById[questionId];
|
52
52
|
if (!scoredAnswer) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ResultsContext.js","sourceRoot":"","sources":["../../../src/components/context/ResultsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,EA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AC;YAC/G,CAAC,CAAC,CAAC,CAAA;IACP,CAAC,CAAA;IAED,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CACpB,mBAAmB,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAChD,MAAM,UAAU,GAAG,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAE,CAAA;QAC9D,MAAM,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,CAAA;QAC5C,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO,CAAC,CAAA;SACT;QACD,IAAI,YAAY,CAAC,IAAI,KAAK,QAAQ,EAAE;YAClC,OAAO,mBAAmB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;SACrD;aAAM;YACL,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAA;SACrC;IACH,CAAC,CAAC,CACH,CAAA;IACD,oDAAoD;IACpD,IAAI,cAAc,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE;QAC5E,OAAO,CAAC,CAAA;KACT;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
@@ -8,14 +8,14 @@ export const withSectionContext = withContext(SectionContext, ({ element }) => {
|
|
8
8
|
const maxAnswers = getNumericAttribute(element, 'max-answers');
|
9
9
|
const minAnswers = getNumericAttribute(element, 'min-answers');
|
10
10
|
const maxScore = getNumericAttribute(element, 'max-score');
|
11
|
-
const childQuestions = mapChildElements(element,
|
11
|
+
const childQuestions = mapChildElements(element, childElement => childElement).filter(parentNode => parentNode.localName === 'question');
|
12
12
|
return {
|
13
13
|
casForbidden,
|
14
14
|
displayNumber,
|
15
15
|
maxAnswers,
|
16
16
|
minAnswers,
|
17
17
|
maxScore,
|
18
|
-
childQuestions
|
18
|
+
childQuestions
|
19
19
|
};
|
20
20
|
});
|
21
21
|
//# sourceMappingURL=SectionContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SectionContext.js","sourceRoot":"","sources":["../../../src/components/context/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAY3C,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAiB,EAAoB,CAAC,CAAA;AAEvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAqC,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IAChH,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;IAClE,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAC7D,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAE,CAAA;IAC3D,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"SectionContext.js","sourceRoot":"","sources":["../../../src/components/context/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAY3C,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAiB,EAAoB,CAAC,CAAA;AAEvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAqC,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IAChH,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;IAClE,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAC7D,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAE,CAAA;IAC3D,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,MAAM,CACnF,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,KAAK,UAAU,CAClD,CAAA;IAED,OAAO;QACL,YAAY;QACZ,aAAa;QACb,UAAU;QACV,UAAU;QACV,QAAQ;QACR,cAAc;KACf,CAAA;AACH,CAAC,CAAC,CAAA"}
|
@@ -4,14 +4,14 @@ import { useDispatch, useSelector } from 'react-redux';
|
|
4
4
|
import { getNumericAttribute, mapChildElements, query } from '../../dom-utils';
|
5
5
|
import { QuestionContext } from '../context/QuestionContext';
|
6
6
|
import { saveAnswer } from '../../store/answers/actions';
|
7
|
-
const ChoiceAnswerOption = ({ selected, element, renderChildNodes, questionId, onSelect, direction, value
|
7
|
+
const ChoiceAnswerOption = ({ selected, element, renderChildNodes, questionId, onSelect, direction, value }) => {
|
8
8
|
const className = element.getAttribute('class');
|
9
9
|
const content = (React.createElement("div", { className: classNames('e-choice-answer-option e-column', className, {
|
10
|
-
'e-choice-answer-option--selected': selected
|
10
|
+
'e-choice-answer-option--selected': selected
|
11
11
|
}) }, renderChildNodes(element)));
|
12
12
|
return direction === 'vertical' ? (React.createElement("div", { className: "e-mrg-b-1" },
|
13
13
|
React.createElement("label", { className: classNames('e-columns', {
|
14
|
-
'e-columns--inline': query(element, ['image', 'video']) == null /* Force full width for options containing responsive media
|
14
|
+
'e-columns--inline': query(element, ['image', 'video']) == null /* Force full width for options containing responsive media */
|
15
15
|
}) },
|
16
16
|
React.createElement("input", { type: "radio", className: "e-radio-button e-column e-column--narrow", name: String(questionId), onChange: onSelect, value: value, checked: selected }),
|
17
17
|
content))) : (React.createElement("div", { className: "e-column e-mrg-b-1" },
|
@@ -27,12 +27,12 @@ const ChoiceAnswer = ({ element, renderChildNodes }) => {
|
|
27
27
|
const { questionLabelIds } = useContext(QuestionContext);
|
28
28
|
const answer = useSelector((state) => state.answers.answersById[questionId]);
|
29
29
|
const dispatch = useDispatch();
|
30
|
-
const onSelect = useCallback(
|
30
|
+
const onSelect = useCallback(event => {
|
31
31
|
dispatch(saveAnswer({ type: 'choice', questionId, value: event.currentTarget.value, displayNumber }));
|
32
32
|
}, [questionId, displayNumber]);
|
33
33
|
return (React.createElement("div", { className: classNames('e-choice-answer e-mrg-b-4', className, {
|
34
|
-
'e-columns': direction === 'horizontal'
|
35
|
-
}), "data-question-id": questionId, role: "radiogroup", "aria-labelledby": questionLabelIds }, mapChildElements(element,
|
34
|
+
'e-columns': direction === 'horizontal'
|
35
|
+
}), "data-question-id": questionId, role: "radiogroup", "aria-labelledby": questionLabelIds }, mapChildElements(element, childElement => {
|
36
36
|
const optionId = childElement.getAttribute('option-id');
|
37
37
|
const isNoAnswer = childElement.getAttribute('type') === 'no-answer';
|
38
38
|
const value = isNoAnswer ? '' : optionId;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChoiceAnswer.js","sourceRoot":"","sources":["../../../src/components/exam/ChoiceAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,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IAC9B,MAAM,QAAQ,GAAG,WAAW,CAC1B,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,CAAA;IACvG,CAAC,EACD,CAAC,UAAU,EAAE,aAAa,CAAC,CAC5B,CAAA;IAED,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,SAAS,EAAE;YAC5D,WAAW,EAAE,SAAS,KAAK,YAAY;SACxC,CAAC,sBACgB,UAAU,EAC5B,IAAI,EAAC,YAAY,qBACA,gBAAgB,IAEhC,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE;QACxC,MAAM,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAC,WAAW,CAAE,CAAA;QACxD,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,WAAW,CAAA;QACpE,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAA;QACxC,MAAM,QAAQ,GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,KAAK,CAAA;QAEzD,OAAO,CACL,oBAAC,kBAAkB,IAEf,OAAO,EAAE,YAAY;YACrB,QAAQ;YACR,gBAAgB;YAChB,UAAU;YACV,GAAG,EAAE,QAAQ;YACb,SAAS;YACT,QAAQ;YACR,KAAK,GAEP,CACH,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA"}
|
@@ -24,7 +24,7 @@ const DropdownAnswer = ({ element, renderChildNodes }) => {
|
|
24
24
|
const displayNumber = element.getAttribute('display-number');
|
25
25
|
const currentlySelectedItem = answer &&
|
26
26
|
answer.value &&
|
27
|
-
findChildElement(element,
|
27
|
+
findChildElement(element, childElement => answer.value === childElement.getAttribute('option-id'));
|
28
28
|
const labelRef = useRef(null);
|
29
29
|
const menuRef = React.useRef(null);
|
30
30
|
const [measuring, setMeasuring] = useState(true);
|
@@ -32,13 +32,13 @@ const DropdownAnswer = ({ element, renderChildNodes }) => {
|
|
32
32
|
// Force a re-measure if element changes or fonts are loaded after this
|
33
33
|
// component has been rendered.
|
34
34
|
const [, setFontsLoaded] = useState(fonts.loaded);
|
35
|
-
fonts.ready.then(() => setFontsLoaded(true)).catch(
|
35
|
+
fonts.ready.then(() => setFontsLoaded(true)).catch(err => console.error(err));
|
36
36
|
useEffect(() => setMeasuring(true), [element]);
|
37
37
|
useEffect(() => {
|
38
38
|
if (measuring && menuRef.current && labelRef.current) {
|
39
39
|
const menuEl = menuRef.current;
|
40
40
|
const labelEl = labelRef.current;
|
41
|
-
const preferredWidth = _.max(mapChildElements(menuEl,
|
41
|
+
const preferredWidth = _.max(mapChildElements(menuEl, el => el.firstElementChild.scrollWidth));
|
42
42
|
// Run the DOM mutations on the next frame to avoid layout trashing in exams with lots of dropdowns.
|
43
43
|
const requestId = requestAnimationFrame(() => {
|
44
44
|
labelEl.style.width = `${preferredWidth + menuBorderWidthPx + roundingErrorCompensationPx}px`;
|
@@ -52,22 +52,22 @@ const DropdownAnswer = ({ element, renderChildNodes }) => {
|
|
52
52
|
const { answers, questionLabelIds } = useContext(QuestionContext);
|
53
53
|
const { getItemProps, getMenuProps, getToggleButtonProps, highlightedIndex, isOpen, selectedItem } = useSelect({
|
54
54
|
items,
|
55
|
-
itemToString:
|
55
|
+
itemToString: item => (item ? item.textContent : ''),
|
56
56
|
onSelectedItemChange: ({ selectedItem }) => {
|
57
57
|
const value = selectedItem ? selectedItem.getAttribute('option-id') : '';
|
58
58
|
dispatch(saveAnswer({ type: 'choice', questionId, value, displayNumber }));
|
59
59
|
},
|
60
|
-
initialSelectedItem: currentlySelectedItem
|
60
|
+
initialSelectedItem: currentlySelectedItem
|
61
61
|
});
|
62
62
|
const { t } = useExamTranslation();
|
63
63
|
const scoreId = answerScoreId(element);
|
64
64
|
return (React.createElement("span", { className: "e-nowrap" },
|
65
65
|
React.createElement("span", { className: classNames('e-dropdown-answer e-normal'), "data-question-id": questionId },
|
66
66
|
React.createElement("button", { className: classNames('e-dropdown-answer__toggle-button e-button-plain e-columns', {
|
67
|
-
'e-dropdown-answer__toggle-button--open': isOpen
|
67
|
+
'e-dropdown-answer__toggle-button--open': isOpen
|
68
68
|
}), ...getToggleButtonProps({
|
69
69
|
'aria-describedby': scoreId,
|
70
|
-
'aria-labelledby': questionLabelIds
|
70
|
+
'aria-labelledby': questionLabelIds
|
71
71
|
}, { suppressRefError: !runningInBrowser }) },
|
72
72
|
React.createElement("span", { className: "e-dropdown-answer__label e-column e-pad-l-1 e-pad-r-4" },
|
73
73
|
React.createElement("span", { className: "e-ellipsis e-block", ref: labelRef }, selectedItem ? (renderChildNodes(selectedItem)) : (React.createElement("span", { "aria-label": t.raw('dropdown-answer.label') }, NBSP)))),
|
@@ -76,14 +76,14 @@ const DropdownAnswer = ({ element, renderChildNodes }) => {
|
|
76
76
|
React.createElement("span", { ...getMenuProps({
|
77
77
|
className: classNames('e-dropdown-answer__menu', { 'e-dropdown-answer__menu--open': isOpen }),
|
78
78
|
'aria-labelledby': undefined,
|
79
|
-
ref: menuRef
|
79
|
+
ref: menuRef
|
80
80
|
}, { suppressRefError: !runningInBrowser }) }, items.map((item, i) => (React.createElement("span", { className: classNames('e-dropdown-answer__menu-item e-block e-pad-l-1 e-pad-r-4', {
|
81
81
|
'e-dropdown-answer__menu-item--selected': item === selectedItem,
|
82
82
|
'e-bg-color-off-white': highlightedIndex !== i,
|
83
|
-
'e-bg-color-link e-color-off-white': highlightedIndex === i
|
83
|
+
'e-bg-color-link e-color-off-white': highlightedIndex === i
|
84
84
|
}), key: i, ...getItemProps({
|
85
85
|
item,
|
86
|
-
index: i
|
86
|
+
index: i
|
87
87
|
}) },
|
88
88
|
React.createElement("span", { className: classNames('e-dropdown-answer__menu-item-inner e-block', { 'e-nowrap': measuring }) }, item ? renderChildNodes(item) : React.createElement("span", { "aria-label": t.raw('dropdown-answer.clear') }, NBSP))))))),
|
89
89
|
answers.length > 1 && React.createElement(Score, { score: maxScore, size: 'inline', id: scoreId })));
|