@digabi/exam-engine-core 23.10.1-alpha.0 → 23.13.1

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.
Files changed (101) hide show
  1. package/dist/__tests__/examServerApi.d.ts.map +1 -1
  2. package/dist/__tests__/examServerApi.js +0 -2
  3. package/dist/__tests__/examServerApi.js.map +1 -1
  4. package/dist/__tests__/playwright/exam/TextAnswerInput.test.d.ts +2 -0
  5. package/dist/__tests__/playwright/exam/TextAnswerInput.test.d.ts.map +1 -0
  6. package/dist/__tests__/playwright/exam/TextAnswerInput.test.js +40 -0
  7. package/dist/__tests__/playwright/exam/TextAnswerInput.test.js.map +1 -0
  8. package/dist/__tests__/playwright/stories/exam/Question.story.d.ts +5 -0
  9. package/dist/__tests__/playwright/stories/exam/Question.story.d.ts.map +1 -0
  10. package/dist/__tests__/playwright/stories/exam/Question.story.js +19 -0
  11. package/dist/__tests__/playwright/stories/exam/Question.story.js.map +1 -0
  12. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  13. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  14. package/dist/components/context/QuestionContext.js +1 -1
  15. package/dist/components/context/QuestionContext.js.map +1 -1
  16. package/dist/components/exam/Exam.d.ts.map +1 -1
  17. package/dist/components/exam/Exam.js +1 -3
  18. package/dist/components/exam/Exam.js.map +1 -1
  19. package/dist/components/exam/internal/TextAnswerInput.js +1 -1
  20. package/dist/components/exam/internal/TextAnswerInput.js.map +1 -1
  21. package/dist/components/grading/GradingAnswer.d.ts +6 -2
  22. package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
  23. package/dist/components/grading/GradingAnswer.js +3 -4
  24. package/dist/components/grading/GradingAnswer.js.map +1 -1
  25. package/dist/components/results/Results.d.ts.map +1 -1
  26. package/dist/components/results/Results.js +1 -3
  27. package/dist/components/results/Results.js.map +1 -1
  28. package/dist/components/shared/Audio.js +2 -2
  29. package/dist/components/shared/Audio.js.map +1 -1
  30. package/dist/components/shared/AudioTest.js +2 -2
  31. package/dist/components/shared/AudioTest.js.map +1 -1
  32. package/dist/dom-utils.js +1 -1
  33. package/dist/dom-utils.js.map +1 -1
  34. package/dist/i18n/fi-FI.d.ts +0 -5
  35. package/dist/i18n/fi-FI.d.ts.map +1 -1
  36. package/dist/i18n/fi-FI.js +0 -5
  37. package/dist/i18n/fi-FI.js.map +1 -1
  38. package/dist/i18n/sv-FI.d.ts.map +1 -1
  39. package/dist/i18n/sv-FI.js +0 -5
  40. package/dist/i18n/sv-FI.js.map +1 -1
  41. package/dist/main-bundle.js +3 -3
  42. package/dist/main.css +1 -1
  43. package/dist/parser/parseExamStructure.d.ts +1 -8
  44. package/dist/parser/parseExamStructure.d.ts.map +1 -1
  45. package/dist/parser/parseExamStructure.js +1 -1
  46. package/dist/parser/parseExamStructure.js.map +1 -1
  47. package/dist/store/audio/actions.d.ts +3 -3
  48. package/dist/store/audio/actions.d.ts.map +1 -1
  49. package/dist/store/audio/actions.js.map +1 -1
  50. package/dist/store/audio/reducer.d.ts +2 -2
  51. package/dist/store/audio/reducer.d.ts.map +1 -1
  52. package/dist/store/index.d.ts +1 -1
  53. package/dist/store/selectors.d.ts +2 -2
  54. package/dist/store/selectors.d.ts.map +1 -1
  55. package/dist/store/selectors.js.map +1 -1
  56. package/dist/types/ExamAnswer.d.ts +1 -5
  57. package/dist/types/ExamAnswer.d.ts.map +1 -1
  58. package/dist/types/ExamServerAPI.d.ts +3 -11
  59. package/dist/types/ExamServerAPI.d.ts.map +1 -1
  60. package/dist/types/GradingStructure.d.ts +1 -7
  61. package/dist/types/GradingStructure.d.ts.map +1 -1
  62. package/dist/validateAnswers.d.ts.map +1 -1
  63. package/dist/validateAnswers.js +0 -1
  64. package/dist/validateAnswers.js.map +1 -1
  65. package/package.json +2 -2
  66. package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts +0 -2
  67. package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts.map +0 -1
  68. package/dist/__tests__/playwright/exam/AudioAnswer.test.js +0 -30
  69. package/dist/__tests__/playwright/exam/AudioAnswer.test.js.map +0 -1
  70. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts +0 -8
  71. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts.map +0 -1
  72. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js +0 -34
  73. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js.map +0 -1
  74. package/dist/components/exam/AudioAnswer.d.ts +0 -7
  75. package/dist/components/exam/AudioAnswer.d.ts.map +0 -1
  76. package/dist/components/exam/AudioAnswer.js +0 -34
  77. package/dist/components/exam/AudioAnswer.js.map +0 -1
  78. package/dist/components/exam/internal/AudioRecorder.d.ts +0 -11
  79. package/dist/components/exam/internal/AudioRecorder.d.ts.map +0 -1
  80. package/dist/components/exam/internal/AudioRecorder.js +0 -115
  81. package/dist/components/exam/internal/AudioRecorder.js.map +0 -1
  82. package/dist/components/exam/internal/MyAudioRecorder.d.ts +0 -10
  83. package/dist/components/exam/internal/MyAudioRecorder.d.ts.map +0 -1
  84. package/dist/components/exam/internal/MyAudioRecorder.js +0 -106
  85. package/dist/components/exam/internal/MyAudioRecorder.js.map +0 -1
  86. package/dist/components/exam/internal/MyMediaRecorder.d.ts +0 -10
  87. package/dist/components/exam/internal/MyMediaRecorder.d.ts.map +0 -1
  88. package/dist/components/exam/internal/MyMediaRecorder.js +0 -91
  89. package/dist/components/exam/internal/MyMediaRecorder.js.map +0 -1
  90. package/dist/components/results/AudioAnswer.d.ts +0 -6
  91. package/dist/components/results/AudioAnswer.d.ts.map +0 -1
  92. package/dist/components/results/AudioAnswer.js +0 -33
  93. package/dist/components/results/AudioAnswer.js.map +0 -1
  94. package/dist/components/shared/internal/AudioError.d.ts +0 -8
  95. package/dist/components/shared/internal/AudioError.d.ts.map +0 -1
  96. package/dist/components/shared/internal/AudioError.js +0 -17
  97. package/dist/components/shared/internal/AudioError.js.map +0 -1
  98. package/dist/components/shared/internal/AudioErrorRemoveMe.d.ts +0 -8
  99. package/dist/components/shared/internal/AudioErrorRemoveMe.d.ts.map +0 -1
  100. package/dist/components/shared/internal/AudioErrorRemoveMe.js +0 -17
  101. package/dist/components/shared/internal/AudioErrorRemoveMe.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"examServerApi.d.ts","sourceRoot":"","sources":["../../__tests__/examServerApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,eAAO,MAAM,aAAa,EAAE,aAW3B,CAAA"}
