@digabi/exam-engine-core 23.13.6 → 23.13.8-alpha.2

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 (108) hide show
  1. package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts +2 -0
  2. package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts.map +1 -0
  3. package/dist/__tests__/playwright/exam/AudioAnswer.test.js +111 -0
  4. package/dist/__tests__/playwright/exam/AudioAnswer.test.js.map +1 -0
  5. package/dist/__tests__/playwright/exam/AudioPlayer.test.d.ts +2 -0
  6. package/dist/__tests__/playwright/exam/AudioPlayer.test.d.ts.map +1 -0
  7. package/dist/__tests__/playwright/exam/AudioPlayer.test.js +70 -0
  8. package/dist/__tests__/playwright/exam/AudioPlayer.test.js.map +1 -0
  9. package/dist/__tests__/playwright/pages/AudioPlayer.page.d.ts +12 -0
  10. package/dist/__tests__/playwright/pages/AudioPlayer.page.d.ts.map +1 -0
  11. package/dist/__tests__/playwright/pages/AudioPlayer.page.js +15 -0
  12. package/dist/__tests__/playwright/pages/AudioPlayer.page.js.map +1 -0
  13. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts +5 -0
  14. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts.map +1 -0
  15. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js +15 -0
  16. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js.map +1 -0
  17. package/dist/__tests__/results/ResultsContext.test.js +1 -1
  18. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  19. package/dist/components/context/AudioRecorderContext.d.ts +8 -0
  20. package/dist/components/context/AudioRecorderContext.d.ts.map +1 -0
  21. package/dist/components/context/AudioRecorderContext.js +7 -0
  22. package/dist/components/context/AudioRecorderContext.js.map +1 -0
  23. package/dist/components/exam/AudioAnswer.d.ts +4 -1
  24. package/dist/components/exam/AudioAnswer.d.ts.map +1 -1
  25. package/dist/components/exam/AudioAnswer.js +13 -19
  26. package/dist/components/exam/AudioAnswer.js.map +1 -1
  27. package/dist/components/exam/Exam.d.ts.map +1 -1
  28. package/dist/components/exam/Exam.js +2 -1
  29. package/dist/components/exam/Exam.js.map +1 -1
  30. package/dist/components/exam/internal/AudioRecorder.d.ts +2 -2
  31. package/dist/components/exam/internal/AudioRecorder.d.ts.map +1 -1
  32. package/dist/components/exam/internal/AudioRecorder.js +65 -31
  33. package/dist/components/exam/internal/AudioRecorder.js.map +1 -1
  34. package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
  35. package/dist/components/grading/GradingAnswer.js +2 -1
  36. package/dist/components/grading/GradingAnswer.js.map +1 -1
  37. package/dist/components/results/AudioAnswer.d.ts.map +1 -1
  38. package/dist/components/results/AudioAnswer.js +2 -1
  39. package/dist/components/results/AudioAnswer.js.map +1 -1
  40. package/dist/components/shared/Audio.d.ts.map +1 -1
  41. package/dist/components/shared/Audio.js +2 -2
  42. package/dist/components/shared/Audio.js.map +1 -1
  43. package/dist/components/shared/internal/AudioPlayer.d.ts +9 -0
  44. package/dist/components/shared/internal/AudioPlayer.d.ts.map +1 -0
  45. package/dist/components/shared/internal/AudioPlayer.js +77 -0
  46. package/dist/components/shared/internal/AudioPlayer.js.map +1 -0
  47. package/dist/components/shared/internal/RestrictedAudioPlayer.d.ts.map +1 -1
  48. package/dist/components/shared/internal/RestrictedAudioPlayer.js +1 -1
  49. package/dist/components/shared/internal/RestrictedAudioPlayer.js.map +1 -1
  50. package/dist/i18n/fi-FI.d.ts +13 -3
  51. package/dist/i18n/fi-FI.d.ts.map +1 -1
  52. package/dist/i18n/fi-FI.js +13 -3
  53. package/dist/i18n/fi-FI.js.map +1 -1
  54. package/dist/i18n/sv-FI.d.ts.map +1 -1
  55. package/dist/i18n/sv-FI.js +13 -3
  56. package/dist/i18n/sv-FI.js.map +1 -1
  57. package/dist/main-bundle.js +2 -2
  58. package/dist/main.css +1 -1
  59. package/dist/types/ExamServerAPI.d.ts +2 -0
  60. package/dist/types/ExamServerAPI.d.ts.map +1 -1
  61. package/package.json +2 -2
  62. package/dist/__tests__/annotations.test.d.ts +0 -2
  63. package/dist/__tests__/annotations.test.d.ts.map +0 -1
  64. package/dist/__tests__/annotations.test.js +0 -217
  65. package/dist/__tests__/annotations.test.js.map +0 -1
  66. package/dist/assets/NotoMono.ttf +0 -0
  67. package/dist/assets/NotoSans-Bold.ttf +0 -0
  68. package/dist/assets/NotoSans-BoldItalic.ttf +0 -0
  69. package/dist/assets/NotoSans-Italic.ttf +0 -0
  70. package/dist/assets/NotoSans-Light.ttf +0 -0
  71. package/dist/assets/NotoSans-LightItalic.ttf +0 -0
  72. package/dist/assets/NotoSans-Regular.ttf +0 -0
  73. package/dist/assets/NotoSans-SemiBold.ttf +0 -0
  74. package/dist/assets/NotoSans-SemiBoldItalic.ttf +0 -0
  75. package/dist/assets/closeButton.svg +0 -1
  76. package/dist/assets/collapse.svg +0 -12
  77. package/dist/assets/expand.svg +0 -12
  78. package/dist/assets/helpButton.svg +0 -9
  79. package/dist/assets/redoButton.svg +0 -5
  80. package/dist/assets/undoButton.svg +0 -5
  81. package/dist/components/context/AudioContext.d.ts +0 -9
  82. package/dist/components/context/AudioContext.d.ts.map +0 -1
  83. package/dist/components/context/AudioContext.js +0 -9
  84. package/dist/components/context/AudioContext.js.map +0 -1
  85. package/dist/components/exam/ExamineExam.d.ts +0 -5
  86. package/dist/components/exam/ExamineExam.d.ts.map +0 -1
  87. package/dist/components/exam/ExamineExam.js +0 -20
  88. package/dist/components/exam/ExamineExam.js.map +0 -1
  89. package/dist/components/grading/examAnnotationUtils.d.ts +0 -4
  90. package/dist/components/grading/examAnnotationUtils.d.ts.map +0 -1
  91. package/dist/components/grading/examAnnotationUtils.js +0 -51
  92. package/dist/components/grading/examAnnotationUtils.js.map +0 -1
  93. package/dist/components/shared/AnnotatableText.d.ts +0 -7
  94. package/dist/components/shared/AnnotatableText.d.ts.map +0 -1
  95. package/dist/components/shared/AnnotatableText.js +0 -73
  96. package/dist/components/shared/AnnotatableText.js.map +0 -1
  97. package/dist/components/shared/AnnotationPopup.d.ts +0 -3
  98. package/dist/components/shared/AnnotationPopup.d.ts.map +0 -1
  99. package/dist/components/shared/AnnotationPopup.js +0 -74
  100. package/dist/components/shared/AnnotationPopup.js.map +0 -1
  101. package/dist/components/shared/internal/AudioPlaybackError.d.ts +0 -8
  102. package/dist/components/shared/internal/AudioPlaybackError.d.ts.map +0 -1
  103. package/dist/components/shared/internal/AudioPlaybackError.js +0 -17
  104. package/dist/components/shared/internal/AudioPlaybackError.js.map +0 -1
  105. package/dist/components/surround.d.ts +0 -8
  106. package/dist/components/surround.d.ts.map +0 -1
  107. package/dist/components/surround.js +0 -19
  108. package/dist/components/surround.js.map +0 -1
