@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,5 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare const _default: React.MemoExoticComponent<React.ComponentType<ExamComponentProps>>;
4
+ export default _default;
5
+ //# sourceMappingURL=ExamSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExamSection.d.ts","sourceRoot":"","sources":["../../src/components/ExamSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAUzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;;AAgD9D,wBAA0D"}
@@ -0,0 +1,30 @@
1
+ import React, { useContext } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { shallowEqual, useDispatch, useSelector } from 'react-redux';
4
+ import { allowCas, allowCasCancelled } from '../store/cas/actions';
5
+ import { ExamContext } from './ExamContext';
6
+ import ProgressBar from './ProgressBar';
7
+ import Section from './Section';
8
+ import { SectionContext, withSectionContext } from './SectionContext';
9
+ function ExamSection({ element, renderChildNodes }) {
10
+ const casState = useSelector((state) => state.cas, shallowEqual);
11
+ const { casForbidden, displayNumber } = useContext(SectionContext);
12
+ return (React.createElement(Section, { className: "exam-section", "aria-labelledby": displayNumber + '-title' },
13
+ renderChildNodes(element),
14
+ casForbidden && React.createElement(CasControls, Object.assign({}, casState))));
15
+ }
16
+ function CasControls(props) {
17
+ const dispatch = useDispatch();
18
+ const { t } = useTranslation();
19
+ const { casCountdownDuration } = useContext(ExamContext);
20
+ return (React.createElement("div", { className: "e-cas-controls" }, props.casStatus === 'forbidden' ? (React.createElement("div", { className: "e-text-center" },
21
+ React.createElement("hr", { className: "e-exam-separator" }),
22
+ React.createElement("p", null, t('cas.forbidden.infoText')),
23
+ React.createElement("button", { className: "e-button", id: "allow-cas", onClick: () => dispatch(allowCas(casCountdownDuration)) }, t('cas.forbidden.buttonText')))) : props.casStatus === 'allowing' ? (React.createElement("div", { className: "e-text-center", ref: (e) => e != null && casCountdownDuration === props.durationRemaining && e.scrollIntoView() },
24
+ React.createElement("hr", { className: "e-exam-separator" }),
25
+ React.createElement("p", null, t('cas.allowing.infoText')),
26
+ React.createElement(ProgressBar, { className: "e-mrg-b-2", duration: casCountdownDuration }),
27
+ React.createElement("button", { className: "e-button", id: "allow-cas-cancelled", onClick: () => dispatch(allowCasCancelled()) }, t('cas.allowing.buttonText', { count: props.durationRemaining })))) : (React.createElement("div", { className: "notification e-text-left e-mrg-b-0" }, t('cas.allowed.infoText')))));
28
+ }
29
+ export default React.memo(withSectionContext(ExamSection));
30
+ //# sourceMappingURL=ExamSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExamSection.js","sourceRoot":"","sources":["../../src/components/ExamSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,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C,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,IAChG,CAAC,CAAC,0BAA0B,CAAC,CACvB,CACL,CACP,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,CACnC,6BACE,SAAS,EAAC,eAAe,EACzB,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,oBAAoB,KAAK,KAAK,CAAC,iBAAiB,IAAI,CAAC,CAAC,cAAc,EAAE;QAE/F,4BAAI,SAAS,EAAC,kBAAkB,GAAG;QACnC,+BAAI,CAAC,CAAC,uBAAuB,CAAC,CAAK;QACnC,oBAAC,WAAW,IAAC,SAAS,EAAC,WAAW,EAAC,QAAQ,EAAE,oBAAoB,GAAI;QACrE,gCAAQ,SAAS,EAAC,UAAU,EAAC,EAAE,EAAC,qBAAqB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,IAC/F,CAAC,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAC1D,CACL,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,SAAS,EAAC,oCAAoC,IAAE,CAAC,CAAC,sBAAsB,CAAC,CAAO,CACtF,CACG,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function ExamSectionTitle({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof ExamSectionTitle>;
5
+ export default _default;
6
+ //# sourceMappingURL=ExamSectionTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExamSectionTitle.d.ts","sourceRoot":"","sources":["../../src/components/ExamSectionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAMzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,gBAAgB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAyB1E;;AAED,wBAA2C"}
@@ -0,0 +1,21 @@
1
+ import React, { useContext } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import AnsweringInstructions from './AnsweringInstructions';
4
+ import { CommonExamContext } from './CommonExamContext';
5
+ import NotificationIcon from './NotificationIcon';
6
+ import { SectionContext } from './SectionContext';
7
+ function ExamSectionTitle({ element, renderChildNodes }) {
8
+ const { numberOfSections } = useContext(CommonExamContext);
9
+ const { displayNumber, minAnswers, maxAnswers, childQuestions } = useContext(SectionContext);
10
+ const { t } = useTranslation();
11
+ return (React.createElement(React.Fragment, null,
12
+ element.hasChildNodes() && (React.createElement("h2", { className: "exam-section-title", id: displayNumber + '-title' },
13
+ numberOfSections > 1 && t('part', { displayNumber }),
14
+ " ",
15
+ renderChildNodes(element))),
16
+ maxAnswers != null && (React.createElement("span", { className: "notification notification--inline" },
17
+ React.createElement(NotificationIcon, null),
18
+ React.createElement(AnsweringInstructions, { maxAnswers: maxAnswers, minAnswers: minAnswers, childQuestions: childQuestions, type: "section" })))));
19
+ }
20
+ export default React.memo(ExamSectionTitle);
21
+ //# sourceMappingURL=ExamSectionTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExamSectionTitle.js","sourceRoot":"","sources":["../../src/components/ExamSectionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,SAAS,gBAAgB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACzE,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC1D,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC5F,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAE9B,OAAO,CACL;QACG,OAAO,CAAC,aAAa,EAAE,IAAI,CAC1B,4BAAI,SAAS,EAAC,oBAAoB,EAAC,EAAE,EAAE,aAAa,GAAG,QAAQ;YAC5D,gBAAgB,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,CAAC;;YAAG,gBAAgB,CAAC,OAAO,CAAC,CAC9E,CACN;QACA,UAAU,IAAI,IAAI,IAAI,CACrB,8BAAM,SAAS,EAAC,mCAAmC;YACjD,oBAAC,gBAAgB,OAAG;YACpB,oBAAC,qBAAqB,IACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAC,SAAS,GACd,CACG,CACR,CACA,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ interface ExternalMaterialListProps extends ExamComponentProps {
4
+ forceRender?: boolean;
5
+ showTitle?: boolean;
6
+ }
7
+ declare function ExternalMaterialList({ element, showTitle, forceRender }: ExternalMaterialListProps): JSX.Element | null;
8
+ declare const _default: React.MemoExoticComponent<typeof ExternalMaterialList>;
9
+ export default _default;
10
+ //# sourceMappingURL=ExternalMaterialList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalMaterialList.d.ts","sourceRoot":"","sources":["../../src/components/ExternalMaterialList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAA0B,kBAAkB,EAAiB,MAAM,2BAA2B,CAAA;AAgCrG,UAAU,yBAA0B,SAAQ,kBAAkB;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,iBAAS,oBAAoB,CAAC,EAAE,OAAO,EAAE,SAAgB,EAAE,WAAmB,EAAE,EAAE,yBAAyB,sBAa1G;;AAED,wBAA+C"}
@@ -0,0 +1,31 @@
1
+ import React, { useContext } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { createRenderChildNodes, RenderOptions } from '../createRenderChildNodes';
4
+ import { queryAncestors } from '../dom-utils';
5
+ import { url } from '../url';
6
+ import { AttachmentContext, withAttachmentContext } from './AttachmentContext';
7
+ import { CommonExamContext } from './CommonExamContext';
8
+ const renderChildNodes = createRenderChildNodes({
9
+ attachment: withAttachmentContext(Attachment),
10
+ 'attachment-title': AttachmentTitle,
11
+ });
12
+ function Attachment({ element }) {
13
+ const { displayNumber } = useContext(AttachmentContext);
14
+ return (React.createElement("li", { "data-list-number": displayNumber, "aria-label": displayNumber.replace(' ', '') }, renderChildNodes(element, RenderOptions.SkipHTML)));
15
+ }
16
+ function AttachmentTitle({ element }) {
17
+ const { attachmentsURL } = useContext(CommonExamContext);
18
+ const { displayNumber } = useContext(AttachmentContext);
19
+ return (React.createElement("a", { href: url(attachmentsURL, { hash: displayNumber }), className: "exam-attachment-title", target: "attachments" }, renderChildNodes(element)));
20
+ }
21
+ function ExternalMaterialList({ element, showTitle = true, forceRender = false }) {
22
+ if (queryAncestors(element, 'question') == null && !forceRender) {
23
+ return null;
24
+ }
25
+ const { t } = useTranslation();
26
+ return (React.createElement("div", { className: "external-material-list e-mrg-b-4" },
27
+ showTitle && React.createElement("div", { className: "e-font-size-l e-semibold" }, t('external-material-title')),
28
+ React.createElement("ol", { className: "e-list-data e-pad-l-0 e-mrg-0" }, renderChildNodes(element))));
29
+ }
30
+ export default React.memo(ExternalMaterialList);
31
+ //# sourceMappingURL=ExternalMaterialList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalMaterialList.js","sourceRoot":"","sources":["../../src/components/ExternalMaterialList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAsB,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACrG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;IAC9C,UAAU,EAAE,qBAAqB,CAAC,UAAU,CAAC;IAC7C,kBAAkB,EAAE,eAAe;CACpC,CAAC,CAAA;AAEF,SAAS,UAAU,CAAC,EAAE,OAAO,EAAsB;IACjD,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAEvD,OAAO,CACL,gDAAsB,aAAa,gBAAc,aAAc,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAC7E,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,CAC/C,CACN,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,OAAO,EAAsB;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACxD,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAEvD,OAAO,CACL,2BAAG,IAAI,EAAE,GAAG,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,aAAc,EAAE,CAAC,EAAE,SAAS,EAAC,uBAAuB,EAAC,MAAM,EAAC,aAAa,IAC3G,gBAAgB,CAAC,OAAO,CAAC,CACxB,CACL,CAAA;AACH,CAAC;AAOD,SAAS,oBAAoB,CAAC,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,WAAW,GAAG,KAAK,EAA6B;IACzG,IAAI,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE;QAC/D,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAE9B,OAAO,CACL,6BAAK,SAAS,EAAC,kCAAkC;QAC9C,SAAS,IAAI,6BAAK,SAAS,EAAC,0BAA0B,IAAE,CAAC,CAAC,yBAAyB,CAAC,CAAO;QAC5F,4BAAI,SAAS,EAAC,+BAA+B,IAAE,gBAAgB,CAAC,OAAO,CAAC,CAAM,CAC1E,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function File({ element, className, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof File>;
5
+ export default _default;
6
+ //# sourceMappingURL=File.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/components/File.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAgBzE;;AAED,wBAA+B"}
@@ -0,0 +1,15 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import { CommonExamContext } from './CommonExamContext';
4
+ function File({ element, className, renderChildNodes }) {
5
+ const src = element.getAttribute('src');
6
+ const hasDescription = element.hasChildNodes();
7
+ const { resolveAttachment } = useContext(CommonExamContext);
8
+ return (React.createElement("a", { className: classNames('file e-nowrap', className), href: resolveAttachment(src), download: true }, hasDescription ? (React.createElement(React.Fragment, null,
9
+ renderChildNodes(element),
10
+ " (",
11
+ src,
12
+ ")")) : (src)));
13
+ }
14
+ export default React.memo(File);
15
+ //# sourceMappingURL=File.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"File.js","sourceRoot":"","sources":["../../src/components/File.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,SAAS,IAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAsB;IACxE,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAE,CAAA;IACxC,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAA;IAC9C,MAAM,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAE3D,OAAO,CACL,2BAAG,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,QAAQ,UACzF,cAAc,CAAC,CAAC,CAAC,CAChB;QACG,gBAAgB,CAAC,OAAO,CAAC;;QAAI,GAAG;YAChC,CACJ,CAAC,CAAC,CAAC,CACF,GAAG,CACJ,CACC,CACL,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function Formula({ element, className }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof Formula>;
5
+ export default _default;
6
+ //# sourceMappingURL=Formula.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Formula.d.ts","sourceRoot":"","sources":["../../src/components/Formula.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,eAQ1D;;AAED,wBAAkC"}
@@ -0,0 +1,12 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ function Formula({ element, className }) {
4
+ const svg = element.getAttribute('svg');
5
+ const mml = element.getAttribute('mml');
6
+ const mode = element.getAttribute('mode') || 'inline';
7
+ const Tag = mode === 'inline' ? 'span' : 'div';
8
+ const html = svg + '<span class="e-screen-reader-only" role="presentation">' + mml + '</span>';
9
+ return React.createElement(Tag, { className: classNames('e-formula', className), dangerouslySetInnerHTML: { __html: html } });
10
+ }
11
+ export default React.memo(Formula);
12
+ //# sourceMappingURL=Formula.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Formula.js","sourceRoot":"","sources":["../../src/components/Formula.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,SAAS,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,EAAsB;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAE,CAAA;IACxC,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAE,CAAA;IACxC,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAA;IACrD,MAAM,GAAG,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA;IAE9C,MAAM,IAAI,GAAG,GAAG,GAAG,yDAAyD,GAAG,GAAG,GAAG,SAAS,CAAA;IAC9F,OAAO,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAI,CAAA;AAC1G,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ export default function mkHints({ stateful }: {
4
+ stateful: boolean;
5
+ }): React.MemoExoticComponent<({ element, renderChildNodes }: ExamComponentProps) => JSX.Element>;
6
+ //# sourceMappingURL=Hints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hints.d.ts","sourceRoot":"","sources":["../../src/components/Hints.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAMhF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,iGAuBlE"}
@@ -0,0 +1,32 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ import { useSelector } from 'react-redux';
4
+ import { findChildElement, getNumericAttribute, NBSP, queryAll } from '../dom-utils';
5
+ import { shortDisplayNumber } from '../shortDisplayNumber';
6
+ export default function mkHints({ stateful }) {
7
+ function Hints({ element, renderChildNodes }) {
8
+ const focusedQuestionId = stateful ? useSelector((state) => state.answers.focusedQuestionId) : null;
9
+ const answersWithHints = queryAll(element, ['text-answer', 'scored-text-answer']).filter((answer) => findChildElement(answer, 'hint') != null);
10
+ return (React.createElement("div", { className: "e-columns" },
11
+ React.createElement("div", { className: "e-column e-column--8" }, renderChildNodes(element)),
12
+ React.createElement("div", { className: "e-hints e-column e-column--4", "aria-hidden": "true" }, answersWithHints.map((answer, i) => (React.createElement(Hint, Object.assign({}, { answer, focusedQuestionId, renderChildNodes }, { key: i })))))));
13
+ }
14
+ return React.memo(Hints);
15
+ }
16
+ function Hint({ answer, focusedQuestionId, renderChildNodes, }) {
17
+ const questionId = getNumericAttribute(answer, 'question-id');
18
+ const displayNumber = answer.getAttribute('display-number');
19
+ const hint = findChildElement(answer, 'hint');
20
+ return (React.createElement("p", { className: classNames('e-hints__hint', {
21
+ 'e-hints__hint--focused': focusedQuestionId === questionId,
22
+ }), onClick: () => {
23
+ const question = document.querySelector(`.text-answer[data-question-id="${questionId}"]`);
24
+ if (question) {
25
+ question.focus();
26
+ }
27
+ }, "data-question-id": questionId },
28
+ shortDisplayNumber(displayNumber),
29
+ NBSP,
30
+ renderChildNodes(hint)));
31
+ }
32
+ //# sourceMappingURL=Hints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hints.js","sourceRoot":"","sources":["../../src/components/Hints.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAI1D,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAyB;IACjE,SAAS,KAAK,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;QAC9D,MAAM,iBAAiB,GAAG,QAAQ,CAAC,CAAC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a,CAAc,kCAAkC,UAAU,IAAI,CAAC,CAAA;YACtG,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,KAAK,EAAE,CAAA;aACjB;QACH,CAAC,sBACiB,UAAU;QAE3B,kBAAkB,CAAC,aAAa,CAAC;QACjC,IAAI;QACJ,gBAAgB,CAAC,IAAI,CAAC,CACrB,CACL,CAAA;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function Image({ element, className, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof Image>;
5
+ export default _default;
6
+ //# sourceMappingURL=Image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eA6B1E;;AAED,wBAAgC"}
@@ -0,0 +1,25 @@
1
+ import React, { useContext } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { getNumericAttribute, queryAncestors } from '../dom-utils';
4
+ import { CommonExamContext } from './CommonExamContext';
5
+ import ResponsiveMediaContainer from './ResponsiveMediaContainer';
6
+ function Image({ element, className, renderChildNodes }) {
7
+ const { t } = useTranslation();
8
+ const src = element.getAttribute('src');
9
+ const width = getNumericAttribute(element, 'width');
10
+ const height = getNumericAttribute(element, 'height');
11
+ const caption = element.hasChildNodes() ? renderChildNodes(element) : undefined;
12
+ const imgUrl = useContext(CommonExamContext).resolveAttachment(src);
13
+ const Img = () => React.createElement("img", { className: "e-image", src: imgUrl });
14
+ return (React.createElement(React.Fragment, null,
15
+ React.createElement(ResponsiveMediaContainer, Object.assign({}, {
16
+ className,
17
+ width,
18
+ height,
19
+ caption,
20
+ bordered: caption != null || queryAncestors(element, 'choice-answer') != null,
21
+ }), queryAncestors(element, ['choice-answer', 'hint']) != null ? (React.createElement(Img, null)) : (React.createElement("a", { title: t('zoom-in'), href: imgUrl, target: "original-picture", className: "e-zoomable" },
22
+ React.createElement(Img, null))))));
23
+ }
24
+ export default React.memo(Image);
25
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.js","sourceRoot":"","sources":["../../src/components/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AAGjE,SAAS,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAsB;IACzE,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAE,CAAA;IACxC,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAE,CAAA;IACpD,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAE,CAAA;IACtD,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/E,MAAM,MAAM,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACnE,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,6BAAK,SAAS,EAAC,SAAS,EAAC,GAAG,EAAE,MAAM,GAAI,CAAA;IAC1D,OAAO,CACL;QACE,oBAAC,wBAAwB,oBACnB;YACF,SAAS;YACT,KAAK;YACL,MAAM;YACN,OAAO;YACP,QAAQ,EAAE,OAAO,IAAI,IAAI,IAAI,cAAc,CAAC,OAAO,EAAE,eAAe,CAAC,IAAI,IAAI;SAC9E,GAEA,cAAc,CAAC,OAAO,EAAE,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAC5D,oBAAC,GAAG,OAAG,CACR,CAAC,CAAC,CAAC,CACF,2BAAG,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAC,kBAAkB,EAAC,SAAS,EAAC,YAAY;YACpF,oBAAC,GAAG,OAAG,CACL,CACL,CACwB,CAC1B,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function ImageOverlay({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof ImageOverlay>;
5
+ export default _default;
6
+ //# sourceMappingURL=ImageOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ImageOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAU9D,iBAAS,YAAY,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAuCtE;;AA+CD,wBAAuC"}
@@ -0,0 +1,45 @@
1
+ import React, { useContext, useState } from 'react';
2
+ import { getNumericAttribute, mapChildElements } from '../dom-utils';
3
+ import { faEye } from '@fortawesome/free-solid-svg-icons/faEye';
4
+ import { faEyeSlash } from '@fortawesome/free-solid-svg-icons/faEyeSlash';
5
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6
+ import ResponsiveMediaContainer from './ResponsiveMediaContainer';
7
+ import { CommonExamContext } from './CommonExamContext';
8
+ import classNames from 'classnames';
9
+ import * as _ from 'lodash-es';
10
+ function ImageOverlay({ element, renderChildNodes }) {
11
+ const [opacities, setOpacities] = useState(() => _.times(element.children.length, (i) => (i === 0 ? 1 : 0)));
12
+ const onSetSliderValue = (event, index) => {
13
+ const updatedSliders = [...opacities];
14
+ updatedSliders[index] = Number(event.target.value);
15
+ setOpacities(updatedSliders);
16
+ };
17
+ return (React.createElement("div", { className: "e-image-overlay e-mrg-b-1" },
18
+ React.createElement("div", { className: "e-columns e-columns--center-h" },
19
+ React.createElement("div", null, mapChildElements(element, (child, index) => (React.createElement(Slider, { key: index, opacity: opacities[index], element: child, setSliderValue: (e) => onSetSliderValue(e, index), renderChildNodes: renderChildNodes }))))),
20
+ React.createElement("div", null,
21
+ React.createElement("div", { className: "e-image-overlay__images-wrapper" }, mapChildElements(element, (child, index) => (React.createElement(ImageOverlayImage, { key: index, element: child, renderChildNodes: renderChildNodes, opacity: opacities[index], absolute: index > 0 })))))));
22
+ }
23
+ function Slider({ opacity, setSliderValue, element, renderChildNodes }) {
24
+ return (React.createElement("div", { className: "e-columns e-columns--center-v e-mrg-b-1" },
25
+ React.createElement("div", { className: "e-column e-text-right e-mrg-r-1" }, renderChildNodes(element)),
26
+ React.createElement(FontAwesomeIcon, { icon: faEyeSlash, className: "e-mrg-r-1" }),
27
+ React.createElement("input", { type: "range", min: 0, max: 1, step: 0.01, value: opacity, onChange: setSliderValue }),
28
+ React.createElement(FontAwesomeIcon, { icon: faEye, className: "e-mrg-l-1" })));
29
+ }
30
+ function ImageOverlayImage({ element, absolute, opacity }) {
31
+ const src = element.getAttribute('src');
32
+ const width = getNumericAttribute(element, 'width');
33
+ const height = getNumericAttribute(element, 'height');
34
+ const imgUrl = useContext(CommonExamContext).resolveAttachment(src);
35
+ return (React.createElement("div", { className: classNames('e-columns e-columns--center-h', { 'e-image-overlay__image-absolute': absolute }), style: {
36
+ opacity: opacity,
37
+ } },
38
+ React.createElement(ResponsiveMediaContainer, Object.assign({}, {
39
+ width,
40
+ height,
41
+ }),
42
+ React.createElement("img", { className: "e-image", src: imgUrl }))));
43
+ }
44
+ export default React.memo(ImageOverlay);
45
+ //# sourceMappingURL=ImageOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageOverlay.js","sourceRoot":"","sources":["../../src/components/ImageOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEnD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAE9B,SAAS,YAAY,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACrE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAW,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEtH,MAAM,gBAAgB,GAAG,CAAC,KAA0C,EAAE,K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GAAG;QAC3D,+BAAO,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,GAAU;QAClG,oBAAC,eAAe,IAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAC,WAAW,GAAG,CAClD,CACP,CAAA;AACH,CAAC;AAOD,SAAS,iBAAiB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA0B;IAC/E,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAE,CAAA;IACxC,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAE,CAAA;IACpD,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAE,CAAA;IACtD,MAAM,MAAM,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACnE,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,+BAA+B,EAAE,EAAE,iCAAiC,EAAE,QAAQ,EAAE,CAAC,EACvG,KAAK,EAAE;YACL,OAAO,EAAE,OAAO;SACjB;QAED,oBAAC,wBAAwB,oBACnB;YACF,KAAK;YACL,MAAM;SACP;YAED,6BAAK,SAAS,EAAC,SAAS,EAAC,GAAG,EAAE,MAAM,GAAI,CACf,CACvB,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export default function ProgressBar({ duration, className }: {
3
+ duration: number;
4
+ className?: string;
5
+ }): JSX.Element;
6
+ //# sourceMappingURL=ProgressBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/components/ProgressBar.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,eAqBpG"}
@@ -0,0 +1,18 @@
1
+ import classNames from 'classnames';
2
+ import React, { useEffect, useRef, useState } from 'react';
3
+ export default function ProgressBar({ duration, className }) {
4
+ const progressBarRef = useRef(null);
5
+ const [animating, setAnimating] = useState(false);
6
+ useEffect(() => {
7
+ // when this code runs as bundled inside koe for some reason or another
8
+ // there is only a single render and the element in dom immeadiately has
9
+ // "--animating" class which breaks the css transformation (the progress
10
+ // bar is completely filled from start). By reading clientTop we force a
11
+ // synchronous layout/reflow in a browser
12
+ progressBarRef.current.clientTop;
13
+ setAnimating(true);
14
+ }, []);
15
+ return (React.createElement("div", { className: classNames('e-progress-bar', className), ref: progressBarRef },
16
+ React.createElement("div", { className: classNames('e-progress-bar__fill', { 'e-progress-bar__fill--animating': animating }), style: { transitionDuration: duration + 's' } })));
17
+ }
18
+ //# sourceMappingURL=ProgressBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../src/components/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE1D,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA4C;IACnG,MAAM,cAAc,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IACnD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACjD,SAAS,CAAC,GAAG,EAAE;QACb,uEAAuE;QACvE,wEAAwE;QACxE,wEAAwE;QACxE,wEAAwE;QACxE,yCAAyC;QACzC,cAAc,CAAC,OAAQ,CAAC,SAAS,CAAA;QACjC,YAAY,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,cAAc;QAC1E,6BACE,SAAS,EAAE,UAAU,CAAC,sBAAsB,EAAE,EAAE,iCAAiC,EAAE,SAAS,EAAE,CAAC,EAC/F,KAAK,EAAE,EAAE,kBAAkB,EAAE,QAAQ,GAAG,GAAG,EAAE,GAC7C,CACE,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ export interface QuestionContext {
4
+ answers: Element[];
5
+ displayNumber: string;
6
+ hasExternalMaterial: boolean;
7
+ maxAnswers?: number;
8
+ maxScore: number;
9
+ level: number;
10
+ childQuestions: Element[];
11
+ }
12
+ export declare const QuestionContext: React.Context<QuestionContext>;
13
+ export declare const withQuestionContext: (Component: React.ComponentType<ExamComponentProps>) => React.ComponentType<ExamComponentProps>;
14
+ //# sourceMappingURL=QuestionContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuestionContext.d.ts","sourceRoot":"","sources":["../../src/components/QuestionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,eAAe,gCAA8D,CAAA;AAE1F,eAAO,MAAM,mBAAmB,iGAe9B,CAAA"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { findChildElement, getNumericAttribute, parentElements, queryAll } from '../dom-utils';
3
+ import { withContext } from './withContext';
4
+ export const QuestionContext = React.createContext({});
5
+ export const withQuestionContext = withContext(QuestionContext, ({ element }) => {
6
+ const childQuestions = queryAll(element, 'question', false);
7
+ const answers = childQuestions.length
8
+ ? []
9
+ : queryAll(element, ['text-answer', 'scored-text-answer', 'dropdown-answer', 'choice-answer'], false);
10
+ return {
11
+ answers,
12
+ displayNumber: element.getAttribute('display-number'),
13
+ hasExternalMaterial: findChildElement(element, 'external-material') != null,
14
+ maxAnswers: getNumericAttribute(element, 'max-answers'),
15
+ maxScore: getNumericAttribute(element, 'max-score'),
16
+ level: parentElements(element, 'question').length,
17
+ childQuestions,
18
+ };
19
+ });
20
+ //# sourceMappingURL=QuestionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuestionContext.js","sourceRoot":"","sources":["../../src/components/QuestionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAa3C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAAkB,EAAqB,CAAC,CAAA;AAE1F,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAsC,eAAe,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACnH,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;IAC3D,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM;QACnC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,eAAe,CAAC,EAAE,KAAK,CAAC,CAAA;IAEvG,OAAO;QACL,OAAO;QACP,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE;QACtD,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,CAAC,IAAI,IAAI;QAC3E,UAAU,EAAE,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC;QACvD,QAAQ,EAAE,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAE;QACpD,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,MAAM;QACjD,cAAc;KACf,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function Reference({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof Reference>;
5
+ export default _default;
6
+ //# sourceMappingURL=Reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reference.d.ts","sourceRoot":"","sources":["../../src/components/Reference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eA0CnE;;AA+BD,wBAAoC"}
@@ -0,0 +1,63 @@
1
+ import React, { useContext } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { findChildElement, NBSP } from '../dom-utils';
4
+ import { CommonExamContext } from './CommonExamContext';
5
+ import RenderChildNodes from './RenderChildNodes';
6
+ function Reference({ element, renderChildNodes }) {
7
+ const { t } = useTranslation();
8
+ function renderWith(localName, Component) {
9
+ const childElement = findChildElement(element, localName);
10
+ return childElement && React.createElement(Component, Object.assign({}, { element: childElement, renderChildNodes, key: childElement.localName }));
11
+ }
12
+ function renderWithPrefix(localName, translationKey, Component) {
13
+ const childElement = findChildElement(element, localName);
14
+ return (childElement && (React.createElement(React.Fragment, { key: childElement.localName },
15
+ t(translationKey),
16
+ ' ',
17
+ React.createElement(Component, Object.assign({}, { element: childElement, renderChildNodes, key: childElement.localName })))));
18
+ }
19
+ return (React.createElement("span", { className: "e-break-word" },
20
+ t('references.source'),
21
+ NBSP,
22
+ intersperse('. ', [
23
+ renderWith('author', RenderChildNodes),
24
+ renderWith('title', Italic),
25
+ renderWith('publisher', RenderChildNodes),
26
+ renderWith('publication', RenderChildNodes),
27
+ renderWith('howpublished', RenderChildNodes),
28
+ renderWith('url', Link),
29
+ renderWithPrefix('publication-date', 'references.date', AsDate),
30
+ renderWithPrefix('reference-date', 'references.reference-date', AsDate),
31
+ renderWithPrefix('translator', 'references.translator', RenderChildNodes),
32
+ renderWithPrefix('modified-by', 'references.modified-by', RenderChildNodes),
33
+ renderWith('note', RenderChildNodes),
34
+ ])));
35
+ }
36
+ function Italic({ element, renderChildNodes }) {
37
+ return React.createElement("em", null, renderChildNodes(element));
38
+ }
39
+ function Link({ element, renderChildNodes }) {
40
+ return React.createElement("a", { href: element.textContent }, renderChildNodes(element));
41
+ }
42
+ function AsDate({ element }) {
43
+ const textContent = element.textContent;
44
+ if (/^[0-9]{4}$/.test(textContent)) {
45
+ return React.createElement(React.Fragment, null, textContent);
46
+ }
47
+ else {
48
+ const date = new Date(textContent);
49
+ const { dateTimeFormatter } = useContext(CommonExamContext);
50
+ return React.createElement(React.Fragment, null, dateTimeFormatter.format(date));
51
+ }
52
+ }
53
+ function intersperse(separator, contents) {
54
+ return contents.filter(Boolean).reduce((acc, curr, i) => {
55
+ acc.push(curr);
56
+ if (i !== contents.length - 1) {
57
+ acc.push(separator);
58
+ }
59
+ return acc;
60
+ }, []);
61
+ }
62
+ export default React.memo(Reference);
63
+ //# sourceMappingURL=Reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Reference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AiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAI,CAAA;KAC7C;AACH,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB,EAAE,QAA2B;IACjE,OAAO,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QACzE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACd,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7B,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACpB;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../createRenderChildNodes';
3
+ declare function References(_props: ExamComponentProps): JSX.Element | null;
4
+ declare const _default: React.MemoExoticComponent<typeof References>;
5
+ export default _default;
6
+ //# sourceMappingURL=References.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"References.d.ts","sourceRoot":"","sources":["../../src/components/References.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAA0B,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAOtF,iBAAS,UAAU,CAAC,MAAM,EAAE,kBAAkB,sBAwB7C;;AAED,wBAAqC"}
@@ -0,0 +1,23 @@
1
+ import React, { useContext } from 'react';
2
+ import { Translation } from 'react-i18next';
3
+ import { createRenderChildNodes } from '../createRenderChildNodes';
4
+ import { queryAll, queryAncestors } from '../dom-utils';
5
+ import { CommonExamContext } from './CommonExamContext';
6
+ import Reference from './Reference';
7
+ import Section from './Section';
8
+ const renderChildNodes = createRenderChildNodes({});
9
+ function References(_props) {
10
+ const { root } = useContext(CommonExamContext);
11
+ const internalReferences = queryAll(root, 'reference').filter((reference) => queryAncestors(reference, 'external-material') == null);
12
+ return internalReferences.length > 0 ? (React.createElement(Section, { "aria-labelledby": "references-title" },
13
+ React.createElement("h2", { id: "references-title" },
14
+ React.createElement(Translation, null, (t) => t('references.heading'))),
15
+ React.createElement("ol", { className: "e-list-data e-color-darkgrey e-light" }, internalReferences.map((reference, i) => {
16
+ const question = queryAncestors(reference, 'question');
17
+ const displayNumber = question.getAttribute('display-number');
18
+ return (React.createElement("li", { "data-list-number": displayNumber, key: displayNumber + i },
19
+ React.createElement(Reference, { element: reference, renderChildNodes: renderChildNodes })));
20
+ })))) : null;
21
+ }
22
+ export default React.memo(References);
23
+ //# sourceMappingURL=References.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"References.js","sourceRoot":"","sources":["../../src/components/References.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,sBAAsB,EAAsB,MAAM,2BAA2B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,EAAE,CAAC,CAAA;AACnD,SAAS,UAAU,CAAC,MAA0B;IAC5C,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC9C,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,MAAM,CAC3D,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,mBAAmB,CAAC,IAAI,IAAI,CACtE,CAAA;IAED,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACrC,oBAAC,OAAO,uBAAiB,kBAAkB;QACzC,4BAAI,EAAE,EAAC,kBAAkB;YACvB,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAe,CACxD;QACL,4BAAI,SAAS,EAAC,sCAAsC,IACjD,kBAAkB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE;YACvC,MAAM,QAAQ,GAAG,cAAc,CAAC,SAAS,EAAE,UAAU,CAAE,CAAA;YACvD,MAAM,aAAa,GAAG,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;YAC9D,OAAO,CACL,gDAAsB,aAAa,EAAE,GAAG,EAAE,aAAa,GAAG,CAAC;gBACzD,oBAAC,SAAS,IAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,CAClE,CACN,CAAA;QACH,CAAC,CAAC,CACC,CACG,CACX,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ interface ResponsiveMediaContainerProps {
3
+ bordered?: boolean;
4
+ className?: string;
5
+ children: React.ReactElement<any>;
6
+ height: number;
7
+ width: number;
8
+ caption?: React.ReactNode[];
9
+ }
10
+ /**
11
+ * Wraps children into responsive container, which is used to prevent reflows as external media like images or videos
12
+ * finish loading, see https://www.perpetual-beta.org/weblog/responsive-images-without-browser-reflow.html for more
13
+ * information.
14
+ */
15
+ export default function ResponsiveMediaContainer({ bordered, className, children, height, width, caption, }: ResponsiveMediaContainerProps): JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=ResponsiveMediaContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponsiveMediaContainer.d.ts","sourceRoot":"","sources":["../../src/components/ResponsiveMediaContainer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,UAAU,6BAA6B;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;CAC5B;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,GACR,EAAE,6BAA6B,eA0B/B"}