@digabi/exam-engine-core 19.19.1-xml-exams.0 → 20.0.0-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  2. package/dist/components/AttachmentContext.d.ts +14 -0
  3. package/dist/components/AttachmentContext.d.ts.map +1 -0
  4. package/dist/components/AttachmentContext.js +12 -0
  5. package/dist/components/AttachmentContext.js.map +1 -0
  6. package/dist/components/AttachmentLink.d.ts +6 -0
  7. package/dist/components/AttachmentLink.d.ts.map +1 -0
  8. package/dist/components/AttachmentLink.js +24 -0
  9. package/dist/components/AttachmentLink.js.map +1 -0
  10. package/dist/components/AttachmentLinkAnchor.d.ts +7 -0
  11. package/dist/components/AttachmentLinkAnchor.d.ts.map +1 -0
  12. package/dist/components/AttachmentLinkAnchor.js +4 -0
  13. package/dist/components/AttachmentLinkAnchor.js.map +1 -0
  14. package/dist/components/AttachmentLinks.d.ts +6 -0
  15. package/dist/components/AttachmentLinks.d.ts.map +1 -0
  16. package/dist/components/AttachmentLinks.js +58 -0
  17. package/dist/components/AttachmentLinks.js.map +1 -0
  18. package/dist/components/Attachments.d.ts +5 -0
  19. package/dist/components/Attachments.d.ts.map +1 -0
  20. package/dist/components/Attachments.js +43 -0
  21. package/dist/components/Attachments.js.map +1 -0
  22. package/dist/components/AttachmentsAttachment.d.ts +5 -0
  23. package/dist/components/AttachmentsAttachment.d.ts.map +1 -0
  24. package/dist/components/AttachmentsAttachment.js +8 -0
  25. package/dist/components/AttachmentsAttachment.js.map +1 -0
  26. package/dist/components/AttachmentsAttachmentTitle.d.ts +6 -0
  27. package/dist/components/AttachmentsAttachmentTitle.d.ts.map +1 -0
  28. package/dist/components/AttachmentsAttachmentTitle.js +12 -0
  29. package/dist/components/AttachmentsAttachmentTitle.js.map +1 -0
  30. package/dist/components/AttachmentsExternalMaterial.d.ts +9 -0
  31. package/dist/components/AttachmentsExternalMaterial.d.ts.map +1 -0
  32. package/dist/components/AttachmentsExternalMaterial.js +40 -0
  33. package/dist/components/AttachmentsExternalMaterial.js.map +1 -0
  34. package/dist/components/AttachmentsQuestion.d.ts +5 -0
  35. package/dist/components/AttachmentsQuestion.d.ts.map +1 -0
  36. package/dist/components/AttachmentsQuestion.js +16 -0
  37. package/dist/components/AttachmentsQuestion.js.map +1 -0
  38. package/dist/components/AttachmentsQuestionTitle.d.ts +6 -0
  39. package/dist/components/AttachmentsQuestionTitle.d.ts.map +1 -0
  40. package/dist/components/AttachmentsQuestionTitle.js +13 -0
  41. package/dist/components/AttachmentsQuestionTitle.js.map +1 -0
  42. package/dist/components/Audio.d.ts +6 -0
  43. package/dist/components/Audio.d.ts.map +1 -0
  44. package/dist/components/Audio.js +29 -0
  45. package/dist/components/Audio.js.map +1 -0
  46. package/dist/components/AudioGroup.d.ts +6 -0
  47. package/dist/components/AudioGroup.d.ts.map +1 -0
  48. package/dist/components/AudioGroup.js +9 -0
  49. package/dist/components/AudioGroup.js.map +1 -0
  50. package/dist/components/AudioPlaybackError.d.ts +7 -0
  51. package/dist/components/AudioPlaybackError.d.ts.map +1 -0
  52. package/dist/components/AudioPlaybackError.js +12 -0
  53. package/dist/components/AudioPlaybackError.js.map +1 -0
  54. package/dist/components/AudioTest.d.ts +6 -0
  55. package/dist/components/AudioTest.d.ts.map +1 -0
  56. package/dist/components/AudioTest.js +29 -0
  57. package/dist/components/AudioTest.js.map +1 -0
  58. package/dist/components/ChoiceAnswer.d.ts +12 -0
  59. package/dist/components/ChoiceAnswer.d.ts.map +1 -0
  60. package/dist/components/ChoiceAnswer.js +60 -0
  61. package/dist/components/ChoiceAnswer.js.map +1 -0
  62. package/dist/components/CommonExamContext.d.ts +16 -0
  63. package/dist/components/CommonExamContext.d.ts.map +1 -0
  64. package/dist/components/CommonExamContext.js +22 -0
  65. package/dist/components/CommonExamContext.js.map +1 -0
  66. package/dist/components/DropdownAnswer.d.ts +12 -0
  67. package/dist/components/DropdownAnswer.d.ts.map +1 -0
  68. package/dist/components/DropdownAnswer.js +85 -0
  69. package/dist/components/DropdownAnswer.js.map +1 -0
  70. package/dist/components/Exam.d.ts +40 -0
  71. package/dist/components/Exam.d.ts.map +1 -0
  72. package/dist/components/Exam.js +106 -0
  73. package/dist/components/Exam.js.map +1 -0
  74. package/dist/components/ExamAttachment.d.ts +5 -0
  75. package/dist/components/ExamAttachment.d.ts.map +1 -0
  76. package/dist/components/ExamAttachment.js +8 -0
  77. package/dist/components/ExamAttachment.js.map +1 -0
  78. package/dist/components/ExamContext.d.ts +10 -0
  79. package/dist/components/ExamContext.d.ts.map +1 -0
  80. package/dist/components/ExamContext.js +11 -0
  81. package/dist/components/ExamContext.js.map +1 -0
  82. package/dist/components/ExamFooter.d.ts +6 -0
  83. package/dist/components/ExamFooter.d.ts.map +1 -0
  84. package/dist/components/ExamFooter.js +7 -0
  85. package/dist/components/ExamFooter.js.map +1 -0
  86. package/dist/components/ExamInstruction.d.ts +6 -0
  87. package/dist/components/ExamInstruction.d.ts.map +1 -0
  88. package/dist/components/ExamInstruction.js +6 -0
  89. package/dist/components/ExamInstruction.js.map +1 -0
  90. package/dist/components/ExamQuestion.d.ts +5 -0
  91. package/dist/components/ExamQuestion.d.ts.map +1 -0
  92. package/dist/components/ExamQuestion.js +16 -0
  93. package/dist/components/ExamQuestion.js.map +1 -0
  94. package/dist/components/ExamQuestionInstruction.d.ts +6 -0
  95. package/dist/components/ExamQuestionInstruction.d.ts.map +1 -0
  96. package/dist/components/ExamQuestionInstruction.js +6 -0
  97. package/dist/components/ExamQuestionInstruction.js.map +1 -0
  98. package/dist/components/ExamQuestionTitle.d.ts +6 -0
  99. package/dist/components/ExamQuestionTitle.d.ts.map +1 -0
  100. package/dist/components/ExamQuestionTitle.js +25 -0
  101. package/dist/components/ExamQuestionTitle.js.map +1 -0
  102. package/dist/components/ExamSection.d.ts +5 -0
  103. package/dist/components/ExamSection.d.ts.map +1 -0
  104. package/dist/components/ExamSection.js +30 -0
  105. package/dist/components/ExamSection.js.map +1 -0
  106. package/dist/components/ExamSectionTitle.d.ts +6 -0
  107. package/dist/components/ExamSectionTitle.d.ts.map +1 -0
  108. package/dist/components/ExamSectionTitle.js +21 -0
  109. package/dist/components/ExamSectionTitle.js.map +1 -0
  110. package/dist/components/ExternalMaterialList.d.ts +10 -0
  111. package/dist/components/ExternalMaterialList.d.ts.map +1 -0
  112. package/dist/components/ExternalMaterialList.js +31 -0
  113. package/dist/components/ExternalMaterialList.js.map +1 -0
  114. package/dist/components/File.d.ts +6 -0
  115. package/dist/components/File.d.ts.map +1 -0
  116. package/dist/components/File.js +15 -0
  117. package/dist/components/File.js.map +1 -0
  118. package/dist/components/Formula.d.ts +6 -0
  119. package/dist/components/Formula.d.ts.map +1 -0
  120. package/dist/components/Formula.js +12 -0
  121. package/dist/components/Formula.js.map +1 -0
  122. package/dist/components/Hints.d.ts +6 -0
  123. package/dist/components/Hints.d.ts.map +1 -0
  124. package/dist/components/Hints.js +32 -0
  125. package/dist/components/Hints.js.map +1 -0
  126. package/dist/components/Image.d.ts +6 -0
  127. package/dist/components/Image.d.ts.map +1 -0
  128. package/dist/components/Image.js +25 -0
  129. package/dist/components/Image.js.map +1 -0
  130. package/dist/components/ImageOverlay.d.ts +6 -0
  131. package/dist/components/ImageOverlay.d.ts.map +1 -0
  132. package/dist/components/ImageOverlay.js +45 -0
  133. package/dist/components/ImageOverlay.js.map +1 -0
  134. package/dist/components/ProgressBar.d.ts +6 -0
  135. package/dist/components/ProgressBar.d.ts.map +1 -0
  136. package/dist/components/ProgressBar.js +18 -0
  137. package/dist/components/ProgressBar.js.map +1 -0
  138. package/dist/components/QuestionContext.d.ts +14 -0
  139. package/dist/components/QuestionContext.d.ts.map +1 -0
  140. package/dist/components/QuestionContext.js +20 -0
  141. package/dist/components/QuestionContext.js.map +1 -0
  142. package/dist/components/Reference.d.ts +6 -0
  143. package/dist/components/Reference.d.ts.map +1 -0
  144. package/dist/components/Reference.js +63 -0
  145. package/dist/components/Reference.js.map +1 -0
  146. package/dist/components/References.d.ts +6 -0
  147. package/dist/components/References.d.ts.map +1 -0
  148. package/dist/components/References.js +23 -0
  149. package/dist/components/References.js.map +1 -0
  150. package/dist/components/ResponsiveMediaContainer.d.ts +17 -0
  151. package/dist/components/ResponsiveMediaContainer.d.ts.map +1 -0
  152. package/dist/components/ResponsiveMediaContainer.js +20 -0
  153. package/dist/components/ResponsiveMediaContainer.js.map +1 -0
  154. package/dist/components/RestrictedAudioPlayer.d.ts +11 -0
  155. package/dist/components/RestrictedAudioPlayer.d.ts.map +1 -0
  156. package/dist/components/RestrictedAudioPlayer.js +29 -0
  157. package/dist/components/RestrictedAudioPlayer.js.map +1 -0
  158. package/dist/components/RichTextAnswer.d.ts +31 -0
  159. package/dist/components/RichTextAnswer.d.ts.map +1 -0
  160. package/dist/components/RichTextAnswer.js +70 -0
  161. package/dist/components/RichTextAnswer.js.map +1 -0
  162. package/dist/components/SaveIndicator.d.ts +5 -0
  163. package/dist/components/SaveIndicator.d.ts.map +1 -0
  164. package/dist/components/SaveIndicator.js +15 -0
  165. package/dist/components/SaveIndicator.js.map +1 -0
  166. package/dist/components/Score.d.ts +6 -0
  167. package/dist/components/Score.d.ts.map +1 -0
  168. package/dist/components/Score.js +13 -0
  169. package/dist/components/Score.js.map +1 -0
  170. package/dist/components/Section.d.ts +3 -0
  171. package/dist/components/Section.d.ts.map +1 -0
  172. package/dist/components/Section.js +7 -0
  173. package/dist/components/Section.js.map +1 -0
  174. package/dist/components/SectionContext.d.ts +13 -0
  175. package/dist/components/SectionContext.d.ts.map +1 -0
  176. package/dist/components/SectionContext.js +21 -0
  177. package/dist/components/SectionContext.js.map +1 -0
  178. package/dist/components/SectionInstruction.d.ts +6 -0
  179. package/dist/components/SectionInstruction.d.ts.map +1 -0
  180. package/dist/components/SectionInstruction.js +6 -0
  181. package/dist/components/SectionInstruction.js.map +1 -0
  182. package/dist/components/TableOfContents.d.ts +13 -0
  183. package/dist/components/TableOfContents.d.ts.map +1 -0
  184. package/dist/components/TableOfContents.js +66 -0
  185. package/dist/components/TableOfContents.js.map +1 -0
  186. package/dist/components/TextAnswer.d.ts +6 -0
  187. package/dist/components/TextAnswer.d.ts.map +1 -0
  188. package/dist/components/TextAnswer.js +16 -0
  189. package/dist/components/TextAnswer.js.map +1 -0
  190. package/dist/components/TextAnswerInput.d.ts +37 -0
  191. package/dist/components/TextAnswerInput.d.ts.map +1 -0
  192. package/dist/components/TextAnswerInput.js +145 -0
  193. package/dist/components/TextAnswerInput.js.map +1 -0
  194. package/dist/components/Video.d.ts +6 -0
  195. package/dist/components/Video.d.ts.map +1 -0
  196. package/dist/components/Video.js +15 -0
  197. package/dist/components/Video.js.map +1 -0
  198. package/dist/components/results/AnnotationList.d.ts +5 -0
  199. package/dist/components/results/AnnotationList.d.ts.map +1 -0
  200. package/dist/components/results/AnnotationList.js +40 -0
  201. package/dist/components/results/AnnotationList.js.map +1 -0
  202. package/dist/components/results/ResultsChoiceAnswer.d.ts +6 -0
  203. package/dist/components/results/ResultsChoiceAnswer.d.ts.map +1 -0
  204. package/dist/components/results/ResultsChoiceAnswer.js +60 -0
  205. package/dist/components/results/ResultsChoiceAnswer.js.map +1 -0
  206. package/dist/components/results/ResultsContext.d.ts +20 -0
  207. package/dist/components/results/ResultsContext.d.ts.map +1 -0
  208. package/dist/components/results/ResultsContext.js +68 -0
  209. package/dist/components/results/ResultsContext.js.map +1 -0
  210. package/dist/components/results/ResultsDropdownAnswer.d.ts +6 -0
  211. package/dist/components/results/ResultsDropdownAnswer.d.ts.map +1 -0
  212. package/dist/components/results/ResultsDropdownAnswer.js +41 -0
  213. package/dist/components/results/ResultsDropdownAnswer.js.map +1 -0
  214. package/dist/components/results/ResultsExamQuestion.d.ts +5 -0
  215. package/dist/components/results/ResultsExamQuestion.d.ts.map +1 -0
  216. package/dist/components/results/ResultsExamQuestion.js +23 -0
  217. package/dist/components/results/ResultsExamQuestion.js.map +1 -0
  218. package/dist/components/results/ResultsExamQuestionAutoScore.d.ts +10 -0
  219. package/dist/components/results/ResultsExamQuestionAutoScore.d.ts.map +1 -0
  220. package/dist/components/results/ResultsExamQuestionAutoScore.js +16 -0
  221. package/dist/components/results/ResultsExamQuestionAutoScore.js.map +1 -0
  222. package/dist/components/results/ResultsExamQuestionManualScore.d.ts +11 -0
  223. package/dist/components/results/ResultsExamQuestionManualScore.d.ts.map +1 -0
  224. package/dist/components/results/ResultsExamQuestionManualScore.js +62 -0
  225. package/dist/components/results/ResultsExamQuestionManualScore.js.map +1 -0
  226. package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts +9 -0
  227. package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts.map +1 -0
  228. package/dist/components/results/ResultsExamQuestionScoresContainer.js +8 -0
  229. package/dist/components/results/ResultsExamQuestionScoresContainer.js.map +1 -0
  230. package/dist/components/results/ResultsExamQuestionTitle.d.ts +6 -0
  231. package/dist/components/results/ResultsExamQuestionTitle.d.ts.map +1 -0
  232. package/dist/components/results/ResultsExamQuestionTitle.js +22 -0
  233. package/dist/components/results/ResultsExamQuestionTitle.js.map +1 -0
  234. package/dist/components/results/ResultsExamSection.d.ts +5 -0
  235. package/dist/components/results/ResultsExamSection.d.ts.map +1 -0
  236. package/dist/components/results/ResultsExamSection.js +17 -0
  237. package/dist/components/results/ResultsExamSection.js.map +1 -0
  238. package/dist/components/results/ResultsScoredTextAnswer.d.ts +6 -0
  239. package/dist/components/results/ResultsScoredTextAnswer.d.ts.map +1 -0
  240. package/dist/components/results/ResultsScoredTextAnswer.js +22 -0
  241. package/dist/components/results/ResultsScoredTextAnswer.js.map +1 -0
  242. package/dist/components/results/ResultsSingleLineAnswer.d.ts +12 -0
  243. package/dist/components/results/ResultsSingleLineAnswer.d.ts.map +1 -0
  244. package/dist/components/results/ResultsSingleLineAnswer.js +12 -0
  245. package/dist/components/results/ResultsSingleLineAnswer.js.map +1 -0
  246. package/dist/components/results/ResultsTextAnswer.d.ts +6 -0
  247. package/dist/components/results/ResultsTextAnswer.d.ts.map +1 -0
  248. package/dist/components/results/ResultsTextAnswer.js +51 -0
  249. package/dist/components/results/ResultsTextAnswer.js.map +1 -0
  250. package/dist/components/results/helpers.d.ts +9 -0
  251. package/dist/components/results/helpers.d.ts.map +1 -0
  252. package/dist/components/results/helpers.js +10 -0
  253. package/dist/components/results/helpers.js.map +1 -0
  254. package/dist/components/types.d.ts +110 -0
  255. package/dist/components/types.d.ts.map +1 -0
  256. package/dist/components/types.js +1 -0
  257. package/dist/components/types.js.map +1 -0
  258. package/dist/components/withContext.d.ts +3 -0
  259. package/dist/components/withContext.d.ts.map +1 -0
  260. package/dist/components/withContext.js +12 -0
  261. package/dist/components/withContext.js.map +1 -0
  262. package/dist/main-bundle.js +1 -1
  263. package/dist/store/answers/sagas.d.ts.map +1 -1
  264. package/dist/store/answers/sagas.js +6 -0
  265. package/dist/store/answers/sagas.js.map +1 -1
  266. package/dist/types/ExamServerAPI.d.ts +2 -0
  267. package/dist/types/ExamServerAPI.d.ts.map +1 -1
  268. package/package.json +3 -3