@@ -1,74 +0,0 @@
1
- import React, { useContext, useEffect, useState } from 'react';
2
- import { makeRichText } from 'rich-text-editor';
3
- import { AnnotationContext } from '../context/AnnotationProvider';
4
- export function AnnotationPopup() {
5
- const popupRef = React.createRef();
6
- const textAreaRef = React.createRef();
7
- const { newAnnotation, setNewAnnotation, newAnnotationRef, onSaveAnnotation } = useContext(AnnotationContext);
8
- const [comment, setComment] = useState('');
9
- const [saveEnabled, setSaveEnabled] = useState(false);
10
- useEffect(() => {
11
- if (newAnnotationRef && textAreaRef.current) {
12
- showAndPositionElement(newAnnotationRef, popupRef);
13
- textAreaRef.current.innerHTML = comment;
14
- makeRichText(textAreaRef.current, {
15
- locale: 'FI',
16
- screenshotSaver: () => Promise.resolve('')
17
- }, value => {
18
- setComment(value.answerHTML);
19
- setSaveEnabled(value.answerHTML.trim().length > 0);
20
- });
21
- textAreaRef.current.focus();
22
- }
23
- }, [newAnnotationRef]);
24
- if (!newAnnotation) {
25
- if (comment) {
26
- setComment('');
27
- }
28
- return null;
29
- }
30
- const closeEditor = () => {
31
- setNewAnnotation(null);
32
- closeMathEditor(textAreaRef.current);
33
- };
34
- function updateComment(annotation, comment) {
35
- onSaveAnnotation({ ...annotation, message: comment });
36
- closeEditor();
37
- }
38
- return (React.createElement("div", { className: "annotation-popup", style: { position: 'absolute', opacity: 0 }, ref: popupRef, "data-testid": "annotation-popup" },
39
- React.createElement("div", { className: "comment-content", "data-testid": "edit-comment", role: "textbox", "aria-multiline": "true", ref: textAreaRef }),
40
- React.createElement("span", { className: "comment-button-area" },
41
- React.createElement("span", null,
42
- React.createElement("button", { className: "button", onClick: e => {
43
- e.stopPropagation();
44
- closeMathEditor(textAreaRef.current);
45
- updateComment(newAnnotation, comment);
46
- }, "data-testid": "save-comment", disabled: !saveEnabled }, "Vastaa"),
47
- React.createElement("button", { className: "button text-button", onClick: closeEditor }, "Peru")))));
48
- }
49
- function showAndPositionElement(mark, popupRef) {
50
- const popup = popupRef.current;
51
- if (mark && popup) {
52
- const style = popup.style;
53
- const markRect = mark === null || mark === void 0 ? void 0 : mark.getBoundingClientRect();
54
- const popupRect = popup.getBoundingClientRect();
55
- const top = markRect.height + markRect.top + window.scrollY;
56
- const windowWidth = window.innerWidth;
57
- style.top = `${String(top)}px`;
58
- style.opacity = '1';
59
- const popupHitsWindowRight = markRect.left + popupRect.width > windowWidth;
60
- if (popupHitsWindowRight) {
61
- style.left = `${markRect.right - popupRect.width}px`;
62
- }
63
- else {
64
- style.left = `${markRect.left}px`;
65
- }
66
- }
67
- }
68
- function closeMathEditor(element) {
69
- // rich-text-editor does not properly support several rich-text-editor instances created at different times.
70
- // In order to close math editor that is open, we need to dispatch events like this.
71
- element.dispatchEvent(new Event('focus', { bubbles: true, cancelable: true }));
72
- element.dispatchEvent(new Event('blur', { bubbles: true, cancelable: true }));
73
- }
74
- //# sourceMappingURL=AnnotationPopup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnnotationPopup.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAE,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Q,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,qBAAqB,EAAE,CAAA;QAC9C,MAAM,SAAS,GAAG,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC/C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,CAAA;QAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAA;QACrC,KAAK,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAA;QAC9B,KAAK,CAAC,OAAO,GAAG,GAAG,CAAA;QACnB,MAAM,oBAAoB,GAAG,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,GAAG,WAAW,CAAA;QAE1E,IAAI,oBAAoB,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,GAAG,GAAG,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,IAAI,CAAA;QACtD,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,IAAI,CAAA;QACnC,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,OAAuB;IAC9C,4GAA4G;IAC5G,oFAAoF;IACpF,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAC9E,OAAO,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC/E,CAAC"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { AudioPlaybackError } from '../../../index';
3
- declare const AudioPlaybackError: React.FunctionComponent<{
4
- error?: AudioPlaybackError;
5
- children: React.ReactNode[] | React.ReactNode;
6
- }>;
7
- export default AudioPlaybackError;
8
- //# sourceMappingURL=AudioPlaybackError.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AudioPlaybackError.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/internal/AudioPlaybackError.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAGnD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChD,KAAK,CAAC,EAAE,kBAAkB,CAAA;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,SAAS,CAAA;CAC9C,CAkBA,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -1,17 +0,0 @@
1
- import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
2
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
- import React from 'react';
4
- import ReactCSSTransitionReplace from 'react-css-transition-replace';
5
- import { useExamTranslation } from '../../../i18n';
6
- const AudioPlaybackError = ({ error, children }) => {
7
- const { t } = useExamTranslation();
8
- return (
9
- // @types/react 18 removed children from implicit props. This component has not explicitly added them yet
10
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11
- // @ts-ignore
12
- React.createElement(ReactCSSTransitionReplace, { transitionName: "e-crossfade", transitionEnterTimeout: 500, transitionLeaveTimeout: 500 }, error != null ? (React.createElement("div", { className: "e-color-error", role: "alert" },
13
- React.createElement(FontAwesomeIcon, { icon: faExclamationTriangle, className: "e-mrg-r-1" }),
14
- t(`audio-errors.${error}`))) : (React.createElement("div", { key: "no-error" }, children))));
15
- };
16
- export default AudioPlaybackError;
17
- //# sourceMappingURL=AudioPlaybackError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AudioPlaybackError.js","sourceRoot":"","sources":["../../../../src/components/shared/internal/AudioPlaybackError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,yBAAyB,MAAM,8BAA8B,CAAA;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,MAAM,kBAAkB,GAGnB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3B,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAElC,OAAO;IACL,yGAAyG;IACzG,6DAA6D;IAC7D,aAAa;IACb,oBAAC,yBAAyB,IAAC,cAAc,EAAC,aAAa,EAAC,sBAAsB,EAAE,GAAG,EAAE,sBAAsB,EAAE,GAAG,IAC7G,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CACf,6BAAK,SAAS,EAAC,eAAe,EAAC,IAAI,EAAC,OAAO;QACzC,oBAAC,eAAe,IAAC,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAC,WAAW,GAAG;QACrE,CAAC,CAAC,gBAAgB,KAAK,EAAW,CAAC,CAChC,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,GAAG,EAAC,UAAU,IAAE,QAAQ,CAAO,CACrC,CACyB,CAC7B,CAAA;AACH,CAAC,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { ExamComponentProps } from '../createRenderChildNodes';
3
- /** Surrounds an Exam component with a static HTML element.
4
- *
5
- * @example surround(Question, 'div', {className: 'foobar'})
6
- */
7
- export default function surround<K extends keyof JSX.IntrinsicElements>(Component: React.ComponentType<ExamComponentProps>, Tag: K, props?: JSX.IntrinsicElements[K]): React.ComponentType<ExamComponentProps>;
8
- //# sourceMappingURL=surround.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"surround.d.ts","sourceRoot":"","sources":["../../src/components/surround.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,iBAAiB,EACpE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,EAClD,GAAG,EAAE,CAAC,EACN,KAAK,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAC/B,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAczC"}
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { getDisplayName } from '../getDisplayName';
3
- /** Surrounds an Exam component with a static HTML element.
4
- *
5
- * @example surround(Question, 'div', {className: 'foobar'})
6
- */
7
- export default function surround(Component, Tag, props) {
8
- const Wrapped = (componentProps) => {
9
- // Can't seem to be able to limit the type to HTML elements that accept children.
10
- // So as a hack, type them as any inside the function to make the compiler happy.
11
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12
- const TagAsAny = Tag;
13
- return (React.createElement(TagAsAny, { ...props },
14
- React.createElement(Component, { ...componentProps })));
15
- };
16
- Wrapped.displayName = `Surround(${getDisplayName(Component)})`;
17
- return Wrapped;
18
- }
19
- //# sourceMappingURL=surround.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"surround.js","sourceRoot":"","sources":["../../src/components/surround.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGlD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,SAAkD,EAClD,GAAM,EACN,KAAgC;IAEhC,MAAM,OAAO,GAAG,CAAC,cAAkC,EAAE,EAAE;QACrD,iFAAiF;QACjF,iFAAiF;QACjF,mEAAmE;QACnE,MAAM,QAAQ,GAAG,GAAU,CAAA;QAC3B,OAAO,CACL,oBAAC,QAAQ,OAAK,KAAK;YACjB,oBAAC,SAAS,OAAK,cAAc,GAAI,CACxB,CACZ,CAAA;IACH,CAAC,CAAA;IACD,OAAO,CAAC,WAAW,GAAG,YAAY,cAAc,CAAC,SAAS,CAAC,GAAG,CAAA;IAC9D,OAAO,OAAO,CAAA;AAChB,CAAC"}