1
+ {"version":3,"file":"examServerApi.d.ts","sourceRoot":"","sources":["../../__tests__/examServerApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,eAAO,MAAM,aAAa,EAAE,aAS3B,CAAA"}
@@ -6,8 +6,6 @@ exports.examServerApi = {
6
6
  setCasStatus: casStatus => Promise.resolve(casStatus),
7
7
  saveAnswer: () => Promise.resolve(),
8
8
  saveScreenshot: () => Promise.resolve('ok'),
9
- saveAudio: () => Promise.resolve('ok'),
10
- deleteAudio: () => Promise.resolve(),
11
9
  playAudio: () => Promise.resolve('ok'),
12
10
  playRestrictedAudio: () => Promise.resolve('ok'),
13
11
  getRestrictedAudio: () => Promise.resolve(new Blob()),
@@ -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,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,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;IACpC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IACtC,mBAAmB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAChD,kBAAkB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IACrD,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;CAC7B,CAAA"}
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;IAChD,kBAAkB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IACrD,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;CAC7B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TextAnswerInput.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnswerInput.test.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/TextAnswerInput.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
8
+ const Question_story_1 = require("../stories/exam/Question.story");
9
+ experimental_ct_react_1.test.describe('TextAnswerInput', () => {
10
+ (0, experimental_ct_react_1.test)('integer input accepts unicode minus sign', async ({ mount }) => {
11
+ const component = await mount(react_1.default.createElement(Question_story_1.QuestionStory, { examXml: examXml }));
12
+ await component.locator('input').type('−5');
13
+ await (0, experimental_ct_react_1.expect)(component.locator('input')).toHaveValue('\u22125');
14
+ });
15
+ (0, experimental_ct_react_1.test)('integer input accepts ascii hyphen minus sign', async ({ mount }) => {
16
+ const component = await mount(react_1.default.createElement(Question_story_1.QuestionStory, { examXml: examXml }));
17
+ await component.locator('input').type('-5');
18
+ await (0, experimental_ct_react_1.expect)(component.locator('input')).toHaveValue('\u002D5');
19
+ });
20
+ });
21
+ const examXml = `<e:exam xmlns:e="http://ylioppilastutkinto.fi/exam.xsd" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ylioppilastutkinto.fi/exam.xsd https://abitti.net/schema/exam.xsd" exam-schema-version="0.5">
22
+ <e:exam-versions>
23
+ <e:exam-version lang="fi-FI"/>
24
+ </e:exam-versions>
25
+ <e:exam-title>Exam</e:exam-title>
26
+ <e:exam-instruction/>
27
+ <e:table-of-contents/>
28
+ <e:section>
29
+ <e:section-title>Section</e:section-title>
30
+ <e:section-instruction/>
31
+ <e:question display-number="1">
32
+ <e:question-title>Kokonaislukutehtävä</e:question-title>
33
+ <e:question-instruction>
34
+ <br/>
35
+ </e:question-instruction>
36
+ <e:text-answer type="integer" max-score="1"/>
37
+ </e:question>
38
+ </e:section>
39
+ </e:exam>`;
40
+ //# sourceMappingURL=TextAnswerInput.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnswerInput.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/TextAnswerInput.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,mEAA8D;AAE9D,4BAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACpC,IAAA,4BAAI,EAAC,0CAA0C,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACnE,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,8BAAC,8BAAa,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAA;QAClE,MAAM,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3C,MAAM,IAAA,8BAAM,EAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;IAEF,IAAA,4BAAI,EAAC,+CAA+C,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACxE,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,8BAAC,8BAAa,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAA;QAClE,MAAM,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3C,MAAM,IAAA,8BAAM,EAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;UAkBN,CAAA"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare function QuestionStory({ examXml }: {
3
+ examXml: string;
4
+ }): React.JSX.Element;
5
+ //# sourceMappingURL=Question.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Question.story.d.ts","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/exam/Question.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,qBAQ7D"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.QuestionStory = QuestionStory;
7
+ const react_1 = __importDefault(require("react"));
8
+ const Exam_1 = require("../../../../src/components/exam/Exam");
9
+ const Question_1 = __importDefault(require("../../../../src/components/exam/Question"));
10
+ const dom_utils_1 = require("../../../../src/dom-utils");
11
+ const parseExam_1 = __importDefault(require("../../../../src/parser/parseExam"));
12
+ const ExamComponentWrapper_1 = require("../../utils/ExamComponentWrapper");
13
+ function QuestionStory({ examXml }) {
14
+ const doc = (0, parseExam_1.default)(examXml, true);
15
+ const element = (0, dom_utils_1.queryAll)(doc.documentElement, 'question')[0];
16
+ return (react_1.default.createElement(ExamComponentWrapper_1.ExamComponentWrapper, { doc: doc },
17
+ react_1.default.createElement(Question_1.default, { element: element, renderChildNodes: (0, Exam_1.renderChildNodesBase)(), renderComponentOverrides: {} })));
18
+ }
19
+ //# sourceMappingURL=Question.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Question.story.js","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/exam/Question.story.tsx"],"names":[],"mappings":";;;;;AAOA,sCAQC;AAfD,kDAAyB;AACzB,+DAA2E;AAC3E,wFAA+D;AAC/D,yDAAoD;AACpD,iFAAwD;AACxD,2EAAuE;AAEvE,SAAgB,aAAa,CAAC,EAAE,OAAO,EAAuB;IAC5D,MAAM,GAAG,GAAG,IAAA,mBAAS,EAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IACpC,MAAM,OAAO,GAAG,IAAA,oBAAQ,EAAC,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5D,OAAO,CACL,8BAAC,2CAAoB,IAAC,GAAG,EAAE,GAAG;QAC5B,8BAAC,kBAAQ,IAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAA,2BAAoB,GAAE,EAAE,wBAAwB,EAAE,EAAE,GAAI,CACjF,CACxB,CAAA;AACH,CAAC"}