@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
@@ -19,26 +19,26 @@ describe('<AnsweringInstructions />', () => {
|
|
19
19
|
expectRendering({
|
20
20
|
maxAnswers: 1,
|
21
21
|
elementType: 'question',
|
22
|
-
childQuestions: mkQuestions(range(1, 10, '1.'))
|
22
|
+
childQuestions: mkQuestions(range(1, 10, '1.'))
|
23
23
|
});
|
24
24
|
expectRendering({
|
25
25
|
maxAnswers: 5,
|
26
26
|
elementType: 'question',
|
27
|
-
childQuestions: mkQuestions(range(1, 10, '1.'))
|
27
|
+
childQuestions: mkQuestions(range(1, 10, '1.'))
|
28
28
|
});
|
29
29
|
});
|
30
30
|
it('2 child questions and maxAnswers = 1', () => {
|
31
31
|
expectRendering({
|
32
32
|
maxAnswers: 1,
|
33
33
|
elementType: 'question',
|
34
|
-
childQuestions: mkQuestions(range(1, 2, '1.'))
|
34
|
+
childQuestions: mkQuestions(range(1, 2, '1.'))
|
35
35
|
});
|
36
36
|
});
|
37
37
|
it('fallback', () => {
|
38
38
|
expectRendering({
|
39
39
|
maxAnswers: 11,
|
40
40
|
elementType: 'question',
|
41
|
-
childQuestions: mkQuestions(range(1, 12, '1.'))
|
41
|
+
childQuestions: mkQuestions(range(1, 12, '1.'))
|
42
42
|
});
|
43
43
|
});
|
44
44
|
});
|
@@ -47,19 +47,19 @@ describe('<AnsweringInstructions />', () => {
|
|
47
47
|
expectRendering({
|
48
48
|
maxAnswers: 1,
|
49
49
|
elementType: 'section',
|
50
|
-
childQuestions: mkQuestions(range(1, 10))
|
50
|
+
childQuestions: mkQuestions(range(1, 10))
|
51
51
|
});
|
52
52
|
expectRendering({
|
53
53
|
maxAnswers: 5,
|
54
54
|
elementType: 'section',
|
55
|
-
childQuestions: mkQuestions(range(1, 10))
|
55
|
+
childQuestions: mkQuestions(range(1, 10))
|
56
56
|
});
|
57
57
|
});
|
58
58
|
it('2 child questions and maxAnswers = 1', () => {
|
59
59
|
expectRendering({
|
60
60
|
maxAnswers: 1,
|
61
61
|
elementType: 'section',
|
62
|
-
childQuestions: mkQuestions(range(1, 2))
|
62
|
+
childQuestions: mkQuestions(range(1, 2))
|
63
63
|
});
|
64
64
|
});
|
65
65
|
it('fallback', () => {
|
@@ -67,17 +67,17 @@ describe('<AnsweringInstructions />', () => {
|
|
67
67
|
minAnswers: 2,
|
68
68
|
maxAnswers: 5,
|
69
69
|
elementType: 'section',
|
70
|
-
childQuestions: mkQuestions(range(1, 12))
|
70
|
+
childQuestions: mkQuestions(range(1, 12))
|
71
71
|
});
|
72
72
|
expectRendering({
|
73
73
|
maxAnswers: 11,
|
74
74
|
elementType: 'section',
|
75
|
-
childQuestions: mkQuestions(range(1, 12))
|
75
|
+
childQuestions: mkQuestions(range(1, 12))
|
76
76
|
});
|
77
77
|
});
|
78
78
|
});
|
79
79
|
function range(start, end, prefix = '') {
|
80
|
-
return lodash_1.default.range(start, end + 1).map(
|
80
|
+
return lodash_1.default.range(start, end + 1).map(n => `${prefix}${n}`);
|
81
81
|
}
|
82
82
|
function expectRendering(props) {
|
83
83
|
const container = react_test_renderer_1.default.create(react_1.default.createElement(react_i18next_1.I18nextProvider, { i18n: i18n },
|
@@ -85,7 +85,7 @@ describe('<AnsweringInstructions />', () => {
|
|
85
85
|
expect(container.toJSON()).toMatchSnapshot();
|
86
86
|
}
|
87
87
|
function mkQuestions(displayNumbers) {
|
88
|
-
return displayNumbers.map(
|
88
|
+
return displayNumbers.map(displayNumber => {
|
89
89
|
const question = document.createElement('question');
|
90
90
|
question.setAttribute('display-number', displayNumber);
|
91
91
|
return question;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnsweringInstructions.test.js","sourceRoot":"","sources":["../../__tests__/AnsweringInstructions.test.tsx"],"names":[],"mappings":";;;;;AACA,oDAAsB;AACtB,kDAAyB;AACzB,iDAA+C;AAC/C,8EAA8C;AAC9C,oGAA0G;AAC1G,sCAAsC;AAEtC,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,IAAkB,CAAA;IAEtB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,GAAG,IAAA,eAAQ,EAAC,OAAO,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE;YAClB,eAAe,CAAC;gBACd,UAAU,EAAE,CAAC;gBACb,WAAW,EAAE,UAAU;gBACvB,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;aAChD,CAAC,CAAA;YAEF,eAAe,CAAC;gBACd,UAAU,EAAE,CAAC;gBACb,WAAW,EAAE,UAAU;gBACvB,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EA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C,gBAAgB,EAAE,aAAa,CAAC,CAAA;YACtD,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"}
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.examServerApi = void 0;
|
4
4
|
exports.examServerApi = {
|
5
5
|
getAnswers: () => Promise.resolve([]),
|
6
|
-
setCasStatus:
|
6
|
+
setCasStatus: casStatus => Promise.resolve(casStatus),
|
7
7
|
saveAnswer: () => Promise.resolve(),
|
8
8
|
saveScreenshot: () => Promise.resolve('ok'),
|
9
9
|
playAudio: () => Promise.resolve('ok'),
|
10
|
-
playRestrictedAudio: () => Promise.resolve('ok')
|
10
|
+
playRestrictedAudio: () => Promise.resolve('ok')
|
11
11
|
};
|
12
12
|
//# sourceMappingURL=examServerApi.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"examServerApi.js","sourceRoot":"","sources":["../../__tests__/examServerApi.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAkB;IAC1C,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,YAAY,EAAE,
|
1
|
+
{"version":3,"file":"examServerApi.js","sourceRoot":"","sources":["../../__tests__/examServerApi.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAkB;IAC1C,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IACrD,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;IACnC,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IACtC,mBAAmB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;CACjD,CAAA"}
|
@@ -11,20 +11,20 @@ describe('renderAnnotations()', () => {
|
|
11
11
|
{
|
12
12
|
startIndex: 0,
|
13
13
|
length: 5,
|
14
|
-
message: 'foo'
|
15
|
-
}
|
14
|
+
message: 'foo'
|
15
|
+
}
|
16
16
|
], [])).toMatchSnapshot();
|
17
17
|
});
|
18
18
|
it('two text annotations, side by side', () => {
|
19
19
|
expect(render('Lorem ipsum dolor sit amet', [
|
20
20
|
{ startIndex: 0, length: 5, message: 'foo' },
|
21
|
-
{ startIndex: 5, length: 5, message: 'bar' }
|
21
|
+
{ startIndex: 5, length: 5, message: 'bar' }
|
22
22
|
], [])).toMatchSnapshot();
|
23
23
|
});
|
24
24
|
it('two text annotations with space in between', () => {
|
25
25
|
expect(render('Lorem ipsum dolor sit amet', [
|
26
26
|
{ startIndex: 0, length: 5, message: 'foo' },
|
27
|
-
{ startIndex: 10, length: 5, message: 'bar' }
|
27
|
+
{ startIndex: 10, length: 5, message: 'bar' }
|
28
28
|
], [])).toMatchSnapshot();
|
29
29
|
});
|
30
30
|
it('overlapping pregrading and censoring annotations', () => {
|
@@ -35,8 +35,8 @@ describe('renderAnnotations()', () => {
|
|
35
35
|
{
|
36
36
|
startIndex: 0,
|
37
37
|
length: 10,
|
38
|
-
message: 'foo'
|
39
|
-
}
|
38
|
+
message: 'foo'
|
39
|
+
}
|
40
40
|
], [])).toMatchSnapshot();
|
41
41
|
});
|
42
42
|
it('annotation starts after <br /> tags', () => {
|
@@ -44,8 +44,8 @@ describe('renderAnnotations()', () => {
|
|
44
44
|
{
|
45
45
|
startIndex: 0,
|
46
46
|
length: 5,
|
47
|
-
message: 'foo'
|
48
|
-
}
|
47
|
+
message: 'foo'
|
48
|
+
}
|
49
49
|
], [])).toMatchSnapshot();
|
50
50
|
});
|
51
51
|
it('rect annotation', () => {
|
@@ -57,8 +57,8 @@ describe('renderAnnotations()', () => {
|
|
57
57
|
x: 0.25,
|
58
58
|
y: 0.25,
|
59
59
|
height: 0.5,
|
60
|
-
width: 0.5
|
61
|
-
}
|
60
|
+
width: 0.5
|
61
|
+
}
|
62
62
|
], [])).toMatchSnapshot();
|
63
63
|
});
|
64
64
|
it('line annotation', () => {
|
@@ -70,8 +70,8 @@ describe('renderAnnotations()', () => {
|
|
70
70
|
x1: 0.25,
|
71
71
|
y1: 0.25,
|
72
72
|
x2: 0.75,
|
73
|
-
y2: 0.25
|
74
|
-
}
|
73
|
+
y2: 0.25
|
74
|
+
}
|
75
75
|
], [])).toMatchSnapshot();
|
76
76
|
});
|
77
77
|
it('checks the length of annotated images correctly in the text annotation code', () => {
|
@@ -83,7 +83,7 @@ describe('renderAnnotations()', () => {
|
|
83
83
|
x: 0,
|
84
84
|
y: 0,
|
85
85
|
width: 1,
|
86
|
-
height: 1
|
86
|
+
height: 1
|
87
87
|
},
|
88
88
|
{
|
89
89
|
type: 'rect',
|
@@ -92,14 +92,14 @@ describe('renderAnnotations()', () => {
|
|
92
92
|
x: 0,
|
93
93
|
y: 0,
|
94
94
|
width: 1,
|
95
|
-
height: 1
|
95
|
+
height: 1
|
96
96
|
},
|
97
97
|
{
|
98
98
|
type: 'text',
|
99
99
|
startIndex: 25,
|
100
100
|
message: 'Text annotation',
|
101
|
-
length: 5
|
102
|
-
}
|
101
|
+
length: 5
|
102
|
+
}
|
103
103
|
], [])).toMatchSnapshot();
|
104
104
|
});
|
105
105
|
it('throws an error if the answer is too short for the annotations', () => {
|
@@ -107,8 +107,8 @@ describe('renderAnnotations()', () => {
|
|
107
107
|
{
|
108
108
|
startIndex: 5,
|
109
109
|
length: 999,
|
110
|
-
message: 'Boom!'
|
111
|
-
}
|
110
|
+
message: 'Boom!'
|
111
|
+
}
|
112
112
|
], [])).toThrow(new Error('Bug: the answer seems to be too short for the current set of annotations.'));
|
113
113
|
});
|
114
114
|
});
|
@@ -28,25 +28,25 @@ const defaultScores = {
|
|
28
28
|
{
|
29
29
|
startIndex: 0,
|
30
30
|
length: 1,
|
31
|
-
message: 'Test pregrading annotation'
|
32
|
-
}
|
33
|
-
]
|
31
|
+
message: 'Test pregrading annotation'
|
32
|
+
}
|
33
|
+
]
|
34
34
|
},
|
35
35
|
censoring: {
|
36
36
|
scores: [
|
37
37
|
{ score: 4, shortCode: 'SE3' },
|
38
38
|
{ score: 3, shortCode: 'SE2' },
|
39
|
-
{ score: 2, shortCode: 'SE1' }
|
39
|
+
{ score: 2, shortCode: 'SE1' }
|
40
40
|
],
|
41
41
|
annotations: [
|
42
42
|
{
|
43
43
|
startIndex: 0,
|
44
44
|
length: 1,
|
45
|
-
message: 'Test censoring annotation'
|
46
|
-
}
|
47
|
-
]
|
45
|
+
message: 'Test censoring annotation'
|
46
|
+
}
|
47
|
+
]
|
48
48
|
},
|
49
|
-
inspection: { score: 5, shortCodes: ['IN1', 'IN2'] }
|
49
|
+
inspection: { score: 5, shortCodes: ['IN1', 'IN2'] }
|
50
50
|
};
|
51
51
|
const defaultAnswer = mkTextAnswer(1, '5.1', 12);
|
52
52
|
describe('<AnnotationList />', () => {
|
@@ -57,19 +57,19 @@ describe('<AnnotationList />', () => {
|
|
57
57
|
});
|
58
58
|
it('renders empty without score', () => {
|
59
59
|
const resultsProps = {
|
60
|
-
scores: []
|
60
|
+
scores: []
|
61
61
|
};
|
62
62
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
63
63
|
});
|
64
64
|
it('renders empty without annotations', () => {
|
65
65
|
const resultsProps = {
|
66
|
-
scores: [lodash_1.default.pick(defaultScores, 'answerId', 'questionId')]
|
66
|
+
scores: [lodash_1.default.pick(defaultScores, 'answerId', 'questionId')]
|
67
67
|
};
|
68
68
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
69
69
|
});
|
70
70
|
it('renders with only pregrading annotations', () => {
|
71
71
|
const resultsProps = {
|
72
|
-
scores: [lodash_1.default.pick(defaultScores, 'pregrading', 'answerId', 'questionId')]
|
72
|
+
scores: [lodash_1.default.pick(defaultScores, 'pregrading', 'answerId', 'questionId')]
|
73
73
|
};
|
74
74
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
75
75
|
});
|
@@ -85,49 +85,49 @@ describe('<AnnotationList />', () => {
|
|
85
85
|
{
|
86
86
|
startIndex: 0,
|
87
87
|
length: 1,
|
88
|
-
message: 'Before empty annotation'
|
88
|
+
message: 'Before empty annotation'
|
89
89
|
},
|
90
90
|
{
|
91
91
|
startIndex: 1,
|
92
92
|
length: 1,
|
93
|
-
message: ''
|
93
|
+
message: ''
|
94
94
|
},
|
95
95
|
{
|
96
96
|
startIndex: 2,
|
97
97
|
length: 1,
|
98
|
-
message: 'After empty annotation'
|
99
|
-
}
|
100
|
-
]
|
101
|
-
}
|
102
|
-
}
|
103
|
-
}
|
104
|
-
]
|
98
|
+
message: 'After empty annotation'
|
99
|
+
}
|
100
|
+
]
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
]
|
105
105
|
};
|
106
106
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
107
107
|
});
|
108
108
|
it('renders with only censoring annotations', () => {
|
109
109
|
const resultsProps = {
|
110
|
-
scores: [lodash_1.default.pick(defaultScores, 'censoring', 'answerId', 'questionId')]
|
110
|
+
scores: [lodash_1.default.pick(defaultScores, 'censoring', 'answerId', 'questionId')]
|
111
111
|
};
|
112
112
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
113
113
|
});
|
114
114
|
it('renders with pregrading and censoring annotations', () => {
|
115
115
|
const resultsProps = {
|
116
|
-
scores: [defaultScores]
|
116
|
+
scores: [defaultScores]
|
117
117
|
};
|
118
118
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
119
119
|
});
|
120
120
|
it('renders only pregrading without header on singleGrading in ResultContext', () => {
|
121
121
|
const resultsProps = {
|
122
122
|
scores: [defaultScores],
|
123
|
-
singleGrading: true
|
123
|
+
singleGrading: true
|
124
124
|
};
|
125
125
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
126
126
|
});
|
127
127
|
it('renders null if no scores and singleGrading in ResultContext', () => {
|
128
128
|
const resultsProps = {
|
129
129
|
scores: [],
|
130
|
-
singleGrading: true
|
130
|
+
singleGrading: true
|
131
131
|
};
|
132
132
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
133
133
|
});
|
@@ -136,7 +136,7 @@ describe('<AnnotationList />', () => {
|
|
136
136
|
it('renders with pregrading and censoring annotations', () => {
|
137
137
|
i18n = (0, i18n_1.initI18n)('sv-FI');
|
138
138
|
const resultsProps = {
|
139
|
-
scores: [defaultScores]
|
139
|
+
scores: [defaultScores]
|
140
140
|
};
|
141
141
|
expect(renderWithContext(resultsProps, [defaultAnswer]).toJSON()).toMatchSnapshot();
|
142
142
|
});
|
@@ -149,14 +149,14 @@ describe('<AnnotationList />', () => {
|
|
149
149
|
maxScore: 2,
|
150
150
|
level: 2,
|
151
151
|
childQuestions: [],
|
152
|
-
questionLabelIds: ''
|
152
|
+
questionLabelIds: ''
|
153
153
|
};
|
154
154
|
const resultsContextDefaults = {
|
155
155
|
answersByQuestionId: {},
|
156
156
|
gradingStructure: { questions: [] },
|
157
157
|
scores: [],
|
158
158
|
gradingText: '',
|
159
|
-
totalScore: 60
|
159
|
+
totalScore: 60
|
160
160
|
};
|
161
161
|
function renderWithContext(results, answers) {
|
162
162
|
return (0, react_test_renderer_1.create)(react_1.default.createElement(QuestionContext_1.QuestionContext.Provider, { value: { ...questionContextProps, ...{ answers } } },
|
@@ -14,52 +14,52 @@ const allScores = [
|
|
14
14
|
{
|
15
15
|
questionId: 330,
|
16
16
|
answerId: 1,
|
17
|
-
autograding: { score: 3 }
|
17
|
+
autograding: { score: 3 }
|
18
18
|
},
|
19
19
|
{
|
20
20
|
questionId: 2,
|
21
21
|
answerId: 2,
|
22
22
|
pregrading: {
|
23
|
-
score: 1
|
23
|
+
score: 1
|
24
24
|
},
|
25
25
|
censoring: {
|
26
26
|
scores: [
|
27
27
|
{ score: 4, shortCode: 'SE3' },
|
28
28
|
{ score: 3, shortCode: 'SE2' },
|
29
|
-
{ score: 2, shortCode: 'SE1' }
|
30
|
-
]
|
29
|
+
{ score: 2, shortCode: 'SE1' }
|
30
|
+
]
|
31
31
|
},
|
32
|
-
inspection: { score: 5, shortCodes: ['IN1', 'IN2'] }
|
33
|
-
}
|
32
|
+
inspection: { score: 5, shortCodes: ['IN1', 'IN2'] }
|
33
|
+
}
|
34
34
|
];
|
35
35
|
const answers = [
|
36
36
|
{
|
37
37
|
type: 'choice',
|
38
38
|
questionId: 330,
|
39
39
|
value: '93',
|
40
|
-
displayNumber: '1.1'
|
40
|
+
displayNumber: '1.1'
|
41
41
|
},
|
42
42
|
{
|
43
43
|
type: 'richText',
|
44
44
|
questionId: 2,
|
45
45
|
value: 'test',
|
46
46
|
characterCount: 4,
|
47
|
-
displayNumber: '1.2'
|
48
|
-
}
|
47
|
+
displayNumber: '1.2'
|
48
|
+
}
|
49
49
|
];
|
50
50
|
const textAnswer = [
|
51
51
|
{
|
52
52
|
type: 'richText',
|
53
53
|
questionId: 2,
|
54
54
|
value: 'test',
|
55
|
-
characterCount: 4
|
56
|
-
}
|
55
|
+
characterCount: 4
|
56
|
+
}
|
57
57
|
];
|
58
58
|
const answersByQuestionId = (0, lodash_es_1.keyBy)(answers, 'questionId');
|
59
59
|
const testExam = 'SC.xml';
|
60
60
|
const language = 'fi-FI';
|
61
61
|
const getMediaMetadata = (__, type) => Promise.resolve(type === 'audio' ? { duration: 999 } : { width: 999, height: 999 });
|
62
|
-
const exam = (0, exam_engine_exams_1.listExams)().find(
|
62
|
+
const exam = (0, exam_engine_exams_1.listExams)().find(e => e.includes(testExam));
|
63
63
|
if (exam == null) {
|
64
64
|
throw new Error(`Could not find the exam file to use in test: ${testExam}`);
|
65
65
|
}
|
@@ -70,7 +70,7 @@ describe(`Total score calculation for ${testExam}`, () => {
|
|
70
70
|
beforeAll(async () => {
|
71
71
|
const source = await fs_1.promises.readFile(exam, 'utf-8');
|
72
72
|
const results = await (0, exam_engine_mastering_1.masterExam)(source, () => '', getMediaMetadata);
|
73
|
-
result = results.find(
|
73
|
+
result = results.find(r => r.language === language);
|
74
74
|
doc = (0, parseExam_1.default)(result.xml, false);
|
75
75
|
topLevelQuestions = (0, dom_utils_1.queryAll)(doc.documentElement, 'question', false);
|
76
76
|
});
|
@@ -83,9 +83,9 @@ describe(`Total score calculation for ${testExam}`, () => {
|
|
83
83
|
questionId: 2,
|
84
84
|
answerId: 2,
|
85
85
|
pregrading: {
|
86
|
-
score: 1
|
87
|
-
}
|
88
|
-
}
|
86
|
+
score: 1
|
87
|
+
}
|
88
|
+
}
|
89
89
|
];
|
90
90
|
expect((0, ResultsContext_1.calculateQuestionSumScore)(topLevelQuestions[0], result.gradingStructure, textAnswerScorePregradingOnly, (0, lodash_es_1.keyBy)(textAnswer, 'questionId'))).toBe(1);
|
91
91
|
});
|
@@ -95,12 +95,12 @@ describe(`Total score calculation for ${testExam}`, () => {
|
|
95
95
|
questionId: 2,
|
96
96
|
answerId: 2,
|
97
97
|
pregrading: {
|
98
|
-
score: 1
|
98
|
+
score: 1
|
99
99
|
},
|
100
100
|
censoring: {
|
101
|
-
scores: [{ score: 2, shortCode: 'SE1' }]
|
102
|
-
}
|
103
|
-
}
|
101
|
+
scores: [{ score: 2, shortCode: 'SE1' }]
|
102
|
+
}
|
103
|
+
}
|
104
104
|
];
|
105
105
|
expect((0, ResultsContext_1.calculateQuestionSumScore)(topLevelQuestions[0], result.gradingStructure, textAnswerScoreOneCensor, (0, lodash_es_1.keyBy)(textAnswer, 'questionId'))).toBe(2);
|
106
106
|
});
|
@@ -110,15 +110,15 @@ describe(`Total score calculation for ${testExam}`, () => {
|
|
110
110
|
questionId: 2,
|
111
111
|
answerId: 2,
|
112
112
|
pregrading: {
|
113
|
-
score: 1
|
113
|
+
score: 1
|
114
114
|
},
|
115
115
|
censoring: {
|
116
116
|
scores: [
|
117
117
|
{ score: 3, shortCode: 'SE2' },
|
118
|
-
{ score: 2, shortCode: 'SE1' }
|
119
|
-
]
|
120
|
-
}
|
121
|
-
}
|
118
|
+
{ score: 2, shortCode: 'SE1' }
|
119
|
+
]
|
120
|
+
}
|
121
|
+
}
|
122
122
|
];
|
123
123
|
expect((0, ResultsContext_1.calculateQuestionSumScore)(topLevelQuestions[0], result.gradingStructure, textAnswerScoreTwoCensors, (0, lodash_es_1.keyBy)(textAnswer, 'questionId'))).toBe(3);
|
124
124
|
});
|
@@ -128,16 +128,16 @@ describe(`Total score calculation for ${testExam}`, () => {
|
|
128
128
|
questionId: 2,
|
129
129
|
answerId: 2,
|
130
130
|
pregrading: {
|
131
|
-
score: 1
|
131
|
+
score: 1
|
132
132
|
},
|
133
133
|
censoring: {
|
134
134
|
scores: [
|
135
135
|
{ score: 2, shortCode: 'SE1' },
|
136
|
-
{ score: 3, shortCode: 'SE2' }
|
137
|
-
]
|
136
|
+
{ score: 3, shortCode: 'SE2' }
|
137
|
+
]
|
138
138
|
},
|
139
|
-
inspection: { score: 7, shortCodes: ['IN1', 'IN2'] }
|
140
|
-
}
|
139
|
+
inspection: { score: 7, shortCodes: ['IN1', 'IN2'] }
|
140
|
+
}
|
141
141
|
];
|
142
142
|
expect((0, ResultsContext_1.calculateQuestionSumScore)(topLevelQuestions[0], result.gradingStructure, textAnswerScoreInspection, (0, lodash_es_1.keyBy)(textAnswer, 'questionId'))).toBe(7);
|
143
143
|
});
|
@@ -146,7 +146,7 @@ describe(`Total score calculation for ${testExam}`, () => {
|
|
146
146
|
type: 'choice',
|
147
147
|
questionId: 1,
|
148
148
|
value: '93',
|
149
|
-
displayNumber: '1.1'
|
149
|
+
displayNumber: '1.1'
|
150
150
|
};
|
151
151
|
expect((0, ResultsContext_1.calculateQuestionSumScore)(topLevelQuestions[0], result.gradingStructure, [], (0, lodash_es_1.keyBy)([choiceAnswer], 'questionId'))).toBe(3);
|
152
152
|
});
|
@@ -157,27 +157,27 @@ describe(`Total score calculation for ${testExam}`, () => {
|
|
157
157
|
questionId: 83,
|
158
158
|
value: 'Willst du am Samstag mit ins Kino kommen',
|
159
159
|
characterCount: 33,
|
160
|
-
displayNumber: '18.1'
|
160
|
+
displayNumber: '18.1'
|
161
161
|
},
|
162
162
|
{
|
163
163
|
type: 'text',
|
164
164
|
questionId: 84,
|
165
165
|
value: 'Bar Bar',
|
166
166
|
characterCount: 6,
|
167
|
-
displayNumber: '18.2'
|
168
|
-
}
|
167
|
+
displayNumber: '18.2'
|
168
|
+
}
|
169
169
|
];
|
170
170
|
const scoredTextScore = [
|
171
171
|
{
|
172
172
|
questionId: 83,
|
173
173
|
answerId: 83,
|
174
|
-
autograding: { score: 2 }
|
174
|
+
autograding: { score: 2 }
|
175
175
|
},
|
176
176
|
{
|
177
177
|
questionId: 84,
|
178
178
|
answerId: 84,
|
179
|
-
autograding: { score: 0 }
|
180
|
-
}
|
179
|
+
autograding: { score: 0 }
|
180
|
+
}
|
181
181
|
];
|
182
182
|
expect((0, ResultsContext_1.calculateQuestionSumScore)(topLevelQuestions[17], result.gradingStructure, scoredTextScore, (0, lodash_es_1.keyBy)(scoredTextAnswer, 'questionId'))).toBe(2);
|
183
183
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ResultsContext.test.js","sourceRoot":"","sources":["../../../__tests__/results/ResultsContext.test.tsx"],"names":[],"mappings":";;;;;AAAA,+FAAsE;AACtE,iEAAqD;AACrD,yEAA6F;AAC7F,2BAAmC;AACnC,yCAAiC;AAEjC,gFAAwH;AACxH,mDAA8C;AAE9C,MAAM,SAAS,GAAY;IACzB;QACE,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;KAC1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E,CAAC,CAAA;AAErF,MAAM,IAAI,GAAG,IAAA,6BAAS,GAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,
|
1
|
+
{"version":3,"file":"ResultsContext.test.js","sourceRoot":"","sources":["../../../__tests__/results/ResultsContext.test.tsx"],"names":[],"mappings":";;;;;AAAA,+FAAsE;AACtE,iEAAqD;AACrD,yEAA6F;AAC7F,2BAAmC;AACnC,yCAAiC;AAEjC,gFAAwH;AACxH,mDAA8C;AAE9C,MAAM,SAAS,GAAY;IACzB;QACE,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;KAC1B;IACD;QACE,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,CAAC;QACX,UAAU,EAAE;YACV,KAAK,EAAE,CAAC;SACT;QACD,SAAS,EAAE;YACT,MAAM,EAAE;gBACN,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;gBAC9B,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;gBAC9B,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;aAC/B;SACF;QACD,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;KACrD;CACF,CAAA;AAED,MAAM,OAAO,GAAiB;IAC5B;QACE,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,GAAG;QACf,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,KAAK;KACrB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,MAAM;QACb,cAAc,EAAE,CAAC;QACjB,aAAa,EAAE,KAAK;KACrB;CACF,CAAA;AAED,MAAM,UAAU,GAAiB;IAC/B;QACE,IAAI,EAAE,UAAU;QAChB,UAAU,EAAE,CAAC;QACb,KAAK,EAAE,M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K,EAAC,gBAAgB,EAAE,YAAY,CAAC,CACtC,CACF,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACX,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -18,7 +18,7 @@ describe('<QuestionAutoScore />', () => {
|
|
18
18
|
const props = {
|
19
19
|
score: undefined,
|
20
20
|
maxScore: 3,
|
21
|
-
displayNumber: '1'
|
21
|
+
displayNumber: '1'
|
22
22
|
};
|
23
23
|
expect(renderWithContext(props, []).toJSON()).toMatchSnapshot();
|
24
24
|
});
|
@@ -26,7 +26,7 @@ describe('<QuestionAutoScore />', () => {
|
|
26
26
|
const props = {
|
27
27
|
score: 1,
|
28
28
|
maxScore: 3,
|
29
|
-
displayNumber: '1'
|
29
|
+
displayNumber: '1'
|
30
30
|
};
|
31
31
|
expect(renderWithContext(props, []).toJSON()).toMatchSnapshot();
|
32
32
|
});
|
@@ -34,7 +34,7 @@ describe('<QuestionAutoScore />', () => {
|
|
34
34
|
const props = {
|
35
35
|
score: 1,
|
36
36
|
maxScore: 3,
|
37
|
-
displayNumber: '1'
|
37
|
+
displayNumber: '1'
|
38
38
|
};
|
39
39
|
expect(renderWithContext(props, [{}, {}]).toJSON()).toMatchSnapshot();
|
40
40
|
});
|
@@ -46,7 +46,7 @@ describe('<QuestionAutoScore />', () => {
|
|
46
46
|
maxScore: 2,
|
47
47
|
level: 2,
|
48
48
|
childQuestions: [],
|
49
|
-
questionLabelIds: ''
|
49
|
+
questionLabelIds: ''
|
50
50
|
};
|
51
51
|
function renderWithContext(props, answers) {
|
52
52
|
return (0, react_test_renderer_1.create)(react_1.default.createElement(QuestionContext_1.QuestionContext.Provider, { value: { ...contextProps, answers } },
|