@@ -0,0 +1,20 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ const borderedPaddingAndBorderPx = 18;
4
+ /**
5
+ * Wraps children into responsive container, which is used to prevent reflows as external media like images or videos
6
+ * finish loading, see https://www.perpetual-beta.org/weblog/responsive-images-without-browser-reflow.html for more
7
+ * information.
8
+ */
9
+ export default function ResponsiveMediaContainer({ bordered = false, className, children, height, width, caption, }) {
10
+ const paddingBottom = (height / width) * 100 + '%';
11
+ const maxWidth = width + (bordered ? borderedPaddingAndBorderPx : 0);
12
+ return (React.createElement("figure", { className: classNames('responsive-media-container', { 'responsive-media-container--bordered': bordered }, className), style: {
13
+ maxWidth,
14
+ } },
15
+ React.createElement("div", { className: "responsive-media-container__inner", style: {
16
+ paddingBottom,
17
+ } }, children),
18
+ caption && React.createElement("figcaption", { className: "e-color-darkgrey e-mrg-t-1 e-font-size-s e-light" }, caption)));
19
+ }
20
+ //# sourceMappingURL=ResponsiveMediaContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponsiveMediaContainer.js","sourceRoot":"","sources":["../../src/components/ResponsiveMediaContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,0BAA0B,GAAG,EAAE,CAAA;AAWrC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,GACuB;IAC9B,MAAM,aAAa,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,CAAA;IAClD,MAAM,QAAQ,GAAG,KAAK,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEpE,OAAO,CACL,gCACE,SAAS,EAAE,UAAU,CACnB,4BAA4B,EAC5B,EAAE,sCAAsC,EAAE,QAAQ,EAAE,EACpD,SAAS,CACV,EACD,KAAK,EAAE;YACL,QAAQ;SACT;QAED,6BACE,SAAS,EAAC,mCAAmC,EAC7C,KAAK,EAAE;gBACL,aAAa;aACd,IAEA,QAAQ,CACL;QACL,OAAO,IAAI,oCAAY,SAAS,EAAC,kDAAkD,IAAE,OAAO,CAAc,CACpG,CACV,CAAA;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { RestrictedAudioId } from '../types/ExamServerAPI';
3
+ declare function RestrictedAudioPlayer({ src, restrictedAudioId, duration, times, }: {
4
+ src: string;
5
+ restrictedAudioId: RestrictedAudioId;
6
+ duration: number;
7
+ times: number;
8
+ }): JSX.Element;
9
+ declare const _default: React.MemoExoticComponent<typeof RestrictedAudioPlayer>;
10
+ export default _default;
11
+ //# sourceMappingURL=RestrictedAudioPlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RestrictedAudioPlayer.d.ts","sourceRoot":"","sources":["../../src/components/RestrictedAudioPlayer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE1D,iBAAS,qBAAqB,CAAC,EAC7B,GAAG,EACH,iBAAiB,EACjB,QAAQ,EACR,KAAK,GACN,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;IACX,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,eA4BA;;AAED,wBAAgD"}
@@ -0,0 +1,29 @@
1
+ import { faPlay } from '@fortawesome/free-solid-svg-icons/faPlay';
2
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
+ import classNames from 'classnames';
4
+ import React from 'react';
5
+ import { useDispatch, useSelector } from 'react-redux';
6
+ import { playAudio } from '../store/audio/actions';
7
+ import { getAudioState, getDurationRemaining, getPlaybackTimesRemaining } from '../store/selectors';
8
+ function RestrictedAudioPlayer({ src, restrictedAudioId, duration, times, }) {
9
+ const audioState = useSelector(getAudioState(src, restrictedAudioId));
10
+ const durationRemaining = useSelector(getDurationRemaining(src, restrictedAudioId));
11
+ const playbackTimesRemaining = useSelector(getPlaybackTimesRemaining(restrictedAudioId, times));
12
+ const dispatch = useDispatch();
13
+ const disabled = audioState !== 'stopped' || playbackTimesRemaining === 0;
14
+ return (React.createElement("div", { className: classNames('restricted-audio-player e-column e-column--narrow e-columns e-columns--inline e-columns--center-v e-pad-1', { 'restricted-audio-player--disabled': disabled }) },
15
+ React.createElement("button", { className: classNames('restricted-audio-player__play e-column e-column--narrow', {
16
+ 'restricted-audio-player__play--playing': audioState === 'playing',
17
+ }), disabled: disabled, onClick: () => audioState === 'stopped' && dispatch(playAudio({ src, restrictedAudioId, duration })) }, audioState !== 'playing' && React.createElement(FontAwesomeIcon, { icon: faPlay, fixedWidth: true, "aria-label": "..." })),
18
+ React.createElement("span", { className: "restricted-audio-player__duration e-column e-text-right" }, formatDuration(durationRemaining != null ? durationRemaining : duration))));
19
+ }
20
+ export default React.memo(RestrictedAudioPlayer);
21
+ function formatDuration(duration) {
22
+ const minutes = Math.floor(duration / 60);
23
+ const seconds = duration % 60;
24
+ return padWithZeroes(minutes) + ':' + padWithZeroes(seconds);
25
+ }
26
+ function padWithZeroes(num) {
27
+ return num.toString().padStart(2, '0');
28
+ }
29
+ //# sourceMappingURL=RestrictedAudioPlayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RestrictedAudioPlayer.js","sourceRoot":"","sources":["../../src/components/RestrictedAudioPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAGnG,SAAS,qBAAqB,CAAC,EAC7B,GAAG,EACH,iBAAiB,EACjB,QAAQ,EACR,KAAK,GAMN;IACC,MAAM,UAAU,GAAG,WAAW,CAAC,aAAa,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAA;IACrE,MAAM,iBAAiB,GAAG,WAAW,CAAC,oBAAoB,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAA;IACnF,MAAM,sBAAsB,GAAG,WAAW,CAAC,yBAAyB,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAA;IAC/F,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,QAAQ,GAAG,UAAU,KAAK,SAAS,IAAI,sBAAsB,KAAK,CAAC,CAAA;IAEzE,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CACnB,2GAA2G,EAC3G,EAAE,mCAAmC,EAAE,QAAQ,EAAE,CAClD;QAED,gCACE,SAAS,EAAE,UAAU,CAAC,yDAAyD,EAAE;gBAC/E,wCAAwC,EAAE,UAAU,KAAK,SAAS;aACnE,CAAC,EACF,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,KAAK,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,CAAC,IAEnG,UAAU,KAAK,SAAS,IAAI,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,EAAE,UAAU,sBAAY,KAAK,GAAG,CACnF;QACT,8BAAM,SAAS,EAAC,yDAAyD,IACtE,cAAc,CAAC,iBAAiB,IAAI,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,CACpE,CACH,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;AAEhD,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAA;IACzC,MAAM,OAAO,GAAG,QAAQ,GAAG,EAAE,CAAA;IAE7B,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;AAC9D,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;AACxC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { CommonExamContext } from './CommonExamContext';
3
+ import { Translations } from '../i18n/fi-FI';
4
+ import { RichTextAnswer as RichTextAnswerT } from '../types/ExamAnswer';
5
+ export interface AnswerError {
6
+ key: keyof Translations['answer-errors'];
7
+ options?: object;
8
+ }
9
+ interface Props {
10
+ answer?: RichTextAnswerT;
11
+ className?: string;
12
+ maxImages: number;
13
+ questionId: number;
14
+ onChange: (answerHTML: string, answerText: string) => void;
15
+ onError: (error: AnswerError) => void;
16
+ saveScreenshot: (screenshot: Blob) => Promise<string>;
17
+ }
18
+ export default class RichTextAnswer extends React.PureComponent<Props, {}> {
19
+ static contextType: React.Context<CommonExamContext>;
20
+ context: React.ContextType<typeof CommonExamContext>;
21
+ private ref;
22
+ private lastHTML;
23
+ constructor(props: Props);
24
+ componentDidMount(): void;
25
+ handleSaveError: (err: any) => void;
26
+ handleChange: (data: any) => void;
27
+ componentDidUpdate(): void;
28
+ render(): JSX.Element;
29
+ }
30
+ export {};
31
+ //# sourceMappingURL=RichTextAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTextAnswer.d.ts","sourceRoot":"","sources":["../../src/components/RichTextAnswer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAIvE,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,YAAY,CAAC,eAAe,CAAC,CAAA;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1D,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IACrC,cAAc,EAAE,CAAC,UAAU,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACtD;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,CAAC;IACxE,MAAM,CAAC,WAAW,mCAAoB;IAC9B,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAA;IAC5D,OAAO,CAAC,GAAG,CAAiC;IAC5C,OAAO,CAAC,QAAQ,CAAQ;gBAEZ,KAAK,EAAE,KAAK;IAMxB,iBAAiB;IA2BjB,eAAe,qBAad;IAED,YAAY,sBAYX;IAED,kBAAkB;IASlB,MAAM;CAWP"}
@@ -0,0 +1,70 @@
1
+ import classNames from 'classnames';
2
+ import * as _ from 'lodash-es';
3
+ import React from 'react';
4
+ import { CommonExamContext } from './CommonExamContext';
5
+ const richTextEditor = require('rich-text-editor/dist/rich-text-editor');
6
+ export default class RichTextAnswer extends React.PureComponent {
7
+ constructor(props) {
8
+ super(props);
9
+ this.handleSaveError = (err) => {
10
+ const key = (() => {
11
+ switch (_.get(err, 'response.status')) {
12
+ case 409:
13
+ return 'screenshot-byte-limit-reached';
14
+ case 413:
15
+ return 'screenshot-too-big';
16
+ default:
17
+ return 'screenshot-upload-failed';
18
+ }
19
+ })();
20
+ this.props.onError({ key });
21
+ };
22
+ this.handleChange = (data) => {
23
+ const { onChange, onError, maxImages } = this.props;
24
+ if (data.error) {
25
+ onError({
26
+ key: 'screenshot-limit-exceeded',
27
+ options: { limit: maxImages },
28
+ });
29
+ }
30
+ else {
31
+ this.lastHTML = data.answerHTML;
32
+ onChange(data.answerHTML, data.answerText);
33
+ }
34
+ };
35
+ this.ref = React.createRef();
36
+ this.lastHTML = this.props.answer ? this.props.answer.value : '';
37
+ }
38
+ componentDidMount() {
39
+ const { current } = this.ref;
40
+ const { answer, saveScreenshot, maxImages } = this.props;
41
+ if (current) {
42
+ if (answer) {
43
+ current.innerHTML = answer.value;
44
+ }
45
+ richTextEditor.makeRichText(current, {
46
+ locale: this.context.language.slice(0, 2).toUpperCase(),
47
+ screenshot: {
48
+ saver: ({ data, type }) => saveScreenshot(data instanceof Blob ? data : new Blob([data], { type })).catch((err) => {
49
+ this.handleSaveError(err);
50
+ throw err; // Rethrow error so rich-text-editor can handle it.
51
+ }),
52
+ limit: maxImages,
53
+ },
54
+ }, _.after(2, this.handleChange) /* TODO: Why does r-t-e send a change event in the beginning? */);
55
+ }
56
+ }
57
+ componentDidUpdate() {
58
+ const { current } = this.ref;
59
+ // Don't update element unless value has changed from last known value to prevent cursor jumping
60
+ if (current && this.props.answer && this.props.answer.value !== this.lastHTML) {
61
+ current.innerHTML = this.lastHTML = this.props.answer.value;
62
+ }
63
+ }
64
+ render() {
65
+ const { className, questionId } = this.props;
66
+ return (React.createElement("div", { ref: this.ref, className: classNames('text-answer text-answer--multi-line', className), "data-question-id": questionId }));
67
+ }
68
+ }
69
+ RichTextAnswer.contextType = CommonExamContext;
70
+ //# sourceMappingURL=RichTextAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTextAnswer.js","sourceRoot":"","sources":["../../src/components/RichTextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAIvD,MAAM,cAAc,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAA;AAiBxE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAwB;IAMxE,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAA;QAgCd,oBAAe,GAAG,CAAC,GAAQ,EAAE,EAAE;YAC7B,MAAM,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ACb,SAAS,EAAE,UAAU,CAAC,qCAAqC,EAAE,SAAS,CAAC,sBACrD,UAAU,GAC5B,CACH,CAAA;IACH,CAAC;;AAtFM,0BAAW,GAAG,iBAAiB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare function SaveIndicator(): JSX.Element | null;
3
+ declare const _default: React.MemoExoticComponent<typeof SaveIndicator>;
4
+ export default _default;
5
+ //# sourceMappingURL=SaveIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveIndicator.d.ts","sourceRoot":"","sources":["../../src/components/SaveIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,iBAAS,aAAa,uBAcrB;;AAED,wBAAwC"}
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { Translation } from 'react-i18next';
3
+ import { useSelector } from 'react-redux';
4
+ import { getGlobalSaveState } from '../store/selectors';
5
+ function SaveIndicator() {
6
+ const state = useSelector(getGlobalSaveState());
7
+ if (state === 'initial') {
8
+ return null;
9
+ }
10
+ return (React.createElement("div", { className: "save-indicator" },
11
+ React.createElement("span", { className: 'save-indicator-text--' + state },
12
+ React.createElement(Translation, null, (t) => t('answer-saved')))));
13
+ }
14
+ export default React.memo(SaveIndicator);
15
+ //# sourceMappingURL=SaveIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveIndicator.js","sourceRoot":"","sources":["../../src/components/SaveIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAGvD,SAAS,aAAa;IACpB,MAAM,KAAK,GAAc,WAAW,CAAC,kBAAkB,EAAE,CAAC,CAAA;IAE1D,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;QAC7B,8BAAM,SAAS,EAAE,uBAAuB,GAAG,KAAK;YAC9C,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAe,CAChD,CACH,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function Score({ size, score }: {
3
+ size?: 'inline' | 'small' | 'large';
4
+ score: number;
5
+ }): JSX.Element;
6
+ //# sourceMappingURL=Score.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Score.d.ts","sourceRoot":"","sources":["../../src/components/Score.tsx"],"names":[],"mappings":";AAIA,wBAAgB,KAAK,CAAC,EAAE,IAAc,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,eAetG"}
@@ -0,0 +1,13 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ export function Score({ size = 'small', score }) {
5
+ const { t } = useTranslation();
6
+ const Tag = size === 'inline' ? 'sup' : 'span';
7
+ return (React.createElement(Tag, { className: classNames('e-score e-nowrap', {
8
+ 'e-score--small e-font-size-m e-semibold': size === 'small',
9
+ 'e-score--large e-font-size-l e-semibold': size === 'large',
10
+ 'e-score--inline e-font-size-xs': size === 'inline',
11
+ }), "aria-label": t('points-screen-reader', { count: score }) }, t('points', { count: score })));
12
+ }
13
+ //# sourceMappingURL=Score.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Score.js","sourceRoot":"","sources":["../../src/components/Score.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,OAAO,EAAE,KAAK,EAA0D;IACrG,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,GAAG,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAA;IAC9C,OAAO,CACL,oBAAC,GAAG,IACF,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE;YACxC,yCAAyC,EAAE,IAAI,KAAK,OAAO;YAC3D,yCAAyC,EAAE,IAAI,KAAK,OAAO;YAC3D,gCAAgC,EAAE,IAAI,KAAK,QAAQ;SACpD,CAAC,gBACU,CAAC,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAEtD,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAC1B,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export default function Section(props: React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>): JSX.Element;
3
+ //# sourceMappingURL=Section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/components/Section.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,eAG7G"}
@@ -0,0 +1,7 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ export default function Section(props) {
4
+ const className = classNames('e-section e-bg-color-off-white e-pad-6', props.className);
5
+ return React.createElement("section", Object.assign({}, { ...props, className }), props.children);
6
+ }
7
+ //# sourceMappingURL=Section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Section.js","sourceRoot":"","sources":["../../src/components/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAA8E;IAC5G,MAAM,SAAS,GAAG,UAAU,CAAC,wCAAwC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;IACvF,OAAO,iDAAa,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAW,CAAA;AACzE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ export interface SectionContext {
4
+ casForbidden: boolean;
5
+ displayNumber: string;
6
+ maxAnswers?: number;
7
+ minAnswers?: number;
8
+ maxScore: number;
9
+ childQuestions: Element[];
10
+ }
11
+ export declare const SectionContext: React.Context<SectionContext>;
12
+ export declare const withSectionContext: (Component: React.ComponentType<ExamComponentProps>) => React.ComponentType<ExamComponentProps>;
13
+ //# sourceMappingURL=SectionContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionContext.d.ts","sourceRoot":"","sources":["../../src/components/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,iGAkB7B,CAAA"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { getNumericAttribute, mapChildElements } from '../dom-utils';
3
+ import { withContext } from './withContext';
4
+ export const SectionContext = React.createContext({});
5
+ export const withSectionContext = withContext(SectionContext, ({ element }) => {
6
+ const casForbidden = element.getAttribute('cas-forbidden') === 'true';
7
+ const displayNumber = element.getAttribute('display-number');
8
+ const maxAnswers = getNumericAttribute(element, 'max-answers');
9
+ const minAnswers = getNumericAttribute(element, 'min-answers');
10
+ const maxScore = getNumericAttribute(element, 'max-score');
11
+ const childQuestions = mapChildElements(element, (childElement) => childElement).filter((parentNode) => parentNode.localName === 'question');
12
+ return {
13
+ casForbidden,
14
+ displayNumber,
15
+ maxAnswers,
16
+ minAnswers,
17
+ maxScore,
18
+ childQuestions,
19
+ };
20
+ });
21
+ //# sourceMappingURL=SectionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionContext.js","sourceRoot":"","sources":["../../src/components/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpE,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,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM,CAAA;IACrE,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,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,MAAM,CACrF,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,KAAK,UAAU,CACpD,CAAA;IAED,OAAO;QACL,YAAY;QACZ,aAAa;QACb,UAAU;QACV,UAAU;QACV,QAAQ;QACR,cAAc;KACf,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function SectionInstruction({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof SectionInstruction>;
5
+ export default _default;
6
+ //# sourceMappingURL=SectionInstruction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionInstruction.d.ts","sourceRoot":"","sources":["../../src/components/SectionInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,kBAAkB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAE5E;;AAED,wBAA6C"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ function SectionInstruction({ element, renderChildNodes }) {
3
+ return React.createElement("div", { className: "e-mrg-b-2" }, renderChildNodes(element));
4
+ }
5
+ export default React.memo(SectionInstruction);
6
+ //# sourceMappingURL=SectionInstruction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionInstruction.js","sourceRoot":"","sources":["../../src/components/SectionInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,SAAS,kBAAkB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IAC3E,OAAO,6BAAK,SAAS,EAAC,WAAW,IAAE,gBAAgB,CAAC,OAAO,CAAC,CAAO,CAAA;AACrE,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ export interface TOCSectionTitleProps {
4
+ element: Element;
5
+ displayNumber: string;
6
+ maxAnswers?: number;
7
+ minAnswers?: number;
8
+ childQuestions: Element[];
9
+ }
10
+ declare function TableOfContents(_props: ExamComponentProps): JSX.Element;
11
+ declare const _default: React.MemoExoticComponent<typeof TableOfContents>;
12
+ export default _default;
13
+ //# sourceMappingURL=TableOfContents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../../src/components/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAA0B,kBAAkB,EAAiB,MAAM,2BAA2B,CAAA;AA8BrG,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AA4DD,iBAAS,eAAe,CAAC,MAAM,EAAE,kBAAkB,eAmBlD;;AAED,wBAA0C"}
@@ -0,0 +1,66 @@
1
+ import React, { useContext } from 'react';
2
+ import { Translation, useTranslation } from 'react-i18next';
3
+ import { createRenderChildNodes, RenderOptions } from '../createRenderChildNodes';
4
+ import { findChildElement } from '../dom-utils';
5
+ import { url } from '../url';
6
+ import AnsweringInstructions from './AnsweringInstructions';
7
+ import { CommonExamContext } from './CommonExamContext';
8
+ import { QuestionContext, withQuestionContext } from './QuestionContext';
9
+ import { SectionContext, withSectionContext } from './SectionContext';
10
+ function TOCSection({ element }) {
11
+ const { maxAnswers, minAnswers, displayNumber, childQuestions } = useContext(SectionContext);
12
+ const sectionTitle = findChildElement(element, 'section-title');
13
+ return (React.createElement("li", null,
14
+ sectionTitle && (React.createElement(TOCSectionTitle, Object.assign({}, {
15
+ element: sectionTitle,
16
+ displayNumber,
17
+ maxAnswers,
18
+ minAnswers,
19
+ childQuestions,
20
+ }))),
21
+ React.createElement("ol", { className: "e-list-data e-pad-l-0" }, renderChildNodes(element, RenderOptions.SkipHTML))));
22
+ }
23
+ function TOCSectionTitle({ element, displayNumber, minAnswers, maxAnswers, childQuestions }) {
24
+ const { numberOfSections } = useContext(CommonExamContext);
25
+ const { t } = useTranslation();
26
+ return (React.createElement("header", null,
27
+ element.hasChildNodes() && (React.createElement("b", null,
28
+ numberOfSections > 1 && t('part', { displayNumber }),
29
+ " ",
30
+ element && renderChildNodes(element))),
31
+ maxAnswers != null && (React.createElement("div", null,
32
+ React.createElement(AnsweringInstructions, { maxAnswers: maxAnswers, minAnswers: minAnswers, childQuestions: childQuestions, type: "toc-section" })))));
33
+ }
34
+ function TOCQuestion({ element }) {
35
+ const { attachmentsURL } = useContext(CommonExamContext);
36
+ const { level, displayNumber, maxScore } = useContext(QuestionContext);
37
+ const hasExternalAttachments = findChildElement(element, 'external-material') != null;
38
+ const questionTitle = findChildElement(element, 'question-title');
39
+ return level === 0 ? (React.createElement("li", { "data-list-number": displayNumber + '.' },
40
+ React.createElement("div", { className: "e-columns" },
41
+ questionTitle && (React.createElement("span", { className: "e-column" },
42
+ React.createElement("a", { href: url('', { hash: displayNumber }) }, renderChildNodes(questionTitle)))),
43
+ hasExternalAttachments && (React.createElement("span", { className: "e-column e-column--narrow" },
44
+ React.createElement("a", { href: url(attachmentsURL, { hash: displayNumber }), target: "attachments" },
45
+ React.createElement(Translation, null, (t) => t('material'))))),
46
+ React.createElement("span", { className: "e-column e-column--narrow table-of-contents--score-column" },
47
+ React.createElement(Translation, null, (t) => t('points', { count: maxScore })))))) : null;
48
+ }
49
+ const renderChildNodes = createRenderChildNodes({
50
+ section: withSectionContext(TOCSection),
51
+ question: withQuestionContext(TOCQuestion),
52
+ });
53
+ function TableOfContents(_props) {
54
+ const { root, maxScore } = useContext(CommonExamContext);
55
+ return (React.createElement("nav", { className: "table-of-contents e-mrg-b-6", "aria-labelledby": "toc-title" },
56
+ React.createElement("h2", { id: "toc-title" },
57
+ React.createElement(Translation, null, (t) => t('toc-heading'))),
58
+ React.createElement("ol", { className: "e-list-plain e-pad-l-0" }, renderChildNodes(root)),
59
+ React.createElement("div", { className: "e-columns" },
60
+ React.createElement("strong", { className: "e-column" },
61
+ React.createElement(Translation, null, (t) => t('exam-total'))),
62
+ React.createElement("strong", { className: "e-column e-column--narrow table-of-contents--score-column" },
63
+ React.createElement(Translation, null, (t) => t('points', { count: maxScore }))))));
64
+ }
65
+ export default React.memo(TableOfContents);
66
+ //# sourceMappingURL=TableOfContents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableOfContents.js","sourceRoot":"","sources":["../../src/components/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAsB,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA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GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAExD,OAAO,CACL,6BAAK,SAAS,EAAC,6BAA6B,qBAAiB,WAAW;QACtE,4BAAI,EAAE,EAAC,WAAW;YAChB,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAe,CACjD;QACL,4BAAI,SAAS,EAAC,wBAAwB,IAAE,gBAAgB,CAAC,IAAI,CAAC,CAAM;QACpE,6BAAK,SAAS,EAAC,WAAW;YACxB,gCAAQ,SAAS,EAAC,UAAU;gBAC1B,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAe,CAC5C;YACT,gCAAQ,SAAS,EAAC,2DAA2D;gBAC3E,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAe,CAC7D,CACL,CACF,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function TextAnswer(props: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof TextAnswer>;
5
+ export default _default;
6
+ //# sourceMappingURL=TextAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnswer.d.ts","sourceRoot":"","sources":["../../src/components/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,UAAU,CAAC,KAAK,EAAE,kBAAkB,eAe5C;;AAED,wBAAqC"}
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { findChildElement } from '../dom-utils';
3
+ import { shortDisplayNumber } from '../shortDisplayNumber';
4
+ import TextAnswerInput from './TextAnswerInput';
5
+ function TextAnswer(props) {
6
+ const { element, renderChildNodes } = props;
7
+ const displayNumber = element.getAttribute('display-number');
8
+ const hint = findChildElement(element, 'hint');
9
+ const textAnswer = React.createElement(TextAnswerInput, Object.assign({}, props));
10
+ return hint ? (React.createElement("label", { className: "e-nowrap" },
11
+ React.createElement("sup", { className: "e-text-answer-display-number e-color-darkgrey" }, shortDisplayNumber(displayNumber)),
12
+ React.createElement("span", { className: "e-screen-reader-only" }, renderChildNodes(hint)),
13
+ textAnswer)) : (textAnswer);
14
+ }
15
+ export default React.memo(TextAnswer);
16
+ //# sourceMappingURL=TextAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnswer.js","sourceRoot":"","sources":["../../src/components/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAG/C,SAAS,UAAU,CAAC,KAAyB;IAC3C,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAA;IAC3C,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAC7D,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC9C,MAAM,UAAU,GAAG,oBAAC,eAAe,oBAAK,KAAK,EAAI,CAAA;IAEjD,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ,+BAAO,SAAS,EAAC,UAAU;QACzB,6BAAK,SAAS,EAAC,+CAA+C,IAAE,kBAAkB,CAAC,aAAa,CAAC,CAAO;QACxG,8BAAM,SAAS,EAAC,sBAAsB,IAAE,gBAAgB,CAAC,IAAI,CAAC,CAAQ;QACrE,UAAU,CACL,CACT,CAAC,CAAC,CAAC,CACF,UAAU,CACX,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA"}
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ import * as actions from '../store/answers/actions';
4
+ import { RichTextAnswer as RichTextAnswerT, TextAnswer as TextAnswerT } from '../types/ExamAnswer';
5
+ import { AnswerError } from './RichTextAnswer';
6
+ interface Props extends ExamComponentProps {
7
+ answer?: TextAnswerT | RichTextAnswerT;
8
+ answerBlurred: typeof actions.answerBlurred;
9
+ answerFocused: typeof actions.answerFocused;
10
+ maxImages: number;
11
+ saveAnswer: typeof actions.saveAnswer;
12
+ selectAnswerVersion: typeof actions.selectAnswerVersion;
13
+ showAnswerHistory: boolean;
14
+ supportsAnswerHistory: boolean;
15
+ type: 'rich-text' | 'multi-line' | 'single-line';
16
+ }
17
+ interface State {
18
+ error: AnswerError | null;
19
+ }
20
+ export declare class TextAnswerInput extends React.PureComponent<Props, State> {
21
+ private ref;
22
+ constructor(props: Props);
23
+ componentDidMount(): void;
24
+ componentDidUpdate(): void;
25
+ onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
26
+ onRichTextChange: (answerHtml: string, answerText: string) => void;
27
+ onFocus: () => void;
28
+ onBlur: () => void;
29
+ onError: (error: AnswerError) => void;
30
+ clearErrors: () => void;
31
+ resize(): void;
32
+ render(): JSX.Element;
33
+ }
34
+ export declare function getCharacterCount(answerText: string): number;
35
+ declare const _default: import("react-redux").ConnectedComponent<typeof TextAnswerInput, Pick<React.ClassAttributes<typeof TextAnswerInput> & Props, "className" | "ref" | "key" | "element" | "renderChildNodes"> & ExamComponentProps>;
36
+ export default _default;
37
+ //# sourceMappingURL=TextAnswerInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAnswerInput.d.ts","sourceRoot":"","sources":["../../src/components/TextAnsw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