@digabi/exam-engine-core 19.19.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 (280) 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/exam/ExamineExam.d.ts +5 -0
  199. package/dist/components/exam/ExamineExam.d.ts.map +1 -0
  200. package/dist/components/exam/ExamineExam.js +20 -0
  201. package/dist/components/exam/ExamineExam.js.map +1 -0
  202. package/dist/components/exam/FinishExam.d.ts +5 -0
  203. package/dist/components/exam/FinishExam.d.ts.map +1 -0
  204. package/dist/components/exam/FinishExam.js +17 -0
  205. package/dist/components/exam/FinishExam.js.map +1 -0
  206. package/dist/components/results/AnnotationList.d.ts +5 -0
  207. package/dist/components/results/AnnotationList.d.ts.map +1 -0
  208. package/dist/components/results/AnnotationList.js +40 -0
  209. package/dist/components/results/AnnotationList.js.map +1 -0
  210. package/dist/components/results/ResultsChoiceAnswer.d.ts +6 -0
  211. package/dist/components/results/ResultsChoiceAnswer.d.ts.map +1 -0
  212. package/dist/components/results/ResultsChoiceAnswer.js +60 -0
  213. package/dist/components/results/ResultsChoiceAnswer.js.map +1 -0
  214. package/dist/components/results/ResultsContext.d.ts +20 -0
  215. package/dist/components/results/ResultsContext.d.ts.map +1 -0
  216. package/dist/components/results/ResultsContext.js +68 -0
  217. package/dist/components/results/ResultsContext.js.map +1 -0
  218. package/dist/components/results/ResultsDropdownAnswer.d.ts +6 -0
  219. package/dist/components/results/ResultsDropdownAnswer.d.ts.map +1 -0
  220. package/dist/components/results/ResultsDropdownAnswer.js +41 -0
  221. package/dist/components/results/ResultsDropdownAnswer.js.map +1 -0
  222. package/dist/components/results/ResultsExamQuestion.d.ts +5 -0
  223. package/dist/components/results/ResultsExamQuestion.d.ts.map +1 -0
  224. package/dist/components/results/ResultsExamQuestion.js +23 -0
  225. package/dist/components/results/ResultsExamQuestion.js.map +1 -0
  226. package/dist/components/results/ResultsExamQuestionAutoScore.d.ts +10 -0
  227. package/dist/components/results/ResultsExamQuestionAutoScore.d.ts.map +1 -0
  228. package/dist/components/results/ResultsExamQuestionAutoScore.js +16 -0
  229. package/dist/components/results/ResultsExamQuestionAutoScore.js.map +1 -0
  230. package/dist/components/results/ResultsExamQuestionManualScore.d.ts +11 -0
  231. package/dist/components/results/ResultsExamQuestionManualScore.d.ts.map +1 -0
  232. package/dist/components/results/ResultsExamQuestionManualScore.js +62 -0
  233. package/dist/components/results/ResultsExamQuestionManualScore.js.map +1 -0
  234. package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts +9 -0
  235. package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts.map +1 -0
  236. package/dist/components/results/ResultsExamQuestionScoresContainer.js +8 -0
  237. package/dist/components/results/ResultsExamQuestionScoresContainer.js.map +1 -0
  238. package/dist/components/results/ResultsExamQuestionTitle.d.ts +6 -0
  239. package/dist/components/results/ResultsExamQuestionTitle.d.ts.map +1 -0
  240. package/dist/components/results/ResultsExamQuestionTitle.js +22 -0
  241. package/dist/components/results/ResultsExamQuestionTitle.js.map +1 -0
  242. package/dist/components/results/ResultsExamSection.d.ts +5 -0
  243. package/dist/components/results/ResultsExamSection.d.ts.map +1 -0
  244. package/dist/components/results/ResultsExamSection.js +17 -0
  245. package/dist/components/results/ResultsExamSection.js.map +1 -0
  246. package/dist/components/results/ResultsScoredTextAnswer.d.ts +6 -0
  247. package/dist/components/results/ResultsScoredTextAnswer.d.ts.map +1 -0
  248. package/dist/components/results/ResultsScoredTextAnswer.js +22 -0
  249. package/dist/components/results/ResultsScoredTextAnswer.js.map +1 -0
  250. package/dist/components/results/ResultsSingleLineAnswer.d.ts +12 -0
  251. package/dist/components/results/ResultsSingleLineAnswer.d.ts.map +1 -0
  252. package/dist/components/results/ResultsSingleLineAnswer.js +12 -0
  253. package/dist/components/results/ResultsSingleLineAnswer.js.map +1 -0
  254. package/dist/components/results/ResultsTextAnswer.d.ts +6 -0
  255. package/dist/components/results/ResultsTextAnswer.d.ts.map +1 -0
  256. package/dist/components/results/ResultsTextAnswer.js +51 -0
  257. package/dist/components/results/ResultsTextAnswer.js.map +1 -0
  258. package/dist/components/results/helpers.d.ts +9 -0
  259. package/dist/components/results/helpers.d.ts.map +1 -0
  260. package/dist/components/results/helpers.js +10 -0
  261. package/dist/components/results/helpers.js.map +1 -0
  262. package/dist/components/results/isExamFinishPageHook.d.ts +2 -0
  263. package/dist/components/results/isExamFinishPageHook.d.ts.map +1 -0
  264. package/dist/components/results/isExamFinishPageHook.js +7 -0
  265. package/dist/components/results/isExamFinishPageHook.js.map +1 -0
  266. package/dist/components/types.d.ts +110 -0
  267. package/dist/components/types.d.ts.map +1 -0
  268. package/dist/components/types.js +1 -0
  269. package/dist/components/types.js.map +1 -0
  270. package/dist/components/withContext.d.ts +3 -0
  271. package/dist/components/withContext.d.ts.map +1 -0
  272. package/dist/components/withContext.js +12 -0
  273. package/dist/components/withContext.js.map +1 -0
  274. package/dist/main-bundle.js +1 -1
  275. package/dist/store/answers/sagas.d.ts.map +1 -1
  276. package/dist/store/answers/sagas.js +6 -0
  277. package/dist/store/answers/sagas.js.map +1 -1
  278. package/dist/types/ExamServerAPI.d.ts +2 -0
  279. package/dist/types/ExamServerAPI.d.ts.map +1 -1
  280. package/package.json +3 -3
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface ResultsExamQuestionAutoScoreProps {
3
+ score?: number;
4
+ maxScore?: number;
5
+ displayNumber?: string;
6
+ }
7
+ declare function ResultsExamQuestionAutoScore({ score, maxScore, displayNumber }: ResultsExamQuestionAutoScoreProps): JSX.Element;
8
+ declare const _default: React.MemoExoticComponent<typeof ResultsExamQuestionAutoScore>;
9
+ export default _default;
10
+ //# sourceMappingURL=ResultsExamQuestionAutoScore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionAutoScore.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionAutoScore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,MAAM,WAAW,iCAAiC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,iBAAS,4BAA4B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,iCAAiC,eAS1G;;AAED,wBAAuD"}
@@ -0,0 +1,16 @@
1
+ import React, { useContext } from 'react';
2
+ import { Translation } from 'react-i18next';
3
+ import { QuestionContext } from '../QuestionContext';
4
+ import ResultsExamQuestionScoresContainer from './ResultsExamQuestionScoresContainer';
5
+ function ResultsExamQuestionAutoScore({ score, maxScore, displayNumber }) {
6
+ const { answers } = useContext(QuestionContext);
7
+ const containerProps = { answers, displayNumber };
8
+ return (React.createElement(ResultsExamQuestionScoresContainer, Object.assign({}, containerProps),
9
+ typeof score === 'number' ? React.createElement("b", null, score) : React.createElement("div", { className: "e-result-scorecount-empty" }),
10
+ ' ',
11
+ maxScore ? `/ ${maxScore} ` : null,
12
+ " ",
13
+ React.createElement(Translation, null, (t) => t('points'))));
14
+ }
15
+ export default React.memo(ResultsExamQuestionAutoScore);
16
+ //# sourceMappingURL=ResultsExamQuestionAutoScore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionAutoScore.js","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionAutoScore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,kCAAkC,MAAM,sCAAsC,CAAA;AAQrF,SAAS,4BAA4B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAqC;IACzG,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC/C,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA;IACjD,OAAO,CACL,oBAAC,kCAAkC,oBAAK,cAAc;QACnD,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,+BAAI,KAAK,CAAK,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,2BAA2B,GAAG;QAAE,GAAG;QAC/F,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAG,CAAC,CAAC,CAAC,IAAI;;QAAE,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAe,CACjD,CACtC,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Score } from '../../types/Score';
3
+ export interface ResultsExamQuestionManualScoreProps {
4
+ scores?: Score;
5
+ maxScore?: number;
6
+ displayNumber?: string;
7
+ }
8
+ declare function ResultsExamQuestionManualScore({ scores, maxScore, displayNumber }: ResultsExamQuestionManualScoreProps): JSX.Element;
9
+ declare const _default: React.MemoExoticComponent<typeof ResultsExamQuestionManualScore>;
10
+ export default _default;
11
+ //# sourceMappingURL=ResultsExamQuestionManualScore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionManualScore.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionManualScore.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAoD,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE3F,MAAM,WAAW,mCAAmC;IAClD,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAQD,iBAAS,8BAA8B,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,mCAAmC,eAa/G;;AAqFD,wBAAyD"}
@@ -0,0 +1,62 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import { Translation } from 'react-i18next';
4
+ import { QuestionContext } from '../QuestionContext';
5
+ import ResultsExamQuestionScoresContainer from './ResultsExamQuestionScoresContainer';
6
+ function ResultsExamQuestionManualScore({ scores, maxScore, displayNumber }) {
7
+ var _a, _b, _c, _d;
8
+ const { answers } = useContext(QuestionContext);
9
+ const containerProps = { answers, displayNumber };
10
+ const shortCode = (_b = (_a = scores === null || scores === void 0 ? void 0 : scores.censoring) === null || _a === void 0 ? void 0 : _a.nonAnswerDetails) === null || _b === void 0 ? void 0 : _b.shortCode;
11
+ return (React.createElement(ResultsExamQuestionScoresContainer, Object.assign({}, containerProps),
12
+ ((_c = scores === null || scores === void 0 ? void 0 : scores.pregrading) === null || _c === void 0 ? void 0 : _c.score) == null && (!(scores === null || scores === void 0 ? void 0 : scores.censoring) || ((_d = scores === null || scores === void 0 ? void 0 : scores.censoring) === null || _d === void 0 ? void 0 : _d.scores.length) === 0) && (React.createElement(NoPregrading, { maxScore: maxScore })),
13
+ scores && renderNormalizedScores(scores, maxScore),
14
+ shortCode && React.createElement(NonAnswer, { shortCode: shortCode })));
15
+ }
16
+ function renderNormalizedScores(scores, maxScore) {
17
+ const normalizedScores = [
18
+ scores.inspection && normalizeInspectionScore(scores.inspection),
19
+ ...(scores.censoring ? normalizeCensoringScores(scores.censoring) : []),
20
+ scores.pregrading && normalizePregradingScore(scores.pregrading),
21
+ ].filter(Boolean);
22
+ return normalizedScores.map((score, i) => React.createElement(ScoreRow, Object.assign({ key: i }, score, { latest: i === 0, maxScore: maxScore })));
23
+ }
24
+ function NoPregrading({ maxScore }) {
25
+ return (React.createElement(React.Fragment, null,
26
+ React.createElement("span", { className: "e-result-scorecount-empty" }),
27
+ maxScore && ` / ${maxScore} `,
28
+ React.createElement(Translation, null, (t) => t('points'))));
29
+ }
30
+ function NonAnswer({ shortCode }) {
31
+ return (React.createElement("div", { className: "e-color-darkgrey e-columns e-columns--center-v" },
32
+ React.createElement("span", { className: "e-font-size-xxxl e-light e-mrg-r-1" }, "\u00D7"),
33
+ React.createElement("span", null, shortCode)));
34
+ }
35
+ function ScoreRow({ score, shortCode, type, maxScore, latest }) {
36
+ return (React.createElement("div", { className: latest ? 'e-color-black' : 'e-color-grey e-font-size-xs' },
37
+ React.createElement(ScoreColumn, { className: classNames('e-nowrap', { 'e-font-size-m': latest }) },
38
+ latest ? React.createElement("b", null, score) : score,
39
+ latest && maxScore ? ` / ${maxScore}` : '',
40
+ ` p.`),
41
+ React.createElement(ScoreColumn, { className: "e-result-scorecount-shortcode" }, shortCode),
42
+ React.createElement(ScoreColumn, { className: "e-mrg-r-0" },
43
+ React.createElement(Translation, null, (t) => t(type)))));
44
+ }
45
+ function ScoreColumn({ className, children }) {
46
+ return React.createElement("span", { className: classNames('e-mrg-r-1 e-nowrap', className) }, children);
47
+ }
48
+ function normalizePregradingScore({ score }) {
49
+ return score !== undefined ? { score, shortCode: '', type: 'va' } : null;
50
+ }
51
+ function normalizeCensoringScores(score) {
52
+ return score.scores.map((s, i) => ({
53
+ score: s.score,
54
+ shortCode: s.shortCode || '',
55
+ type: `${score.scores.length - i}.s`,
56
+ }));
57
+ }
58
+ function normalizeInspectionScore(score) {
59
+ return { score: score.score, shortCode: score.shortCodes ? score.shortCodes.join(', ') : '', type: 'ta' };
60
+ }
61
+ export default React.memo(ResultsExamQuestionManualScore);
62
+ //# sourceMappingURL=ResultsExamQuestionManualScore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionManualScore.js","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionManualScore.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,kCAAkC,MAAM,sCAAsC,CAAA;AAerF,SAAS,8BAA8B,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAuC;;IAC9G,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC/C,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA;IACjD,MAAM,SAAS,eAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,0CAAE,gBAAgB,0CAAE,SAAS,CAAA;IAChE,OAAO,CACL,oBAAC,kCAAkC,oBAAK,cAAc;QACnD,OAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,0CAAE,KAAK,KAAI,IAAI,IAAI,CAAC,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAA,IAAI,OAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,0CAAE,MAAM,CAAC,MAAM,MAAK,CAAC,CAAC,IAAI,CACtG,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACrC;QACA,MAAM,IAAI,sBAAsB,CAAC,MAAM,EAAE,QAAQ,CAAC;QAClD,SAAS,IAAI,oBAAC,SAAS,IAAC,SAAS,EAAE,SAAS,GAAI,CACd,CACtC,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAa,EAAE,QAAiB;IAC9D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,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;AAC3G,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ declare function ResultsExamQuestionScoresContainer({ answers, displayNumber, children, }: {
3
+ answers: Element[];
4
+ displayNumber?: string;
5
+ children: React.ReactNode;
6
+ }): JSX.Element;
7
+ declare const _default: React.MemoExoticComponent<typeof ResultsExamQuestionScoresContainer>;
8
+ export default _default;
9
+ //# sourceMappingURL=ResultsExamQuestionScoresContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionScoresContainer.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionScoresContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,iBAAS,kCAAkC,CAAC,EAC1C,OAAO,EACP,aAAa,EACb,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,eAOA;;AAED,wBAA6D"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ function ResultsExamQuestionScoresContainer({ answers, displayNumber, children, }) {
3
+ return (React.createElement("div", { className: "e-result-scorecount e-float-right e-mrg-b-1" },
4
+ answers.length > 1 && displayNumber && React.createElement("sup", { className: "e-result-scorecount-sup e-mrg-r-1" }, displayNumber),
5
+ children));
6
+ }
7
+ export default React.memo(ResultsExamQuestionScoresContainer);
8
+ //# sourceMappingURL=ResultsExamQuestionScoresContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionScoresContainer.js","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionScoresContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,SAAS,kCAAkC,CAAC,EAC1C,OAAO,EACP,aAAa,EACb,QAAQ,GAKT;IACC,OAAO,CACL,6BAAK,SAAS,EAAC,6CAA6C;QACzD,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,IAAI,6BAAK,SAAS,EAAC,mCAAmC,IAAE,aAAa,CAAO;QAC/G,QAAQ,CACL,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ declare function ResultsExamQuestionTitle({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof ResultsExamQuestionTitle>;
5
+ export default _default;
6
+ //# sourceMappingURL=ResultsExamQuestionTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionTitle.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionTitle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE,iBAAS,wBAAwB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAyBlF;;AAED,wBAAmD"}
@@ -0,0 +1,22 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import AnsweringInstructions from '../AnsweringInstructions';
4
+ import NotificationIcon from '../NotificationIcon';
5
+ import { QuestionContext } from '../QuestionContext';
6
+ function ResultsExamQuestionTitle({ element, renderChildNodes }) {
7
+ const { displayNumber, level, maxAnswers, childQuestions } = useContext(QuestionContext);
8
+ const Tag = ('h' + Math.min(3 + level, 6));
9
+ return (React.createElement(React.Fragment, null,
10
+ React.createElement(Tag, { className: classNames('exam-question-title', { 'e-normal e-font-size-m': level > 0 }) },
11
+ React.createElement("strong", { className: classNames('exam-question-title__display-number', {
12
+ 'exam-question-title__display-number--indented': level > 0,
13
+ }) },
14
+ displayNumber,
15
+ '. '),
16
+ renderChildNodes(element)),
17
+ maxAnswers != null && childQuestions.length > 0 && (React.createElement("p", { className: "e-italic" },
18
+ React.createElement(NotificationIcon, null),
19
+ React.createElement(AnsweringInstructions, { maxAnswers: maxAnswers, childQuestions: childQuestions, type: "question" })))));
20
+ }
21
+ export default React.memo(ResultsExamQuestionTitle);
22
+ //# sourceMappingURL=ResultsExamQuestionTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamQuestionTitle.js","sourceRoot":"","sources":["../../../src/components/results/ResultsExamQuestionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,qBAAqB,MAAM,0BAA0B,CAAA;AAC5D,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,SAAS,wBAAwB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACjF,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IACxF,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAQ,CAAA;IAEjD,OAAO,CACL;QACE,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,EAAE,wBAAwB,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;YACxF,gCACE,SAAS,EAAE,UAAU,CAAC,qCAAqC,EAAE;oBAC3D,+CAA+C,EAAE,KAAK,GAAG,CAAC;iBAC3D,CAAC;gBAED,aAAa;gBACb,IAAI,CACE;YACR,gBAAgB,CAAC,OAAO,CAAC,CACtB;QACL,UAAU,IAAI,IAAI,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAClD,2BAAG,SAAS,EAAC,UAAU;YACrB,oBAAC,gBAAgB,OAAG;YACpB,oBAAC,qBAAqB,IAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAC,UAAU,GAAG,CAC/F,CACL,CACA,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA"}
@@ -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=ResultsExamSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamSection.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsExamSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAiBjE,wBAAiE"}
@@ -0,0 +1,17 @@
1
+ import React, { useContext } from 'react';
2
+ import { query } from '../../dom-utils';
3
+ import Section from '../Section';
4
+ import { SectionContext, withSectionContext } from '../SectionContext';
5
+ import { ResultsContext } from './ResultsContext';
6
+ function ResultsExamSection({ element, renderChildNodes }) {
7
+ const { displayNumber } = useContext(SectionContext);
8
+ const { answersByQuestionId } = useContext(ResultsContext);
9
+ const containsAnswers = query(element, (e) => {
10
+ const maybeQuestionId = e.getAttribute('question-id');
11
+ return maybeQuestionId != null && Object.prototype.hasOwnProperty.call(answersByQuestionId, maybeQuestionId);
12
+ });
13
+ return containsAnswers ? (React.createElement(Section, { "aria-labelledby": displayNumber + '-title' },
14
+ React.createElement("div", { className: "e-results-section-wrapper" }, renderChildNodes(element)))) : null;
15
+ }
16
+ export default React.memo(withSectionContext(ResultsExamSection));
17
+ //# sourceMappingURL=ResultsExamSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsExamSection.js","sourceRoot":"","sources":["../../../src/components/results/ResultsExamSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,OAAO,MAAM,YAAY,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,SAAS,kBAAkB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IAC3E,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACpD,MAAM,EAAE,mBAAmB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;QAC3C,MAAM,eAAe,GAAG,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;QACrD,OAAO,eAAe,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAA;IAC9G,CAAC,CAAC,CAAA;IAEF,OAAO,eAAe,CAAC,CAAC,CAAC,CACvB,oBAAC,OAAO,uBAAkB,aAAa,GAAG,QAAQ;QAChD,6BAAK,SAAS,EAAC,2BAA2B,IAAE,gBAAgB,CAAC,OAAO,CAAC,CAAO,CACpE,CACX,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ declare function ResultsScoredTextAnswer({ element }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof ResultsScoredTextAnswer>;
5
+ export default _default;
6
+ //# sourceMappingURL=ResultsScoredTextAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsScoredTextAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsScoredTextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAOzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,iBAAS,uBAAuB,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,eAmB/D;;AAED,wBAAkD"}
@@ -0,0 +1,22 @@
1
+ import React, { useContext } from 'react';
2
+ import { getNumericAttribute } from '../../dom-utils';
3
+ import { shortDisplayNumber } from '../../shortDisplayNumber';
4
+ import { QuestionContext } from '../QuestionContext';
5
+ import { findScore, ResultsContext } from './ResultsContext';
6
+ import ResultsExamQuestionAutoScore from './ResultsExamQuestionAutoScore';
7
+ import ResultsSingleLineAnswer from './ResultsSingleLineAnswer';
8
+ function ResultsScoredTextAnswer({ element }) {
9
+ var _a;
10
+ const { answers } = useContext(QuestionContext);
11
+ const { answersByQuestionId, scores } = useContext(ResultsContext);
12
+ const questionId = getNumericAttribute(element, 'question-id');
13
+ const maxScore = getNumericAttribute(element, 'max-score');
14
+ const answer = answersByQuestionId[questionId];
15
+ const value = answer && answer.value;
16
+ const displayNumber = shortDisplayNumber(element.getAttribute('display-number'));
17
+ const autogradingScore = (_a = findScore(scores, questionId)) === null || _a === void 0 ? void 0 : _a.autograding;
18
+ return (React.createElement(ResultsSingleLineAnswer, { answers: answers, displayNumber: displayNumber, value: value },
19
+ React.createElement(ResultsExamQuestionAutoScore, { score: autogradingScore === null || autogradingScore === void 0 ? void 0 : autogradingScore.score, maxScore: maxScore, displayNumber: answers.length > 1 ? displayNumber : undefined })));
20
+ }
21
+ export default React.memo(ResultsScoredTextAnswer);
22
+ //# sourceMappingURL=ResultsScoredTextAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsScoredTextAnswer.js","sourceRoot":"","sources":["../../../src/components/results/ResultsScoredTextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,4BAA4B,MAAM,gCAAgC,CAAA;AACzE,OAAO,uBAAuB,MAAM,2BAA2B,CAAA;AAI/D,SAAS,uBAAuB,CAAC,EAAE,OAAO,EAAsB;;IAC9D,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC/C,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAClE,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAE,CAAA;IAC3D,MAAM,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAA2B,CAAA;IACxE,MAAM,KAAK,GAAG,MAAM,IAAI,MAAM,CAAC,KAAK,CAAA;IACpC,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAC,CAAA;IACjF,MAAM,gBAAgB,SAAG,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,0CAAE,WAAW,CAAA;IAEnE,OAAO,CACL,oBAAC,uBAAuB,IAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK;QACnF,oBAAC,4BAA4B,IAC3B,KAAK,EAAE,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,KAAK,EAC9B,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,GAC7D,CACsB,CAC3B,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Score } from '../../types/Score';
3
+ declare function ResultsSingleLineAnswer({ answers, displayNumber, answerScores, value, children, }: {
4
+ answers: Element[];
5
+ answerScores?: Score;
6
+ displayNumber: string;
7
+ value: string | undefined;
8
+ children: React.ReactNode;
9
+ }): JSX.Element;
10
+ declare const _default: React.MemoExoticComponent<typeof ResultsSingleLineAnswer>;
11
+ export default _default;
12
+ //# sourceMappingURL=ResultsSingleLineAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsSingleLineAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsSingleLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,iBAAS,uBAAuB,CAAC,EAC/B,OAAO,EACP,aAAa,EACb,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,eAcA;;AAED,wBAAkD"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { getAnnotationAttributes } from './helpers';
3
+ function ResultsSingleLineAnswer({ answers, displayNumber, answerScores, value, children, }) {
4
+ return (React.createElement(React.Fragment, null,
5
+ answers.length > 1 && React.createElement("sup", null, displayNumber),
6
+ React.createElement("span", { className: "answer text-answer text-answer--single-line" },
7
+ React.createElement("span", { className: "e-inline-block answer-text-container" },
8
+ React.createElement("div", Object.assign({ className: "answerText e-inline-block" }, getAnnotationAttributes(answerScores)), value))),
9
+ children));
10
+ }
11
+ export default React.memo(ResultsSingleLineAnswer);
12
+ //# sourceMappingURL=ResultsSingleLineAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsSingleLineAnswer.js","sourceRoot":"","sources":["../../../src/components/results/ResultsSingleLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAGnD,SAAS,uBAAuB,CAAC,EAC/B,OAAO,EACP,aAAa,EACb,YAAY,EACZ,KAAK,EACL,QAAQ,GAOT;IACC,OAAO,CACL;QACG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,iCAAM,aAAa,CAAO;QACjD,8BAAM,SAAS,EAAC,6CAA6C;YAC3D,8BAAM,SAAS,EAAC,sCAAsC;gBACpD,2CAAK,SAAS,EAAC,2BAA2B,IAAK,uBAAuB,CAAC,YAAY,CAAC,GACjF,KAAK,CACF,CACD,CACF;QACN,QAAQ,CACR,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ declare function ResultsTextAnswer({ element }: ExamComponentProps): JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof ResultsTextAnswer>;
5
+ export default _default;
6
+ //# sourceMappingURL=ResultsTextAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsTextAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/results/ResultsTextAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAUzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,iBAAS,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,eAyDzD;;AAED,wBAA4C"}
@@ -0,0 +1,51 @@
1
+ import classNames from 'classnames';
2
+ import React, { useContext } from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { getNumericAttribute } from '../../dom-utils';
5
+ import { shortDisplayNumber } from '../../shortDisplayNumber';
6
+ import AnswerToolbar from '../AnswerToolbar';
7
+ import { QuestionContext } from '../QuestionContext';
8
+ import { getAnnotationAttributes } from './helpers';
9
+ import { findScore, ResultsContext } from './ResultsContext';
10
+ import ResultsExamQuestionManualScore from './ResultsExamQuestionManualScore';
11
+ import ResultsSingleLineAnswer from './ResultsSingleLineAnswer';
12
+ function ResultsTextAnswer({ element }) {
13
+ var _a;
14
+ const { answers } = useContext(QuestionContext);
15
+ const { answersByQuestionId, scores } = useContext(ResultsContext);
16
+ const { t } = useTranslation();
17
+ const questionId = getNumericAttribute(element, 'question-id');
18
+ const maxScore = getNumericAttribute(element, 'max-score');
19
+ const answer = answersByQuestionId[questionId];
20
+ const value = answer && answer.value;
21
+ const displayNumber = shortDisplayNumber(element.getAttribute('display-number'));
22
+ const answerScores = findScore(scores, questionId);
23
+ const comment = (_a = answerScores === null || answerScores === void 0 ? void 0 : answerScores.pregrading) === null || _a === void 0 ? void 0 : _a.comment;
24
+ const type = (element.getAttribute('type') || 'single-line');
25
+ switch (type) {
26
+ case 'rich-text':
27
+ case 'multi-line': {
28
+ const props = {
29
+ ...getAnnotationAttributes(answerScores),
30
+ className: classNames('answerText', { 'e-pre-wrap': type === 'multi-line' }),
31
+ };
32
+ return (React.createElement(React.Fragment, null,
33
+ React.createElement(ResultsExamQuestionManualScore, { scores: answerScores, maxScore: maxScore }),
34
+ React.createElement("div", { className: "answer e-multiline-results-text-answer" },
35
+ React.createElement("div", { className: "answer-text-container" }, type === 'rich-text' ? (React.createElement("div", Object.assign({}, props, { dangerouslySetInnerHTML: { __html: value } }))) : (React.createElement("div", Object.assign({}, props), value)))),
36
+ React.createElement(AnswerToolbar, Object.assign({}, {
37
+ answer,
38
+ element,
39
+ })),
40
+ comment && (React.createElement(React.Fragment, null,
41
+ React.createElement("h5", null, t('comment')),
42
+ React.createElement("p", { className: "e-italic" }, comment)))));
43
+ }
44
+ case 'single-line':
45
+ default:
46
+ return (React.createElement(ResultsSingleLineAnswer, Object.assign({}, { answers, answerScores, displayNumber, value }),
47
+ React.createElement(ResultsExamQuestionManualScore, Object.assign({}, { scores: answerScores, maxScore, displayNumber: answers.length > 1 ? displayNumber : undefined }))));
48
+ }
49
+ }
50
+ export default React.memo(ResultsTextAnswer);
51
+ //# sourceMappingURL=ResultsTextAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsTextAnswer.js","sourceRoot":"","sources":["../../../src/components/results/ResultsTextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CA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aAC7E,CAAA;YACD,OAAO,CACL;gBACE,oBAAC,8BAA8B,IAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAI;gBAC5E,6BAAK,SAAS,EAAC,wCAAwC;oBACrD,6BAAK,SAAS,EAAC,uBAAuB,IACnC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CACtB,6CAAS,KAAK,IAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAM,EAAE,IAAI,CAChE,CAAC,CAAC,CAAC,CACF,6CAAS,KAAK,GAAG,KAAK,CAAO,CAC9B,CACG,CACF;gBACN,oBAAC,aAAa,oBACR;oBACF,MAAM;oBACN,OAAO;iBACR,EACD;gBACD,OAAO,IAAI,CACV;oBACE,gCAAK,CAAC,CAAC,SAAS,CAAC,CAAM;oBACvB,2BAAG,SAAS,EAAC,UAAU,IAAE,OAAO,CAAK,CACpC,CACJ,CACA,CACJ,CAAA;SACF;QACD,KAAK,aAAa,CAAC;QACnB;YACE,OAAO,CACL,oBAAC,uBAAuB,oBAAK,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE;gBAC1E,oBAAC,8BAA8B,oBACzB,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,EACrG,CACsB,CAC3B,CAAA;KACJ;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { Score } from '../../types/Score';
2
+ export declare const getAnnotationAttributes: (answer?: Score | undefined) => {
3
+ 'data-pregrading-annotations': string;
4
+ 'data-censoring-annotations': string;
5
+ } | {
6
+ 'data-pregrading-annotations'?: undefined;
7
+ 'data-censoring-annotations'?: undefined;
8
+ };
9
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/results/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,eAAO,MAAM,uBAAuB;;;;;;CAM5B,CAAA"}
@@ -0,0 +1,10 @@
1
+ export const getAnnotationAttributes = (answer) => {
2
+ var _a, _b, _c, _d;
3
+ return answer
4
+ ? {
5
+ 'data-pregrading-annotations': JSON.stringify((_b = (_a = answer === null || answer === void 0 ? void 0 : answer.pregrading) === null || _a === void 0 ? void 0 : _a.annotations) !== null && _b !== void 0 ? _b : []),
6
+ 'data-censoring-annotations': JSON.stringify((_d = (_c = answer === null || answer === void 0 ? void 0 : answer.censoring) === null || _c === void 0 ? void 0 : _c.annotations) !== null && _d !== void 0 ? _d : []),
7
+ }
8
+ : {};
9
+ };
10
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/results/helpers.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAE,EAAE;;IACxD,OAAA,MAAM;QACJ,CAAC,CAAC;YACE,6BAA6B,EAAE,IAAI,CAAC,SAAS,aAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,0CAAE,WAAW,mCAAI,EAAE,CAAC;YACpF,4BAA4B,EAAE,IAAI,CAAC,SAAS,aAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,0CAAE,WAAW,mCAAI,EAAE,CAAC;SACnF;QACH,CAAC,CAAC,EAAE,CAAA;CAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const useIsStudentsFinishExamPage: () => boolean;
2
+ //# sourceMappingURL=isExamFinishPageHook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isExamFinishPageHook.d.ts","sourceRoot":"","sources":["../../../src/components/results/isExamFinishPageHook.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B,eAGvC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { useContext } from 'react';
2
+ import { ResultsContext } from '../context/ResultsContext';
3
+ export const useIsStudentsFinishExamPage = () => {
4
+ const { gradingStructure } = useContext(ResultsContext);
5
+ return gradingStructure === undefined;
6
+ };
7
+ //# sourceMappingURL=isExamFinishPageHook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isExamFinishPageHook.js","sourceRoot":"","sources":["../../../src/components/results/isExamFinishPageHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACvD,OAAO,gBAAgB,KAAK,SAAS,CAAA;AACvC,CAAC,CAAA"}
@@ -0,0 +1,110 @@
1
+ import { RenderChildNodes } from '../createRenderChildNodes';
2
+ import { Translations } from '../i18n/fi-FI';
3
+ export declare type QuestionId = number;
4
+ interface AnswerCommon {
5
+ questionId: QuestionId;
6
+ value: string;
7
+ /** This field is undefined in older exams that were packaged before this change. */
8
+ displayNumber?: string;
9
+ }
10
+ export interface TextAnswer extends AnswerCommon {
11
+ type: 'text';
12
+ characterCount: number;
13
+ }
14
+ export interface RichTextAnswer extends AnswerCommon {
15
+ type: 'richText';
16
+ characterCount: number;
17
+ }
18
+ export interface ChoiceAnswer extends AnswerCommon {
19
+ type: 'choice';
20
+ }
21
+ export declare type ExamAnswer = TextAnswer | RichTextAnswer | ChoiceAnswer;
22
+ export declare type SaveState = 'initial' | 'saving' | 'saved';
23
+ export interface Annotation {
24
+ startIndex: number;
25
+ length: number;
26
+ message: string;
27
+ }
28
+ export interface AnswerScore {
29
+ questionId: number;
30
+ scoreValue: number;
31
+ comment?: string;
32
+ annotations: Annotation[];
33
+ }
34
+ /**
35
+ * CAS status is a state machine with three states.
36
+ *
37
+ * ```
38
+ * +---------+ +--------+ +-------+
39
+ * |forbidden| <---> |allowing| ---> |allowed|
40
+ * +---------+ +--------+ +-------+
41
+ * ```
42
+ *
43
+ * When the user clicks the "Palauta A-osa" button, we start a 60s countdown
44
+ * and transition the state from `'forbidden'` to `'allowing'`. When the timer reaches
45
+ * zero, we transition the state from from `'allowing'` to `'allowed'`. Cancelling
46
+ * the countdown transitions the state back from `'allowing'` to `'forbidden'`.
47
+ */
48
+ export declare type CasStatus = InitialCasStatus | 'allowing';
49
+ export declare type InitialCasStatus = 'allowed' | 'forbidden';
50
+ export declare type RestrictedAudioId = number;
51
+ export declare type AudioPlaybackError =
52
+ /** The user has already accessed this restricted audio */
53
+ 'already-accessed'
54
+ /** There already is an audio file playing */
55
+ | 'already-playing'
56
+ /** Other error, e.g. a network issue */
57
+ | 'other-error';
58
+ export declare type AudioPlaybackResponse = 'ok' | AudioPlaybackError;
59
+ export interface RestrictedAudioPlaybackStats {
60
+ /** An unique identifier for each restricted audio element */
61
+ restrictedAudioId: RestrictedAudioId;
62
+ /** Number of times it has been listened to. */
63
+ times: number;
64
+ }
65
+ export interface ExamComponentProps {
66
+ className?: string;
67
+ /** An element in the exam XML. */
68
+ element: Element;
69
+ /** A function that knows how to render the child nodes of this element. */
70
+ renderChildNodes: RenderChildNodes;
71
+ }
72
+ export interface ExamServerAPI {
73
+ /**
74
+ * Setting CAS status to allowed will lock the answers for each section where
75
+ * the use of CAS software is forbidden.
76
+ *
77
+ * All state transitions are not legal (for example, you may not disable CAS
78
+ * software after they have been allowed), so the function returns the CAS
79
+ * status that the server decided upon.
80
+ */
81
+ setCasStatus: (casStatus: CasStatus) => Promise<CasStatus>;
82
+ /** Retrieve the latest answer for each question */
83
+ getAnswers: () => Promise<ExamAnswer[]>;
84
+ /** Save a new answer to the server */
85
+ saveAnswer: (answer: ExamAnswer) => Promise<void>;
86
+ /**
87
+ * Play a non-restricted audio file. Right now, this is only used by the
88
+ * audio test. The Promise should be resolved with `'ok'` when playback starts
89
+ * or with an error response if an error occurs.
90
+ */
91
+ playAudio: (src: string) => Promise<AudioPlaybackResponse>;
92
+ /**
93
+ * Play a restricted audio file. The promise should be resolved with `'ok'`
94
+ * when the playback starts or with an error response if an error occurs.
95
+ *
96
+ * @param restrictedAudioId A number that uniquely identifies each restricted audio element.
97
+ * @param playbackTimes How many times this audio has been listened to already.
98
+ */
99
+ playRestrictedAudio: (src: string, restrictedAudioId: number, playbackTimes: number) => Promise<AudioPlaybackResponse>;
100
+ /** Select another answer version from answer history. Return undefined to cancel. Optional feature. */
101
+ selectAnswerVersion?: (questionId: QuestionId, questionTitle: string) => Promise<ExamAnswer | undefined>;
102
+ /** Save screenshot to server. Should return the URL to the saved screenshot. */
103
+ saveScreenshot: (questionId: QuestionId, screenshot: Blob) => Promise<string>;
104
+ }
105
+ export interface AnswerError {
106
+ key: keyof Translations['answer-errors'];
107
+ options?: object;
108
+ }
109
+ export {};
110
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,oBAAY,UAAU,GAAG,MAAM,CAAA;AAE/B,UAAU,YAAY;IACpB,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AACD,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;CACvB;AACD,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,IAAI,EAAE,UAAU,CAAA;IAChB,cAAc,EAAE,MAAM,C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,CAAA;IAC1D,mDAAmD;IACnD,UAAU,EAAE,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACvC,sCAAsC;IACtC,UAAU,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjD;;;;OAIG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAC1D;;;;;;OAMG;IACH,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACtH,uGAAuG;IACvG,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IACxG,gFAAgF;IAChF,cAAc,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CAC9E;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,YAAY,CAAC,eAAe,CAAC,CAAA;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const withContext: <T, P>(Context: React.Context<T>, parse: (p: P) => T) => (Component: React.ComponentType<P>) => React.ComponentType<P>;
3
+ //# sourceMappingURL=withContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withContext.d.ts","sourceRoot":"","sources":["../../src/components/withContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,WAAW,wHAavB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { getDisplayName } from '../getDisplayName';
3
+ export const withContext = (Context, parse) => (Component) => {
4
+ const Wrapped = (props) => {
5
+ const ctx = parse(props);
6
+ return (React.createElement(Context.Provider, { value: ctx },
7
+ React.createElement(Component, Object.assign({}, props))));
8
+ };
9
+ Wrapped.displayName = 'WithContext(' + getDisplayName(Component) + ')';
10
+ return Wrapped;
11
+ };
12
+ //# sourceMappingURL=withContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withContext.js","sourceRoot":"","sources":["../../src/components/withContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAO,OAAyB,EAAE,KAAkB,EAAE,EAAE,CAAC,CAClF,SAAiC,EACT,EAAE;IAC1B,MAAM,OAAO,GAAG,CAAC,KAAQ,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;QACxB,OAAO,CACL,oBAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG;YAC1B,oBAAC,SAAS,oBAAK,KAAK,EAAI,CACP,CACpB,CAAA;IACH,CAAC,CAAA;IACD,OAAO,CAAC,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG,GAAG,CAAA;IACtE,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}