@digabi/exam-engine-core 23.0.0 → 23.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (652) hide show
  1. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  2. package/dist/components/exam/ExamineExam.d.ts +5 -0
  3. package/dist/components/exam/ExamineExam.d.ts.map +1 -0
  4. package/dist/components/exam/ExamineExam.js +20 -0
  5. package/dist/components/exam/ExamineExam.js.map +1 -0
  6. package/dist/main-bundle.js +2 -4
  7. package/dist/src/components/AnswerToolbar.d.ts +18 -0
  8. package/dist/src/components/AnswerToolbar.d.ts.map +1 -0
  9. package/dist/src/components/AnswerToolbar.js +36 -0
  10. package/dist/src/components/AnswerToolbar.js.map +1 -0
  11. package/dist/src/components/AnsweringInstructions.d.ts +12 -0
  12. package/dist/src/components/AnsweringInstructions.d.ts.map +1 -0
  13. package/dist/src/components/AnsweringInstructions.js +24 -0
  14. package/dist/src/components/AnsweringInstructions.js.map +1 -0
  15. package/dist/src/components/DocumentTitle.d.ts +5 -0
  16. package/dist/src/components/DocumentTitle.d.ts.map +1 -0
  17. package/dist/src/components/DocumentTitle.js +13 -0
  18. package/dist/src/components/DocumentTitle.js.map +1 -0
  19. package/dist/src/components/NotificationIcon.d.ts +4 -0
  20. package/dist/src/components/NotificationIcon.d.ts.map +1 -0
  21. package/dist/src/components/NotificationIcon.js +6 -0
  22. package/dist/src/components/NotificationIcon.js.map +1 -0
  23. package/dist/src/components/RenderChildNodes.d.ts +5 -0
  24. package/dist/src/components/RenderChildNodes.d.ts.map +1 -0
  25. package/dist/src/components/RenderChildNodes.js +7 -0
  26. package/dist/src/components/RenderChildNodes.js.map +1 -0
  27. package/dist/src/components/RenderExamElements.d.ts +6 -0
  28. package/dist/src/components/RenderExamElements.d.ts.map +1 -0
  29. package/dist/src/components/RenderExamElements.js +6 -0
  30. package/dist/src/components/RenderExamElements.js.map +1 -0
  31. package/dist/src/components/RenderIf.d.ts +4 -0
  32. package/dist/src/components/RenderIf.d.ts.map +1 -0
  33. package/dist/src/components/RenderIf.js +8 -0
  34. package/dist/src/components/RenderIf.js.map +1 -0
  35. package/dist/src/components/ScreenReaderOnly.d.ts +5 -0
  36. package/dist/src/components/ScreenReaderOnly.d.ts.map +1 -0
  37. package/dist/src/components/ScreenReaderOnly.js +3 -0
  38. package/dist/src/components/ScreenReaderOnly.js.map +1 -0
  39. package/dist/src/components/SectionElement.d.ts +4 -0
  40. package/dist/src/components/SectionElement.d.ts.map +1 -0
  41. package/dist/src/components/SectionElement.js +8 -0
  42. package/dist/src/components/SectionElement.js.map +1 -0
  43. package/dist/src/components/attachments/Attachment.d.ts +4 -0
  44. package/dist/src/components/attachments/Attachment.d.ts.map +1 -0
  45. package/dist/src/components/attachments/Attachment.js +8 -0
  46. package/dist/src/components/attachments/Attachment.js.map +1 -0
  47. package/dist/src/components/attachments/AttachmentTitle.d.ts +6 -0
  48. package/dist/src/components/attachments/AttachmentTitle.d.ts.map +1 -0
  49. package/dist/src/components/attachments/AttachmentTitle.js +12 -0
  50. package/dist/src/components/attachments/AttachmentTitle.js.map +1 -0
  51. package/dist/src/components/attachments/Attachments.d.ts +5 -0
  52. package/dist/src/components/attachments/Attachments.d.ts.map +1 -0
  53. package/dist/src/components/attachments/Attachments.js +55 -0
  54. package/dist/src/components/attachments/Attachments.js.map +1 -0
  55. package/dist/src/components/attachments/ExternalMaterial.d.ts +9 -0
  56. package/dist/src/components/attachments/ExternalMaterial.d.ts.map +1 -0
  57. package/dist/src/components/attachments/ExternalMaterial.js +46 -0
  58. package/dist/src/components/attachments/ExternalMaterial.js.map +1 -0
  59. package/dist/src/components/attachments/Question.d.ts +4 -0
  60. package/dist/src/components/attachments/Question.d.ts.map +1 -0
  61. package/dist/src/components/attachments/Question.js +16 -0
  62. package/dist/src/components/attachments/Question.js.map +1 -0
  63. package/dist/src/components/attachments/QuestionTitle.d.ts +6 -0
  64. package/dist/src/components/attachments/QuestionTitle.d.ts.map +1 -0
  65. package/dist/src/components/attachments/QuestionTitle.js +15 -0
  66. package/dist/src/components/attachments/QuestionTitle.js.map +1 -0
  67. package/dist/src/components/context/AnnotationProvider.d.ts +16 -0
  68. package/dist/src/components/context/AnnotationProvider.d.ts.map +1 -0
  69. package/dist/src/components/context/AnnotationProvider.js +35 -0
  70. package/dist/src/components/context/AnnotationProvider.js.map +1 -0
  71. package/dist/src/components/context/AttachmentContext.d.ts +13 -0
  72. package/dist/src/components/context/AttachmentContext.d.ts.map +1 -0
  73. package/dist/src/components/context/AttachmentContext.js +12 -0
  74. package/dist/src/components/context/AttachmentContext.js.map +1 -0
  75. package/dist/src/components/context/CommonExamContext.d.ts +22 -0
  76. package/dist/src/components/context/CommonExamContext.d.ts.map +1 -0
  77. package/dist/src/components/context/CommonExamContext.js +28 -0
  78. package/dist/src/components/context/CommonExamContext.js.map +1 -0
  79. package/dist/src/components/context/ExamContext.d.ts +9 -0
  80. package/dist/src/components/context/ExamContext.d.ts.map +1 -0
  81. package/dist/src/components/context/ExamContext.js +11 -0
  82. package/dist/src/components/context/ExamContext.js.map +1 -0
  83. package/dist/src/components/context/IsInSidebarContext.d.ts +6 -0
  84. package/dist/src/components/context/IsInSidebarContext.d.ts.map +1 -0
  85. package/dist/src/components/context/IsInSidebarContext.js +3 -0
  86. package/dist/src/components/context/IsInSidebarContext.js.map +1 -0
  87. package/dist/src/components/context/QuestionContext.d.ts +14 -0
  88. package/dist/src/components/context/QuestionContext.d.ts.map +1 -0
  89. package/dist/src/components/context/QuestionContext.js +27 -0
  90. package/dist/src/components/context/QuestionContext.js.map +1 -0
  91. package/dist/src/components/context/ResultsContext.d.ts +17 -0
  92. package/dist/src/components/context/ResultsContext.d.ts.map +1 -0
  93. package/dist/src/components/context/ResultsContext.js +69 -0
  94. package/dist/src/components/context/ResultsContext.js.map +1 -0
  95. package/dist/src/components/context/SectionContext.d.ts +12 -0
  96. package/dist/src/components/context/SectionContext.d.ts.map +1 -0
  97. package/dist/src/components/context/SectionContext.js +21 -0
  98. package/dist/src/components/context/SectionContext.js.map +1 -0
  99. package/dist/src/components/context/TOCContext.d.ts +7 -0
  100. package/dist/src/components/context/TOCContext.d.ts.map +1 -0
  101. package/dist/src/components/context/TOCContext.js +3 -0
  102. package/dist/src/components/context/TOCContext.js.map +1 -0
  103. package/dist/src/components/context/withContext.d.ts +3 -0
  104. package/dist/src/components/context/withContext.d.ts.map +1 -0
  105. package/dist/src/components/context/withContext.js +12 -0
  106. package/dist/src/components/context/withContext.js.map +1 -0
  107. package/dist/src/components/exam/Attachment.d.ts +4 -0
  108. package/dist/src/components/exam/Attachment.d.ts.map +1 -0
  109. package/dist/src/components/exam/Attachment.js +8 -0
  110. package/dist/src/components/exam/Attachment.js.map +1 -0
  111. package/dist/src/components/exam/ChoiceAnswer.d.ts +5 -0
  112. package/dist/src/components/exam/ChoiceAnswer.d.ts.map +1 -0
  113. package/dist/src/components/exam/ChoiceAnswer.js +53 -0
  114. package/dist/src/components/exam/ChoiceAnswer.js.map +1 -0
  115. package/dist/src/components/exam/DropdownAnswer.d.ts +5 -0
  116. package/dist/src/components/exam/DropdownAnswer.d.ts.map +1 -0
  117. package/dist/src/components/exam/DropdownAnswer.js +101 -0
  118. package/dist/src/components/exam/DropdownAnswer.js.map +1 -0
  119. package/dist/src/components/exam/Exam.d.ts +48 -0
  120. package/dist/src/components/exam/Exam.d.ts.map +1 -0
  121. package/dist/src/components/exam/Exam.js +195 -0
  122. package/dist/src/components/exam/Exam.js.map +1 -0
  123. package/dist/src/components/exam/ExamFooter.d.ts +6 -0
  124. package/dist/src/components/exam/ExamFooter.d.ts.map +1 -0
  125. package/dist/src/components/exam/ExamFooter.js +6 -0
  126. package/dist/src/components/exam/ExamFooter.js.map +1 -0
  127. package/dist/src/components/exam/ExamInstruction.d.ts +6 -0
  128. package/dist/src/components/exam/ExamInstruction.d.ts.map +1 -0
  129. package/dist/src/components/exam/ExamInstruction.js +6 -0
  130. package/dist/src/components/exam/ExamInstruction.js.map +1 -0
  131. package/dist/src/components/exam/ExternalMaterial.d.ts +10 -0
  132. package/dist/src/components/exam/ExternalMaterial.d.ts.map +1 -0
  133. package/dist/src/components/exam/ExternalMaterial.js +33 -0
  134. package/dist/src/components/exam/ExternalMaterial.js.map +1 -0
  135. package/dist/src/components/exam/GoToExamineAnswersButton.d.ts +5 -0
  136. package/dist/src/components/exam/GoToExamineAnswersButton.d.ts.map +1 -0
  137. package/dist/src/components/exam/GoToExamineAnswersButton.js +18 -0
  138. package/dist/src/components/exam/GoToExamineAnswersButton.js.map +1 -0
  139. package/dist/src/components/exam/Hints.d.ts +5 -0
  140. package/dist/src/components/exam/Hints.d.ts.map +1 -0
  141. package/dist/src/components/exam/Hints.js +31 -0
  142. package/dist/src/components/exam/Hints.js.map +1 -0
  143. package/dist/src/components/exam/Question.d.ts +8 -0
  144. package/dist/src/components/exam/Question.d.ts.map +1 -0
  145. package/dist/src/components/exam/Question.js +75 -0
  146. package/dist/src/components/exam/Question.js.map +1 -0
  147. package/dist/src/components/exam/QuestionInstruction.d.ts +6 -0
  148. package/dist/src/components/exam/QuestionInstruction.d.ts.map +1 -0
  149. package/dist/src/components/exam/QuestionInstruction.js +8 -0
  150. package/dist/src/components/exam/QuestionInstruction.js.map +1 -0
  151. package/dist/src/components/exam/QuestionTitle.d.ts +5 -0
  152. package/dist/src/components/exam/QuestionTitle.d.ts.map +1 -0
  153. package/dist/src/components/exam/QuestionTitle.js +26 -0
  154. package/dist/src/components/exam/QuestionTitle.js.map +1 -0
  155. package/dist/src/components/exam/RichTextAnswer.d.ts +41 -0
  156. package/dist/src/components/exam/RichTextAnswer.d.ts.map +1 -0
  157. package/dist/src/components/exam/RichTextAnswer.js +79 -0
  158. package/dist/src/components/exam/RichTextAnswer.js.map +1 -0
  159. package/dist/src/components/exam/Section.d.ts +4 -0
  160. package/dist/src/components/exam/Section.d.ts.map +1 -0
  161. package/dist/src/components/exam/Section.js +49 -0
  162. package/dist/src/components/exam/Section.js.map +1 -0
  163. package/dist/src/components/exam/SectionInstruction.d.ts +6 -0
  164. package/dist/src/components/exam/SectionInstruction.d.ts.map +1 -0
  165. package/dist/src/components/exam/SectionInstruction.js +6 -0
  166. package/dist/src/components/exam/SectionInstruction.js.map +1 -0
  167. package/dist/src/components/exam/SectionTitle.d.ts +6 -0
  168. package/dist/src/components/exam/SectionTitle.d.ts.map +1 -0
  169. package/dist/src/components/exam/SectionTitle.js +30 -0
  170. package/dist/src/components/exam/SectionTitle.js.map +1 -0
  171. package/dist/src/components/exam/StudentNameHeader.d.ts +8 -0
  172. package/dist/src/components/exam/StudentNameHeader.d.ts.map +1 -0
  173. package/dist/src/components/exam/StudentNameHeader.js +3 -0
  174. package/dist/src/components/exam/StudentNameHeader.js.map +1 -0
  175. package/dist/src/components/exam/TextAnswer.d.ts +6 -0
  176. package/dist/src/components/exam/TextAnswer.d.ts.map +1 -0
  177. package/dist/src/components/exam/TextAnswer.js +20 -0
  178. package/dist/src/components/exam/TextAnswer.js.map +1 -0
  179. package/dist/src/components/exam/UndoHistoryEntry.d.ts +19 -0
  180. package/dist/src/components/exam/UndoHistoryEntry.d.ts.map +1 -0
  181. package/dist/src/components/exam/UndoHistoryEntry.js +39 -0
  182. package/dist/src/components/exam/UndoHistoryEntry.js.map +1 -0
  183. package/dist/src/components/exam/UndoView.d.ts +35 -0
  184. package/dist/src/components/exam/UndoView.d.ts.map +1 -0
  185. package/dist/src/components/exam/UndoView.js +162 -0
  186. package/dist/src/components/exam/UndoView.js.map +1 -0
  187. package/dist/src/components/exam/internal/ErrorIndicator.d.ts +9 -0
  188. package/dist/src/components/exam/internal/ErrorIndicator.d.ts.map +1 -0
  189. package/dist/src/components/exam/internal/ErrorIndicator.js +63 -0
  190. package/dist/src/components/exam/internal/ErrorIndicator.js.map +1 -0
  191. package/dist/src/components/exam/internal/ProgressBar.d.ts +8 -0
  192. package/dist/src/components/exam/internal/ProgressBar.d.ts.map +1 -0
  193. package/dist/src/components/exam/internal/ProgressBar.js +19 -0
  194. package/dist/src/components/exam/internal/ProgressBar.js.map +1 -0
  195. package/dist/src/components/exam/internal/SaveIndicator.d.ts +5 -0
  196. package/dist/src/components/exam/internal/SaveIndicator.d.ts.map +1 -0
  197. package/dist/src/components/exam/internal/SaveIndicator.js +16 -0
  198. package/dist/src/components/exam/internal/SaveIndicator.js.map +1 -0
  199. package/dist/src/components/exam/internal/TextAnswerInput.d.ts +6 -0
  200. package/dist/src/components/exam/internal/TextAnswerInput.d.ts.map +1 -0
  201. package/dist/src/components/exam/internal/TextAnswerInput.js +128 -0
  202. package/dist/src/components/exam/internal/TextAnswerInput.js.map +1 -0
  203. package/dist/src/components/grading/AnswerCharacterCounter.d.ts +6 -0
  204. package/dist/src/components/grading/AnswerCharacterCounter.d.ts.map +1 -0
  205. package/dist/src/components/grading/AnswerCharacterCounter.js +21 -0
  206. package/dist/src/components/grading/AnswerCharacterCounter.js.map +1 -0
  207. package/dist/src/components/grading/GradingAnswer.d.ts +24 -0
  208. package/dist/src/components/grading/GradingAnswer.d.ts.map +1 -0
  209. package/dist/src/components/grading/GradingAnswer.js +306 -0
  210. package/dist/src/components/grading/GradingAnswer.js.map +1 -0
  211. package/dist/src/components/grading/GradingAnswerAnnotationList.d.ts +9 -0
  212. package/dist/src/components/grading/GradingAnswerAnnotationList.d.ts.map +1 -0
  213. package/dist/src/components/grading/GradingAnswerAnnotationList.js +19 -0
  214. package/dist/src/components/grading/GradingAnswerAnnotationList.js.map +1 -0
  215. package/dist/src/components/grading/editAnnotations.d.ts +29 -0
  216. package/dist/src/components/grading/editAnnotations.d.ts.map +1 -0
  217. package/dist/src/components/grading/editAnnotations.js +190 -0
  218. package/dist/src/components/grading/editAnnotations.js.map +1 -0
  219. package/dist/src/components/grading/examAnnotationUtils.d.ts +3 -0
  220. package/dist/src/components/grading/examAnnotationUtils.d.ts.map +1 -0
  221. package/dist/src/components/grading/examAnnotationUtils.js +44 -0
  222. package/dist/src/components/grading/examAnnotationUtils.js.map +1 -0
  223. package/dist/src/components/grading/largeImageDetector.d.ts +3 -0
  224. package/dist/src/components/grading/largeImageDetector.d.ts.map +1 -0
  225. package/dist/src/components/grading/largeImageDetector.js +45 -0
  226. package/dist/src/components/grading/largeImageDetector.js.map +1 -0
  227. package/dist/src/components/grading-instructions/AnswerGradingInstruction.d.ts +5 -0
  228. package/dist/src/components/grading-instructions/AnswerGradingInstruction.d.ts.map +1 -0
  229. package/dist/src/components/grading-instructions/AnswerGradingInstruction.js +4 -0
  230. package/dist/src/components/grading-instructions/AnswerGradingInstruction.js.map +1 -0
  231. package/dist/src/components/grading-instructions/AutogradedAnswer.d.ts +5 -0
  232. package/dist/src/components/grading-instructions/AutogradedAnswer.d.ts.map +1 -0
  233. package/dist/src/components/grading-instructions/AutogradedAnswer.js +34 -0
  234. package/dist/src/components/grading-instructions/AutogradedAnswer.js.map +1 -0
  235. package/dist/src/components/grading-instructions/AutogradedAnswerOption.d.ts +5 -0
  236. package/dist/src/components/grading-instructions/AutogradedAnswerOption.d.ts.map +1 -0
  237. package/dist/src/components/grading-instructions/AutogradedAnswerOption.js +17 -0
  238. package/dist/src/components/grading-instructions/AutogradedAnswerOption.js.map +1 -0
  239. package/dist/src/components/grading-instructions/ExamGradingInstruction.d.ts +5 -0
  240. package/dist/src/components/grading-instructions/ExamGradingInstruction.d.ts.map +1 -0
  241. package/dist/src/components/grading-instructions/ExamGradingInstruction.js +4 -0
  242. package/dist/src/components/grading-instructions/ExamGradingInstruction.js.map +1 -0
  243. package/dist/src/components/grading-instructions/GradingInstructions.d.ts +6 -0
  244. package/dist/src/components/grading-instructions/GradingInstructions.d.ts.map +1 -0
  245. package/dist/src/components/grading-instructions/GradingInstructions.js +109 -0
  246. package/dist/src/components/grading-instructions/GradingInstructions.js.map +1 -0
  247. package/dist/src/components/grading-instructions/Question.d.ts +4 -0
  248. package/dist/src/components/grading-instructions/Question.d.ts.map +1 -0
  249. package/dist/src/components/grading-instructions/Question.js +14 -0
  250. package/dist/src/components/grading-instructions/Question.js.map +1 -0
  251. package/dist/src/components/grading-instructions/QuestionTitle.d.ts +5 -0
  252. package/dist/src/components/grading-instructions/QuestionTitle.d.ts.map +1 -0
  253. package/dist/src/components/grading-instructions/QuestionTitle.js +19 -0
  254. package/dist/src/components/grading-instructions/QuestionTitle.js.map +1 -0
  255. package/dist/src/components/grading-instructions/Recording.d.ts +5 -0
  256. package/dist/src/components/grading-instructions/Recording.d.ts.map +1 -0
  257. package/dist/src/components/grading-instructions/Recording.js +19 -0
  258. package/dist/src/components/grading-instructions/Recording.js.map +1 -0
  259. package/dist/src/components/grading-instructions/Section.d.ts +4 -0
  260. package/dist/src/components/grading-instructions/Section.d.ts.map +1 -0
  261. package/dist/src/components/grading-instructions/Section.js +10 -0
  262. package/dist/src/components/grading-instructions/Section.js.map +1 -0
  263. package/dist/src/components/grading-instructions/SectionTitle.d.ts +5 -0
  264. package/dist/src/components/grading-instructions/SectionTitle.d.ts.map +1 -0
  265. package/dist/src/components/grading-instructions/SectionTitle.js +16 -0
  266. package/dist/src/components/grading-instructions/SectionTitle.js.map +1 -0
  267. package/dist/src/components/results/ChoiceAnswer.d.ts +6 -0
  268. package/dist/src/components/results/ChoiceAnswer.d.ts.map +1 -0
  269. package/dist/src/components/results/ChoiceAnswer.js +57 -0
  270. package/dist/src/components/results/ChoiceAnswer.js.map +1 -0
  271. package/dist/src/components/results/DropdownAnswer.d.ts +6 -0
  272. package/dist/src/components/results/DropdownAnswer.d.ts.map +1 -0
  273. package/dist/src/components/results/DropdownAnswer.js +43 -0
  274. package/dist/src/components/results/DropdownAnswer.js.map +1 -0
  275. package/dist/src/components/results/EndExamSession.d.ts +8 -0
  276. package/dist/src/components/results/EndExamSession.d.ts.map +1 -0
  277. package/dist/src/components/results/EndExamSession.js +20 -0
  278. package/dist/src/components/results/EndExamSession.js.map +1 -0
  279. package/dist/src/components/results/MultiLineAnswer.d.ts +8 -0
  280. package/dist/src/components/results/MultiLineAnswer.d.ts.map +1 -0
  281. package/dist/src/components/results/MultiLineAnswer.js +22 -0
  282. package/dist/src/components/results/MultiLineAnswer.js.map +1 -0
  283. package/dist/src/components/results/Question.d.ts +4 -0
  284. package/dist/src/components/results/Question.d.ts.map +1 -0
  285. package/dist/src/components/results/Question.js +31 -0
  286. package/dist/src/components/results/Question.js.map +1 -0
  287. package/dist/src/components/results/QuestionTitle.d.ts +6 -0
  288. package/dist/src/components/results/QuestionTitle.d.ts.map +1 -0
  289. package/dist/src/components/results/QuestionTitle.js +26 -0
  290. package/dist/src/components/results/QuestionTitle.js.map +1 -0
  291. package/dist/src/components/results/Results.d.ts +19 -0
  292. package/dist/src/components/results/Results.d.ts.map +1 -0
  293. package/dist/src/components/results/Results.js +136 -0
  294. package/dist/src/components/results/Results.js.map +1 -0
  295. package/dist/src/components/results/ScoredTextAnswer.d.ts +6 -0
  296. package/dist/src/components/results/ScoredTextAnswer.d.ts.map +1 -0
  297. package/dist/src/components/results/ScoredTextAnswer.js +22 -0
  298. package/dist/src/components/results/ScoredTextAnswer.js.map +1 -0
  299. package/dist/src/components/results/Section.d.ts +4 -0
  300. package/dist/src/components/results/Section.d.ts.map +1 -0
  301. package/dist/src/components/results/Section.js +11 -0
  302. package/dist/src/components/results/Section.js.map +1 -0
  303. package/dist/src/components/results/SingleLineAnswer.d.ts +12 -0
  304. package/dist/src/components/results/SingleLineAnswer.d.ts.map +1 -0
  305. package/dist/src/components/results/SingleLineAnswer.js +26 -0
  306. package/dist/src/components/results/SingleLineAnswer.js.map +1 -0
  307. package/dist/src/components/results/TextAnswer.d.ts +7 -0
  308. package/dist/src/components/results/TextAnswer.d.ts.map +1 -0
  309. package/dist/src/components/results/TextAnswer.js +48 -0
  310. package/dist/src/components/results/TextAnswer.js.map +1 -0
  311. package/dist/src/components/results/internal/AnnotationList.d.ts +5 -0
  312. package/dist/src/components/results/internal/AnnotationList.d.ts.map +1 -0
  313. package/dist/src/components/results/internal/AnnotationList.js +32 -0
  314. package/dist/src/components/results/internal/AnnotationList.js.map +1 -0
  315. package/dist/src/components/results/internal/QuestionAutoScore.d.ts +11 -0
  316. package/dist/src/components/results/internal/QuestionAutoScore.d.ts.map +1 -0
  317. package/dist/src/components/results/internal/QuestionAutoScore.js +17 -0
  318. package/dist/src/components/results/internal/QuestionAutoScore.js.map +1 -0
  319. package/dist/src/components/results/internal/QuestionManualScore.d.ts +13 -0
  320. package/dist/src/components/results/internal/QuestionManualScore.d.ts.map +1 -0
  321. package/dist/src/components/results/internal/QuestionManualScore.js +66 -0
  322. package/dist/src/components/results/internal/QuestionManualScore.js.map +1 -0
  323. package/dist/src/components/results/internal/QuestionScoresContainer.d.ts +11 -0
  324. package/dist/src/components/results/internal/QuestionScoresContainer.d.ts.map +1 -0
  325. package/dist/src/components/results/internal/QuestionScoresContainer.js +27 -0
  326. package/dist/src/components/results/internal/QuestionScoresContainer.js.map +1 -0
  327. package/dist/src/components/results/isExamineExamPageHook.d.ts +2 -0
  328. package/dist/src/components/results/isExamineExamPageHook.d.ts.map +1 -0
  329. package/dist/src/components/results/isExamineExamPageHook.js +7 -0
  330. package/dist/src/components/results/isExamineExamPageHook.js.map +1 -0
  331. package/dist/src/components/shared/AnnotatableText.d.ts +5 -0
  332. package/dist/src/components/shared/AnnotatableText.d.ts.map +1 -0
  333. package/dist/src/components/shared/AnnotatableText.js +73 -0
  334. package/dist/src/components/shared/AnnotatableText.js.map +1 -0
  335. package/dist/src/components/shared/AnnotationLists.d.ts +13 -0
  336. package/dist/src/components/shared/AnnotationLists.d.ts.map +1 -0
  337. package/dist/src/components/shared/AnnotationLists.js +17 -0
  338. package/dist/src/components/shared/AnnotationLists.js.map +1 -0
  339. package/dist/src/components/shared/AnnotationPopup.d.ts +3 -0
  340. package/dist/src/components/shared/AnnotationPopup.d.ts.map +1 -0
  341. package/dist/src/components/shared/AnnotationPopup.js +74 -0
  342. package/dist/src/components/shared/AnnotationPopup.js.map +1 -0
  343. package/dist/src/components/shared/AnswerIndicator.d.ts +12 -0
  344. package/dist/src/components/shared/AnswerIndicator.d.ts.map +1 -0
  345. package/dist/src/components/shared/AnswerIndicator.js +27 -0
  346. package/dist/src/components/shared/AnswerIndicator.js.map +1 -0
  347. package/dist/src/components/shared/AnswerLengthInfo.d.ts +7 -0
  348. package/dist/src/components/shared/AnswerLengthInfo.d.ts.map +1 -0
  349. package/dist/src/components/shared/AnswerLengthInfo.js +11 -0
  350. package/dist/src/components/shared/AnswerLengthInfo.js.map +1 -0
  351. package/dist/src/components/shared/AttachmentLink.d.ts +5 -0
  352. package/dist/src/components/shared/AttachmentLink.d.ts.map +1 -0
  353. package/dist/src/components/shared/AttachmentLink.js +28 -0
  354. package/dist/src/components/shared/AttachmentLink.js.map +1 -0
  355. package/dist/src/components/shared/AttachmentLinks.d.ts +5 -0
  356. package/dist/src/components/shared/AttachmentLinks.d.ts.map +1 -0
  357. package/dist/src/components/shared/AttachmentLinks.js +58 -0
  358. package/dist/src/components/shared/AttachmentLinks.js.map +1 -0
  359. package/dist/src/components/shared/Audio.d.ts +6 -0
  360. package/dist/src/components/shared/Audio.d.ts.map +1 -0
  361. package/dist/src/components/shared/Audio.js +31 -0
  362. package/dist/src/components/shared/Audio.js.map +1 -0
  363. package/dist/src/components/shared/AudioGroup.d.ts +6 -0
  364. package/dist/src/components/shared/AudioGroup.d.ts.map +1 -0
  365. package/dist/src/components/shared/AudioGroup.js +9 -0
  366. package/dist/src/components/shared/AudioGroup.js.map +1 -0
  367. package/dist/src/components/shared/AudioTest.d.ts +6 -0
  368. package/dist/src/components/shared/AudioTest.d.ts.map +1 -0
  369. package/dist/src/components/shared/AudioTest.js +34 -0
  370. package/dist/src/components/shared/AudioTest.js.map +1 -0
  371. package/dist/src/components/shared/ExamTranslation.d.ts +6 -0
  372. package/dist/src/components/shared/ExamTranslation.d.ts.map +1 -0
  373. package/dist/src/components/shared/ExamTranslation.js +9 -0
  374. package/dist/src/components/shared/ExamTranslation.js.map +1 -0
  375. package/dist/src/components/shared/File.d.ts +6 -0
  376. package/dist/src/components/shared/File.d.ts.map +1 -0
  377. package/dist/src/components/shared/File.js +15 -0
  378. package/dist/src/components/shared/File.js.map +1 -0
  379. package/dist/src/components/shared/Footer.d.ts +5 -0
  380. package/dist/src/components/shared/Footer.d.ts.map +1 -0
  381. package/dist/src/components/shared/Footer.js +3 -0
  382. package/dist/src/components/shared/Footer.js.map +1 -0
  383. package/dist/src/components/shared/Formula.d.ts +6 -0
  384. package/dist/src/components/shared/Formula.d.ts.map +1 -0
  385. package/dist/src/components/shared/Formula.js +13 -0
  386. package/dist/src/components/shared/Formula.js.map +1 -0
  387. package/dist/src/components/shared/Image.d.ts +6 -0
  388. package/dist/src/components/shared/Image.d.ts.map +1 -0
  389. package/dist/src/components/shared/Image.js +30 -0
  390. package/dist/src/components/shared/Image.js.map +1 -0
  391. package/dist/src/components/shared/ImageOverlay.d.ts +6 -0
  392. package/dist/src/components/shared/ImageOverlay.d.ts.map +1 -0
  393. package/dist/src/components/shared/ImageOverlay.js +43 -0
  394. package/dist/src/components/shared/ImageOverlay.js.map +1 -0
  395. package/dist/src/components/shared/QuestionNumber.d.ts +4 -0
  396. package/dist/src/components/shared/QuestionNumber.d.ts.map +1 -0
  397. package/dist/src/components/shared/QuestionNumber.js +12 -0
  398. package/dist/src/components/shared/QuestionNumber.js.map +1 -0
  399. package/dist/src/components/shared/Reference.d.ts +6 -0
  400. package/dist/src/components/shared/Reference.d.ts.map +1 -0
  401. package/dist/src/components/shared/Reference.js +72 -0
  402. package/dist/src/components/shared/Reference.js.map +1 -0
  403. package/dist/src/components/shared/References.d.ts +6 -0
  404. package/dist/src/components/shared/References.d.ts.map +1 -0
  405. package/dist/src/components/shared/References.js +26 -0
  406. package/dist/src/components/shared/References.js.map +1 -0
  407. package/dist/src/components/shared/Score.d.ts +8 -0
  408. package/dist/src/components/shared/Score.d.ts.map +1 -0
  409. package/dist/src/components/shared/Score.js +13 -0
  410. package/dist/src/components/shared/Score.js.map +1 -0
  411. package/dist/src/components/shared/TOCQuestion.d.ts +4 -0
  412. package/dist/src/components/shared/TOCQuestion.d.ts.map +1 -0
  413. package/dist/src/components/shared/TOCQuestion.js +77 -0
  414. package/dist/src/components/shared/TOCQuestion.js.map +1 -0
  415. package/dist/src/components/shared/TOCSection.d.ts +7 -0
  416. package/dist/src/components/shared/TOCSection.d.ts.map +1 -0
  417. package/dist/src/components/shared/TOCSection.js +15 -0
  418. package/dist/src/components/shared/TOCSection.js.map +1 -0
  419. package/dist/src/components/shared/TOCSectionTitle.d.ts +4 -0
  420. package/dist/src/components/shared/TOCSectionTitle.d.ts.map +1 -0
  421. package/dist/src/components/shared/TOCSectionTitle.js +34 -0
  422. package/dist/src/components/shared/TOCSectionTitle.js.map +1 -0
  423. package/dist/src/components/shared/TableOfContents.d.ts +8 -0
  424. package/dist/src/components/shared/TableOfContents.d.ts.map +1 -0
  425. package/dist/src/components/shared/TableOfContents.js +61 -0
  426. package/dist/src/components/shared/TableOfContents.js.map +1 -0
  427. package/dist/src/components/shared/VersionNumber.d.ts +3 -0
  428. package/dist/src/components/shared/VersionNumber.d.ts.map +1 -0
  429. package/dist/src/components/shared/VersionNumber.js +10 -0
  430. package/dist/src/components/shared/VersionNumber.js.map +1 -0
  431. package/dist/src/components/shared/Video.d.ts +6 -0
  432. package/dist/src/components/shared/Video.d.ts.map +1 -0
  433. package/dist/src/components/shared/Video.js +22 -0
  434. package/dist/src/components/shared/Video.js.map +1 -0
  435. package/dist/src/components/shared/internal/AttachmentLinkAnchor.d.ts +8 -0
  436. package/dist/src/components/shared/internal/AttachmentLinkAnchor.d.ts.map +1 -0
  437. package/dist/src/components/shared/internal/AttachmentLinkAnchor.js +4 -0
  438. package/dist/src/components/shared/internal/AttachmentLinkAnchor.js.map +1 -0
  439. package/dist/src/components/shared/internal/AudioPlaybackError.d.ts +8 -0
  440. package/dist/src/components/shared/internal/AudioPlaybackError.d.ts.map +1 -0
  441. package/dist/src/components/shared/internal/AudioPlaybackError.js +17 -0
  442. package/dist/src/components/shared/internal/AudioPlaybackError.js.map +1 -0
  443. package/dist/src/components/shared/internal/ResponsiveMediaContainer.d.ts +18 -0
  444. package/dist/src/components/shared/internal/ResponsiveMediaContainer.d.ts.map +1 -0
  445. package/dist/src/components/shared/internal/ResponsiveMediaContainer.js +21 -0
  446. package/dist/src/components/shared/internal/ResponsiveMediaContainer.js.map +1 -0
  447. package/dist/src/components/shared/internal/RestrictedAudioPlayer.d.ts +12 -0
  448. package/dist/src/components/shared/internal/RestrictedAudioPlayer.d.ts.map +1 -0
  449. package/dist/src/components/shared/internal/RestrictedAudioPlayer.js +46 -0
  450. package/dist/src/components/shared/internal/RestrictedAudioPlayer.js.map +1 -0
  451. package/dist/src/components/surround.d.ts +8 -0
  452. package/dist/src/components/surround.d.ts.map +1 -0
  453. package/dist/src/components/surround.js +19 -0
  454. package/dist/src/components/surround.js.map +1 -0
  455. package/dist/src/createRenderChildNodes.d.ts +17 -0
  456. package/dist/src/createRenderChildNodes.d.ts.map +1 -0
  457. package/dist/src/createRenderChildNodes.js +64 -0
  458. package/dist/src/createRenderChildNodes.js.map +1 -0
  459. package/dist/src/dom-utils.d.ts +20 -0
  460. package/dist/src/dom-utils.d.ts.map +1 -0
  461. package/dist/src/dom-utils.js +164 -0
  462. package/dist/src/dom-utils.js.map +1 -0
  463. package/dist/src/fonts.d.ts +5 -0
  464. package/dist/src/fonts.d.ts.map +1 -0
  465. package/dist/src/fonts.js +16 -0
  466. package/dist/src/fonts.js.map +1 -0
  467. package/dist/src/formatting.d.ts +2 -0
  468. package/dist/src/formatting.d.ts.map +1 -0
  469. package/dist/src/formatting.js +4 -0
  470. package/dist/src/formatting.js.map +1 -0
  471. package/dist/src/getDisplayName.d.ts +4 -0
  472. package/dist/src/getDisplayName.d.ts.map +1 -0
  473. package/dist/src/getDisplayName.js +5 -0
  474. package/dist/src/getDisplayName.js.map +1 -0
  475. package/dist/src/i18n/A_E.d.ts +3 -0
  476. package/dist/src/i18n/A_E.d.ts.map +1 -0
  477. package/dist/src/i18n/A_E.js +8 -0
  478. package/dist/src/i18n/A_E.js.map +1 -0
  479. package/dist/src/i18n/BA.d.ts +3 -0
  480. package/dist/src/i18n/BA.d.ts.map +1 -0
  481. package/dist/src/i18n/BA.js +11 -0
  482. package/dist/src/i18n/BA.js.map +1 -0
  483. package/dist/src/i18n/CA.d.ts +3 -0
  484. package/dist/src/i18n/CA.d.ts.map +1 -0
  485. package/dist/src/i18n/CA.js +11 -0
  486. package/dist/src/i18n/CA.js.map +1 -0
  487. package/dist/src/i18n/EA.d.ts +3 -0
  488. package/dist/src/i18n/EA.d.ts.map +1 -0
  489. package/dist/src/i18n/EA.js +16 -0
  490. package/dist/src/i18n/EA.js.map +1 -0
  491. package/dist/src/i18n/FA.d.ts +3 -0
  492. package/dist/src/i18n/FA.d.ts.map +1 -0
  493. package/dist/src/i18n/FA.js +17 -0
  494. package/dist/src/i18n/FA.js.map +1 -0
  495. package/dist/src/i18n/GC.d.ts +3 -0
  496. package/dist/src/i18n/GC.d.ts.map +1 -0
  497. package/dist/src/i18n/GC.js +16 -0
  498. package/dist/src/i18n/GC.js.map +1 -0
  499. package/dist/src/i18n/I.d.ts +3 -0
  500. package/dist/src/i18n/I.d.ts.map +1 -0
  501. package/dist/src/i18n/I.js +21 -0
  502. package/dist/src/i18n/I.js.map +1 -0
  503. package/dist/src/i18n/M.d.ts +3 -0
  504. package/dist/src/i18n/M.d.ts.map +1 -0
  505. package/dist/src/i18n/M.js +4 -0
  506. package/dist/src/i18n/M.js.map +1 -0
  507. package/dist/src/i18n/O_E.d.ts +3 -0
  508. package/dist/src/i18n/O_E.d.ts.map +1 -0
  509. package/dist/src/i18n/O_E.js +7 -0
  510. package/dist/src/i18n/O_E.js.map +1 -0
  511. package/dist/src/i18n/PA.d.ts +3 -0
  512. package/dist/src/i18n/PA.d.ts.map +1 -0
  513. package/dist/src/i18n/PA.js +16 -0
  514. package/dist/src/i18n/PA.js.map +1 -0
  515. package/dist/src/i18n/SA.d.ts +3 -0
  516. package/dist/src/i18n/SA.d.ts.map +1 -0
  517. package/dist/src/i18n/SA.js +16 -0
  518. package/dist/src/i18n/SA.js.map +1 -0
  519. package/dist/src/i18n/TC.d.ts +3 -0
  520. package/dist/src/i18n/TC.d.ts.map +1 -0
  521. package/dist/src/i18n/TC.js +16 -0
  522. package/dist/src/i18n/TC.js.map +1 -0
  523. package/dist/src/i18n/VA.d.ts +3 -0
  524. package/dist/src/i18n/VA.d.ts.map +1 -0
  525. package/dist/src/i18n/VA.js +16 -0
  526. package/dist/src/i18n/VA.js.map +1 -0
  527. package/dist/src/i18n/Z.d.ts +3 -0
  528. package/dist/src/i18n/Z.d.ts.map +1 -0
  529. package/dist/src/i18n/Z.js +22 -0
  530. package/dist/src/i18n/Z.js.map +1 -0
  531. package/dist/src/i18n/fi-FI.d.ts +192 -0
  532. package/dist/src/i18n/fi-FI.d.ts.map +1 -0
  533. package/dist/src/i18n/fi-FI.js +182 -0
  534. package/dist/src/i18n/fi-FI.js.map +1 -0
  535. package/dist/src/i18n/index.d.ts +20 -0
  536. package/dist/src/i18n/index.d.ts.map +1 -0
  537. package/dist/src/i18n/index.js +128 -0
  538. package/dist/src/i18n/index.js.map +1 -0
  539. package/dist/src/i18n/sv-FI.d.ts +3 -0
  540. package/dist/src/i18n/sv-FI.d.ts.map +1 -0
  541. package/dist/src/i18n/sv-FI.js +181 -0
  542. package/dist/src/i18n/sv-FI.js.map +1 -0
  543. package/dist/src/ids.d.ts +14 -0
  544. package/dist/src/ids.d.ts.map +1 -0
  545. package/dist/src/ids.js +28 -0
  546. package/dist/src/ids.js.map +1 -0
  547. package/dist/src/index.d.ts +19 -0
  548. package/dist/src/index.d.ts.map +1 -0
  549. package/dist/src/index.js +12 -0
  550. package/dist/src/index.js.map +1 -0
  551. package/dist/src/parser/parseExam.d.ts +2 -0
  552. package/dist/src/parser/parseExam.d.ts.map +1 -0
  553. package/dist/src/parser/parseExam.js +54 -0
  554. package/dist/src/parser/parseExam.js.map +1 -0
  555. package/dist/src/parser/parseExamStructure.d.ts +58 -0
  556. package/dist/src/parser/parseExamStructure.d.ts.map +1 -0
  557. package/dist/src/parser/parseExamStructure.js +40 -0
  558. package/dist/src/parser/parseExamStructure.js.map +1 -0
  559. package/dist/src/renderAnnotations.d.ts +7 -0
  560. package/dist/src/renderAnnotations.d.ts.map +1 -0
  561. package/dist/src/renderAnnotations.js +193 -0
  562. package/dist/src/renderAnnotations.js.map +1 -0
  563. package/dist/src/scrollToHash.d.ts +2 -0
  564. package/dist/src/scrollToHash.d.ts.map +1 -0
  565. package/dist/src/scrollToHash.js +24 -0
  566. package/dist/src/scrollToHash.js.map +1 -0
  567. package/dist/src/shortDisplayNumber.d.ts +2 -0
  568. package/dist/src/shortDisplayNumber.d.ts.map +1 -0
  569. package/dist/src/shortDisplayNumber.js +5 -0
  570. package/dist/src/shortDisplayNumber.js.map +1 -0
  571. package/dist/src/store/answers/actions.d.ts +33 -0
  572. package/dist/src/store/answers/actions.d.ts.map +1 -0
  573. package/dist/src/store/answers/actions.js +9 -0
  574. package/dist/src/store/answers/actions.js.map +1 -0
  575. package/dist/src/store/answers/reducer.d.ts +39 -0
  576. package/dist/src/store/answers/reducer.d.ts.map +1 -0
  577. package/dist/src/store/answers/reducer.js +55 -0
  578. package/dist/src/store/answers/reducer.js.map +1 -0
  579. package/dist/src/store/answers/sagas.d.ts +8 -0
  580. package/dist/src/store/answers/sagas.d.ts.map +1 -0
  581. package/dist/src/store/answers/sagas.js +60 -0
  582. package/dist/src/store/answers/sagas.js.map +1 -0
  583. package/dist/src/store/audio/actions.d.ts +29 -0
  584. package/dist/src/store/audio/actions.d.ts.map +1 -0
  585. package/dist/src/store/audio/actions.js +9 -0
  586. package/dist/src/store/audio/actions.js.map +1 -0
  587. package/dist/src/store/audio/reducer.d.ts +27 -0
  588. package/dist/src/store/audio/reducer.d.ts.map +1 -0
  589. package/dist/src/store/audio/reducer.js +55 -0
  590. package/dist/src/store/audio/reducer.js.map +1 -0
  591. package/dist/src/store/audio/sagas.d.ts +3 -0
  592. package/dist/src/store/audio/sagas.d.ts.map +1 -0
  593. package/dist/src/store/audio/sagas.js +68 -0
  594. package/dist/src/store/audio/sagas.js.map +1 -0
  595. package/dist/src/store/cas/actions.d.ts +19 -0
  596. package/dist/src/store/cas/actions.d.ts.map +1 -0
  597. package/dist/src/store/cas/actions.js +9 -0
  598. package/dist/src/store/cas/actions.js.map +1 -0
  599. package/dist/src/store/cas/reducer.d.ts +14 -0
  600. package/dist/src/store/cas/reducer.d.ts.map +1 -0
  601. package/dist/src/store/cas/reducer.js +24 -0
  602. package/dist/src/store/cas/reducer.js.map +1 -0
  603. package/dist/src/store/cas/sagas.d.ts +18 -0
  604. package/dist/src/store/cas/sagas.d.ts.map +1 -0
  605. package/dist/src/store/cas/sagas.js +36 -0
  606. package/dist/src/store/cas/sagas.js.map +1 -0
  607. package/dist/src/store/countdown.d.ts +4 -0
  608. package/dist/src/store/countdown.d.ts.map +1 -0
  609. package/dist/src/store/countdown.js +33 -0
  610. package/dist/src/store/countdown.js.map +1 -0
  611. package/dist/src/store/index.d.ts +78 -0
  612. package/dist/src/store/index.d.ts.map +1 -0
  613. package/dist/src/store/index.js +53 -0
  614. package/dist/src/store/index.js.map +1 -0
  615. package/dist/src/store/selectors.d.ts +9 -0
  616. package/dist/src/store/selectors.d.ts.map +1 -0
  617. package/dist/src/store/selectors.js +35 -0
  618. package/dist/src/store/selectors.js.map +1 -0
  619. package/dist/src/types/ExamAnswer.d.ts +22 -0
  620. package/dist/src/types/ExamAnswer.d.ts.map +1 -0
  621. package/dist/src/types/ExamAnswer.js +2 -0
  622. package/dist/src/types/ExamAnswer.js.map +1 -0
  623. package/dist/src/types/ExamServerAPI.d.ts +78 -0
  624. package/dist/src/types/ExamServerAPI.d.ts.map +1 -0
  625. package/dist/src/types/ExamServerAPI.js +2 -0
  626. package/dist/src/types/ExamServerAPI.js.map +1 -0
  627. package/dist/src/types/GradingStructure.d.ts +40 -0
  628. package/dist/src/types/GradingStructure.d.ts.map +1 -0
  629. package/dist/src/types/GradingStructure.js +2 -0
  630. package/dist/src/types/GradingStructure.js.map +1 -0
  631. package/dist/src/types/Score.d.ts +92 -0
  632. package/dist/src/types/Score.d.ts.map +1 -0
  633. package/dist/src/types/Score.js +2 -0
  634. package/dist/src/types/Score.js.map +1 -0
  635. package/dist/src/url.d.ts +7 -0
  636. package/dist/src/url.d.ts.map +1 -0
  637. package/dist/src/url.js +12 -0
  638. package/dist/src/url.js.map +1 -0
  639. package/dist/src/useCached.d.ts +3 -0
  640. package/dist/src/useCached.d.ts.map +1 -0
  641. package/dist/src/useCached.js +6 -0
  642. package/dist/src/useCached.js.map +1 -0
  643. package/dist/src/utils.d.ts +15 -0
  644. package/dist/src/utils.d.ts.map +1 -0
  645. package/dist/src/utils.js +35 -0
  646. package/dist/src/utils.js.map +1 -0
  647. package/dist/src/validateAnswers.d.ts +16 -0
  648. package/dist/src/validateAnswers.d.ts.map +1 -0
  649. package/dist/src/validateAnswers.js +89 -0
  650. package/dist/src/validateAnswers.js.map +1 -0
  651. package/dist/tsconfig.tsbuildinfo +1 -0
  652. package/package.json +3 -3
@@ -0,0 +1,12 @@
1
+ import '../src/css/main.less';
2
+ import Attachments from './components/attachments/Attachments';
3
+ import Exam from './components/exam/Exam';
4
+ import GradingInstructions from './components/grading-instructions/GradingInstructions';
5
+ import Results from './components/results/Results';
6
+ import parseExam from './parser/parseExam';
7
+ export { Attachments, Exam, GradingInstructions, Results, parseExam };
8
+ export * from './types/ExamAnswer';
9
+ export * from './types/ExamServerAPI';
10
+ export * from './types/GradingStructure';
11
+ export * from './types/Score';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,WAAW,MAAM,sCAAsC,CAAA;AAC9D,OAAO,IAAI,MAAM,wBAAwB,CAAA;AACzC,OAAO,mBAAmB,MAAM,uDAAuD,CAAA;AACvF,OAAO,OAAO,MAAM,8BAA8B,CAAA;AAClD,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,CAAA;AAErE,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ export default function parseExam(examXml: string, deterministicRendering?: boolean): XMLDocument;
2
+ //# sourceMappingURL=parseExam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseExam.d.ts","sourceRoot":"","sources":["../../../src/parser/parseExam.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,sBAAsB,UAAQ,GAAG,WAAW,CAkB9F"}
@@ -0,0 +1,54 @@
1
+ import * as _ from 'lodash-es';
2
+ import { findChildElement, getAttribute, queryAll } from '../dom-utils';
3
+ export default function parseExam(examXml, deterministicRendering = false) {
4
+ const doc = new DOMParser().parseFromString(examXml, 'application/xml');
5
+ if (!deterministicRendering) {
6
+ queryAll(doc.documentElement, ['choice-answer', 'dropdown-answer'])
7
+ .filter(e => getAttribute(e, 'ordering') !== 'fixed')
8
+ .forEach(randomizeOptions);
9
+ }
10
+ // The reference parts (e.g. author, title and so on) are displayed as inline
11
+ // elements. We also want to add separators between them. To avoid
12
+ // whitespace between an reference part and the separator, (e.g. `<span> foo
13
+ // </span>separator<span> bar </span>` is rendered as `foo separator bar` on
14
+ // the screen) trim the excess whitespace from the reference parts here.
15
+ queryAll(doc.documentElement, 'reference').forEach(reference => {
16
+ queryAll(reference, () => true, false).forEach(trimWhitespace);
17
+ });
18
+ return doc;
19
+ }
20
+ function randomizeOptions(elem) {
21
+ for (let i = elem.children.length; i > 0; i--) {
22
+ const j = Math.floor(Math.random() * i);
23
+ elem.appendChild(elem.children[j]);
24
+ }
25
+ // A no-answer option should always be the last
26
+ const noAnswerOption = findChildElement(elem, option => getAttribute(option, 'type') === 'no-answer');
27
+ if (noAnswerOption)
28
+ elem.appendChild(noAnswerOption);
29
+ }
30
+ function trimWhitespace(element) {
31
+ const nonWhitespaceNode = (node) => /\S/.test(node.textContent);
32
+ const getTextNodes = () => {
33
+ const result = [];
34
+ const treeWalker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT);
35
+ while (treeWalker.nextNode()) {
36
+ result.push(treeWalker.currentNode);
37
+ }
38
+ return result;
39
+ };
40
+ const textNodes = getTextNodes();
41
+ const firstNonWhitespaceTextNode = _.findIndex(textNodes, nonWhitespaceNode);
42
+ const lastNonWhitespaceTextNode = _.findLastIndex(textNodes, nonWhitespaceNode);
43
+ // Remove leading whitespace from the start
44
+ if (firstNonWhitespaceTextNode !== -1) {
45
+ textNodes.slice(0, firstNonWhitespaceTextNode).forEach(node => node.remove());
46
+ textNodes[firstNonWhitespaceTextNode].textContent = _.trimStart(textNodes[firstNonWhitespaceTextNode].textContent);
47
+ }
48
+ // ...and trailing whitespace from the end.
49
+ if (lastNonWhitespaceTextNode !== -1) {
50
+ textNodes.slice(lastNonWhitespaceTextNode + 1).forEach(node => node.remove());
51
+ textNodes[lastNonWhitespaceTextNode].textContent = _.trimEnd(textNodes[lastNonWhitespaceTextNode].textContent);
52
+ }
53
+ }
54
+ //# sourceMappingURL=parseExam.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseExam.js","sourceRoot":"","sources":["../../../src/parser/parseExam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvE,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAe,EAAE,sBAAsB,GAAG,KAAK;IAC/E,MAAM,GAAG,GAAG,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAA;IACvE,IAAI,CAAC,sBAAsB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AC,CAAC,WAAY,CAAC,CAAA;IACjH,CAAC;AACH,CAAC"}
@@ -0,0 +1,58 @@
1
+ export interface BaseElement {
2
+ name: string;
3
+ childNodes: ExamElement[];
4
+ }
5
+ export interface RootElement extends BaseElement {
6
+ name: 'exam';
7
+ attributes: {
8
+ maxAnswers?: number;
9
+ };
10
+ }
11
+ export interface SectionElement extends BaseElement {
12
+ name: 'section';
13
+ attributes: {
14
+ displayNumber: string;
15
+ maxAnswers?: number;
16
+ minAnswers?: number;
17
+ };
18
+ }
19
+ export interface QuestionElement extends BaseElement {
20
+ name: 'question';
21
+ attributes: {
22
+ displayNumber: string;
23
+ maxAnswers?: number;
24
+ };
25
+ }
26
+ export interface TextAnswerElement extends BaseElement {
27
+ name: 'text-answer';
28
+ attributes: {
29
+ displayNumber: string;
30
+ questionId: number;
31
+ maxLength?: number;
32
+ };
33
+ }
34
+ export interface ScoredTextAnswerElement extends BaseElement {
35
+ name: 'scored-text-answer';
36
+ attributes: {
37
+ displayNumber: string;
38
+ questionId: number;
39
+ };
40
+ }
41
+ export interface ChoiceAnswerElement extends BaseElement {
42
+ name: 'choice-answer';
43
+ attributes: {
44
+ displayNumber: string;
45
+ questionId: number;
46
+ };
47
+ }
48
+ export interface DropdownAnswerElement extends BaseElement {
49
+ name: 'dropdown-answer';
50
+ attributes: {
51
+ displayNumber: string;
52
+ questionId: number;
53
+ };
54
+ }
55
+ export type ExamElement = RootElement | SectionElement | QuestionElement | AnswerElement;
56
+ export type AnswerElement = TextAnswerElement | ScoredTextAnswerElement | ChoiceAnswerElement | DropdownAnswerElement;
57
+ export declare function parseExamStructure(doc: XMLDocument): RootElement;
58
+ //# sourceMappingURL=parseExamStructure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseExamStructure.d.ts","sourceRoot":"","sources":["../../../src/parser/parseExamStructure.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,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M,MAAM,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,eAAe,GAAG,aAAa,CAAA;AAExF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,uBAAuB,GAAG,mBAAmB,GAAG,qBAAqB,CAAA;AAErH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,CAIhE"}
@@ -0,0 +1,40 @@
1
+ import { getAttribute, getNumericAttribute, queryAll } from '../dom-utils';
2
+ export function parseExamStructure(doc) {
3
+ const root = doc.documentElement;
4
+ const sections = queryAll(root, 'section', false).map(parseSection);
5
+ return parseElement(root, sections, { maxAnswers: getNumericAttribute(root, 'max-answers') });
6
+ }
7
+ function parseSection(section) {
8
+ const questions = queryAll(section, 'question', false).map(parseQuestion);
9
+ return parseElement(section, questions, {
10
+ displayNumber: getAttribute(section, 'display-number'),
11
+ minAnswers: getNumericAttribute(section, 'min-answers'),
12
+ maxAnswers: getNumericAttribute(section, 'max-answers')
13
+ });
14
+ }
15
+ function parseQuestion(question) {
16
+ const childQuestions = queryAll(question, 'question', false);
17
+ const childElements = childQuestions.length
18
+ ? childQuestions.map(parseQuestion)
19
+ : queryAll(question, ['text-answer', 'scored-text-answer', 'choice-answer', 'dropdown-answer'], false).map(parseAnswer);
20
+ return parseElement(question, childElements, {
21
+ displayNumber: getAttribute(question, 'display-number'),
22
+ maxAnswers: getNumericAttribute(question, 'max-answers')
23
+ });
24
+ }
25
+ function parseAnswer(answer) {
26
+ const attributes = {
27
+ displayNumber: getAttribute(answer, 'display-number'),
28
+ questionId: getNumericAttribute(answer, 'question-id'),
29
+ maxLength: getNumericAttribute(answer, 'max-length')
30
+ };
31
+ return parseElement(answer, [], attributes);
32
+ }
33
+ function parseElement(element, childNodes, attributes) {
34
+ return {
35
+ name: element.localName,
36
+ attributes,
37
+ childNodes
38
+ };
39
+ }
40
+ //# sourceMappingURL=parseExamStructure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseExamStructure.js","sourceRoot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AAkB,QAAQ,EAAE,aAAa,EAAE;QAC5D,aAAa,EAAE,YAAY,CAAC,QAAQ,EAAE,gBAAgB,CAAE;QACxD,UAAU,EAAE,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC;KACzD,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,MAAe;IAClC,MAAM,UAAU,GAAG;QACjB,aAAa,EAAE,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAE;QACtD,UAAU,EAAE,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAE;QACvD,SAAS,EAAE,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC;KACrD,CAAA;IACD,OAAO,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;AAC7C,CAAC;AAED,SAAS,YAAY,CACnB,OAAgB,EAChB,UAAyB,EACzB,UAA2B;IAE3B,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,SAAS;QACvB,UAAU;QACV,UAAU;KACN,CAAA;AACR,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Annotation, ImageAnnotation, LineAnnotation, RectAnnotation } from './types/Score';
2
+ export declare function renderAnnotations(element: HTMLElement, pregradingAnnotations: Annotation[], censoringAnnotations: Annotation[], showTitle?: boolean): void;
3
+ export declare function updateImageAnnotationMarkSize(mark: HTMLElement, annotation: LineAnnotation | RectAnnotation): void;
4
+ export declare function wrapAllImages(answerElement: HTMLElement): void;
5
+ export declare function renderImageAnnotation(answerElement: HTMLElement, annotation: ImageAnnotation, type: 'pregrading' | 'censoring', listIndex: number, index: number | undefined, showTitle: boolean): HTMLElement;
6
+ export declare function renderImageAnnotationByImage(image: HTMLImageElement, title: string, annotation: ImageAnnotation, type: 'pregrading' | 'censoring', listIndex: number, index?: number): HTMLElement;
7
+ //# sourceMappingURL=renderAnnotations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAnnotations.d.ts","sourceRoot":"","sources":["../../src/renderAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAkB,MAAM,eAAe,CAAA;AAM3G,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EACpB,qBAAqB,EAAE,UAAU,EAAE,EACnC,oBAAoB,EAAE,UAAU,EAAE,EAClC,SAAS,UAAO,GACf,IAAI,CAiBN;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,GAAG,cAAc,GAAG,IAAI,CAclH;AAgBD,wBAAgB,aAAa,CAAC,aAAa,EAAE,WAAW,QAEvD;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,WAAW,EAC1B,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,YAAY,GAAG,WAAW,EAChC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,OAAO,GACjB,WAAW,CAKb;AACD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,YAAY,GAAG,WAAW,EAChC,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GACb,WAAW,CA6Bb"}
@@ -0,0 +1,193 @@
1
+ import { createElement } from './dom-utils';
2
+ import classNames from 'classnames';
3
+ const messageLengthThreshold = 5;
4
+ export function renderAnnotations(element, pregradingAnnotations, censoringAnnotations, showTitle = true) {
5
+ const annotations = [...pregradingAnnotations, ...censoringAnnotations];
6
+ const annotationsWithMessages = annotations.filter(a => a.message);
7
+ for (const [i, annotation] of annotations.entries()) {
8
+ const type = pregradingAnnotations.includes(annotation) ? 'pregrading' : 'censoring';
9
+ const index = annotationsWithMessages.indexOf(annotation) + 1 || undefined;
10
+ const listIndex = type === 'pregrading' ? i : i - pregradingAnnotations.length;
11
+ switch (annotation.type) {
12
+ case 'line':
13
+ case 'rect':
14
+ renderImageAnnotation(element, annotation, type, listIndex, index, showTitle);
15
+ break;
16
+ default:
17
+ renderTextAnnotation(element, annotation, type, listIndex, index, showTitle);
18
+ }
19
+ }
20
+ }
21
+ export function updateImageAnnotationMarkSize(mark, annotation) {
22
+ const style = mark.style;
23
+ const pct = (n) => `${n * 100}%`;
24
+ if (annotation.type === 'rect') {
25
+ style.left = pct(annotation.x);
26
+ style.top = pct(annotation.y);
27
+ style.right = pct(1 - (annotation.x + annotation.width));
28
+ style.bottom = pct(1 - (annotation.y + annotation.height));
29
+ }
30
+ else {
31
+ style.left = pct(annotation.x1);
32
+ style.top = pct(annotation.y1);
33
+ style.right = pct(1 - annotation.x2);
34
+ style.bottom = pct(1 - annotation.y2);
35
+ }
36
+ }
37
+ function getWrapper(image) {
38
+ const parent = image.parentElement;
39
+ if (parent instanceof HTMLSpanElement) {
40
+ return parent;
41
+ }
42
+ const wrapper = createElement('span', { className: 'e-annotation-wrapper' });
43
+ parent.insertBefore(wrapper, image);
44
+ wrapper.appendChild(image);
45
+ return wrapper;
46
+ }
47
+ export function wrapAllImages(answerElement) {
48
+ answerElement.querySelectorAll('img').forEach(getWrapper);
49
+ }
50
+ export function renderImageAnnotation(answerElement, annotation, type, listIndex, index, showTitle) {
51
+ const { attachmentIndex } = annotation;
52
+ const image = answerElement.querySelectorAll('img')[attachmentIndex];
53
+ const title = showTitle ? annotation.message : '';
54
+ return renderImageAnnotationByImage(image, title, annotation, type, listIndex, index);
55
+ }
56
+ export function renderImageAnnotationByImage(image, title, annotation, type, listIndex, index) {
57
+ const wrapper = getWrapper(image);
58
+ const shape = mkShape();
59
+ wrapper.appendChild(shape);
60
+ function mkShape() {
61
+ const mark = createElement('mark', {
62
+ ...{
63
+ className: classNames('e-annotation e-annotation--shape', {
64
+ 'e-annotation--pregrading': type === 'pregrading',
65
+ 'e-annotation--censoring': type === 'censoring'
66
+ }),
67
+ title,
68
+ 'data-list-index': String(listIndex),
69
+ 'data-type': type
70
+ },
71
+ ...(index && { 'data-index': String(index) }),
72
+ ...(annotation.message && { 'data-message': annotation.message })
73
+ });
74
+ updateImageAnnotationMarkSize(mark, annotation);
75
+ if (index) {
76
+ mark.appendChild(createSup(index, 'shape', annotation.message));
77
+ }
78
+ return mark;
79
+ }
80
+ return shape;
81
+ }
82
+ function renderTextAnnotation(rootElement, annotation, type, listIndex, index, showTitle) {
83
+ const { startIndex, length: annotationLength } = annotation;
84
+ return go(rootElement.childNodes[0], 0, annotationLength);
85
+ function go(
86
+ /* The current node in the answer HTML. */
87
+ node,
88
+ /** The current index corresponding to the node. */
89
+ currentIndex,
90
+ /* The remaining number of characters from the annotation to render. */
91
+ remaining) {
92
+ var _a;
93
+ if (!isMark(node) && !isSup(node) && !isBr(node) && currentIndex >= startIndex) {
94
+ // We found the correct spot to start an annotation. So let's create a mark element.
95
+ const mark = mkMark();
96
+ // Insert it before the node.
97
+ (_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(mark, node);
98
+ // Move the node and its next siblings inside the mark until the mark
99
+ // contains the required amount of content or we run out of sibling nodes.
100
+ // If the node is a Text node and it is too long for the annotation, we
101
+ // split it in two and move the first part inside the mark, leaving the
102
+ // rest in place.
103
+ const stillRemaining = move(mark, node, remaining);
104
+ // If we have run out of sibling nodes but still have characters to mark,
105
+ // create another mark at the next text node. This means that marks have
106
+ // been nested.
107
+ if (stillRemaining > 0) {
108
+ go(nextSibling(mark), currentIndex + annotationLength - stillRemaining, stillRemaining);
109
+ }
110
+ // We know that we're at the last mark of this annotation.
111
+ // Render the superscript index after it, if necessary.
112
+ else if (index) {
113
+ mark.appendChild(createSup(index, 'text', annotation.message));
114
+ }
115
+ }
116
+ else {
117
+ if (node instanceof Text && currentIndex + length(node) > startIndex) {
118
+ // The annotation should start in the middle of this text node. We need to split it in two.
119
+ node.splitText(startIndex - currentIndex);
120
+ }
121
+ go(next(node), currentIndex + length(node), remaining);
122
+ }
123
+ }
124
+ function isBr(node) {
125
+ return node.nodeName === 'BR';
126
+ }
127
+ function isMark(node) {
128
+ return node.nodeName === 'MARK';
129
+ }
130
+ function isSup(node) {
131
+ return node.nodeName === 'SUP';
132
+ }
133
+ function isImage(node) {
134
+ // If we've already added an image annotation to the image, it will be wrapped
135
+ // in a <span> element.
136
+ return node.nodeName === 'IMG' || node.nodeName === 'SPAN';
137
+ }
138
+ function next(node) {
139
+ return isMark(node) ? node.childNodes[0] : nextSibling(node);
140
+ }
141
+ function nextSibling(node) {
142
+ const sibling = node.nextSibling;
143
+ if (sibling) {
144
+ return sibling;
145
+ }
146
+ const parent = node.parentElement;
147
+ // If we encounter the root element, we've run out of text to annotate. This
148
+ // could be a bug in the annotation code or perhaps the annotations are invalid.
149
+ // To err on the side of caution, throw an exception in this case.
150
+ if (parent === null || parent === rootElement) {
151
+ throw new Error('Bug: the answer seems to be too short for the current set of annotations.');
152
+ }
153
+ return nextSibling(parent);
154
+ }
155
+ function length(node) {
156
+ return node instanceof Text ? node.length : isImage(node) ? 1 : 0;
157
+ }
158
+ function mkMark() {
159
+ return createElement('mark', {
160
+ ...{
161
+ className: classNames('e-annotation', {
162
+ 'e-annotation--pregrading': type === 'pregrading',
163
+ 'e-annotation--censoring': type === 'censoring'
164
+ }),
165
+ title: showTitle ? annotation.message : '',
166
+ 'data-list-index': String(listIndex),
167
+ 'data-type': type
168
+ },
169
+ ...(index && { 'data-index': String(index) }),
170
+ ...(annotation.message && { 'data-message': annotation.message })
171
+ });
172
+ }
173
+ function move(mark, node, remaining) {
174
+ if (!node || isMark(node) || remaining === 0) {
175
+ return remaining;
176
+ }
177
+ // Split text nodes if they are too long.
178
+ if (node instanceof Text && length(node) > 0 && length(node) > remaining) {
179
+ node.splitText(remaining);
180
+ }
181
+ const nextSibling = node.nextSibling;
182
+ mark.appendChild(node);
183
+ return move(mark, nextSibling, remaining - length(node));
184
+ }
185
+ }
186
+ function createSup(index, type, message) {
187
+ return createElement('sup', {
188
+ className: `e-annotation__index e-annotation__index--${type}`,
189
+ 'data-content': message.length > messageLengthThreshold ? `${index})` : message,
190
+ 'data-message': message
191
+ });
192
+ }
193
+ //# sourceMappingURL=renderAnnotations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAnnotations.js","sourceRoot":"","sources":["../../src/renderAnnotations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,MAAM,sBAAsB,GAAG,CAAC,CAAA;AAEhC,MAAM,UAAU,iBAAiB,CAC/B,OAAoB,EACpB,qBAAmC,EACnC,oBAAkC,EAClC,SAAS,GAAG,IAAI;IAEhB,MAAM,WAAW,GAAG,CAAC,GAAG,qBAAqB,EAAE,GAAG,oBAAoB,CAAC,CAAA;IACvE,MAAM,uBAAuB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAElE,KAAK,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAA;QACpF,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,SAAS,CAAA;QAC1E,MAAM,SAAS,GAAG,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAA;QAC9E,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;YACxB,KAAK,MAAM,CAAC;YACZ,KAAK,MAAM;gBACT,qBAAqB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAA;gBAC7E,MAAK;YACP;gBACE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declare function scrollToHash(): () => void;
2
+ //# sourceMappingURL=scrollToHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollToHash.d.ts","sourceRoot":"","sources":["../../src/scrollToHash.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,IAAI,MAAM,IAAI,CAYzC"}
@@ -0,0 +1,24 @@
1
+ export function scrollToHash() {
2
+ const maybeId = decodeURIComponent(window.location.hash).slice(1);
3
+ if (maybeId) {
4
+ const maybeElement = document.getElementById(maybeId);
5
+ if (maybeElement) {
6
+ focusElement(maybeElement);
7
+ }
8
+ }
9
+ window.addEventListener('hashchange', scrollToHash);
10
+ return () => window.removeEventListener('hashchange', scrollToHash);
11
+ }
12
+ function focusElement(element) {
13
+ // Make the element temporarily focusable for screen readers.
14
+ element.setAttribute('tabindex', '-1');
15
+ // We don't want to show an outline for our sighted users.
16
+ element.style.outline = 'none';
17
+ element.addEventListener('blur', () => {
18
+ element.removeAttribute('tabindex');
19
+ element.style.outline = '';
20
+ }, { once: true });
21
+ element.focus();
22
+ element.scrollIntoView();
23
+ }
24
+ //# sourceMappingURL=scrollToHash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollToHash.js","sourceRoot":"","sources":["../../src/scrollToHash.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAEjE,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;QACrD,IAAI,YAAY,EAAE,CAAC;YACjB,YAAY,CAAC,YAAY,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;IACnD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,OAAoB;IACxC,6DAA6D;IAC7D,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IACtC,0DAA0D;IAC1D,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAA;IAE9B,OAAO,CAAC,gBAAgB,CACtB,MAAM,EACN,GAAG,EAAE;QACH,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAA;QACnC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAA;IAC5B,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAA;IAED,OAAO,CAAC,KAAK,EAAE,CAAA;IACf,OAAO,CAAC,cAAc,EAAE,CAAA;AAC1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function shortDisplayNumber(displayName: string): string;
2
+ //# sourceMappingURL=shortDisplayNumber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortDisplayNumber.d.ts","sourceRoot":"","sources":["../../src/shortDisplayNumber.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,5 @@
1
+ import * as _ from 'lodash-es';
2
+ export function shortDisplayNumber(displayName) {
3
+ return `${_.last(displayName.split('.'))}.`;
4
+ }
5
+ //# sourceMappingURL=shortDisplayNumber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortDisplayNumber.js","sourceRoot":"","sources":["../../src/shortDisplayNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAE9B,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAE,GAAG,CAAA;AAC9C,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { ExamAnswer, QuestionId } from '../..';
2
+ export declare const saveAnswer: (answer: ExamAnswer) => {
3
+ type: "SAVE_ANSWER";
4
+ payload: ExamAnswer;
5
+ };
6
+ export declare const saveAnswerSucceeded: (answer: ExamAnswer) => {
7
+ type: "SAVE_ANSWER_SUCCEEDED";
8
+ payload: ExamAnswer;
9
+ };
10
+ export declare const saveAnswerFailed: (answer: ExamAnswer, error: unknown) => {
11
+ type: "SAVE_ANSWER_FAILED";
12
+ payload: {
13
+ answer: ExamAnswer;
14
+ error: unknown;
15
+ };
16
+ error: boolean;
17
+ };
18
+ export declare const selectAnswerVersion: (questionId: QuestionId, questionText: string) => {
19
+ type: "SELECT_ANSWER_VERSION";
20
+ payload: {
21
+ questionId: number;
22
+ questionText: string;
23
+ };
24
+ };
25
+ export declare const answerFocused: (questionId: QuestionId) => {
26
+ type: "ANSWER_FOCUSED";
27
+ payload: number;
28
+ };
29
+ export declare const answerBlurred: (questionId: QuestionId) => {
30
+ type: "ANSWER_BLURRED";
31
+ payload: number;
32
+ };
33
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/store/answers/actions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAE9C,eAAO,MAAM,UAAU,WAAY,UAAU;;;CAAkC,CAAA;AAE/E,eAAO,MAAM,mBAAmB,WAAY,UAAU;;;CAA4C,CAAA;AAElG,eAAO,MAAM,gBAAgB,WAAY,UAAU,SAAS,OAAO;;;;;;;CACD,CAAA;AAElE,eAAO,MAAM,mBAAmB,eAAgB,UAAU,gBAAgB,MAAM;;;;;;CACjB,CAAA;AAE/D,eAAO,MAAM,aAAa,eAAgB,UAAU;;;CAAyC,CAAA;AAE7F,eAAO,MAAM,aAAa,eAAgB,UAAU;;;CAAyC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
+ import { action } from 'typesafe-actions';
3
+ export const saveAnswer = (answer) => action('SAVE_ANSWER', answer);
4
+ export const saveAnswerSucceeded = (answer) => action('SAVE_ANSWER_SUCCEEDED', answer);
5
+ export const saveAnswerFailed = (answer, error) => action('SAVE_ANSWER_FAILED', { answer, error }, undefined, true);
6
+ export const selectAnswerVersion = (questionId, questionText) => action('SELECT_ANSWER_VERSION', { questionId, questionText });
7
+ export const answerFocused = (questionId) => action('ANSWER_FOCUSED', questionId);
8
+ export const answerBlurred = (questionId) => action('ANSWER_BLURRED', questionId);
9
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../../src/store/answers/actions.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGzC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAkB,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAE,EAAE,CAAC,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAA;AAElG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAkB,EAAE,KAAc,EAAE,EAAE,CACrE,MAAM,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;AAElE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAsB,EAAE,YAAoB,EAAE,EAAE,CAClF,MAAM,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;AAE/D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;AAE7F,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA"}
@@ -0,0 +1,39 @@
1
+ import { ActionType } from 'typesafe-actions';
2
+ import * as actions from './actions';
3
+ import { ExamAnswer, QuestionId } from '../..';
4
+ import { ValidationError } from '../../validateAnswers';
5
+ import { RootElement } from '../../parser/parseExamStructure';
6
+ type AnswersAction = ActionType<typeof actions>;
7
+ export interface AnswersState {
8
+ answersById: Record<QuestionId, ExamAnswer>;
9
+ /** The (text) answer that is focused right now. Used for e.g. highlighting the correct hint in scored text answers. */
10
+ focusedQuestionId: QuestionId | null;
11
+ /**
12
+ * The set of answers that (to the best of our knowledge) have been
13
+ * successfully saved to the server. That is, the questions that we
14
+ * show the "Tallennettu" indicator for.
15
+ */
16
+ savedQuestionIds: Set<QuestionId>;
17
+ /**
18
+ * The set of questions that have been saved to the server at some point. Or
19
+ * in short, the set of questions that we show the answer history link for.
20
+ */
21
+ serverQuestionIds: Set<QuestionId>;
22
+ /**
23
+ * Whether or not the Exam API has implemented the optional answer history
24
+ * feature. For now, only the real ktp has implemented it. it.
25
+ */
26
+ supportsAnswerHistory: boolean;
27
+ /**
28
+ * The simplified structure of the exam (only sections, questions and answers)
29
+ * that we use for validation purposes.
30
+ */
31
+ examStructure: RootElement;
32
+ /**
33
+ * An array of warning messages about answers that the user has input.
34
+ */
35
+ validationErrors: ValidationError[];
36
+ }
37
+ export default function answersReducer(state: AnswersState | undefined, action: AnswersAction): AnswersState;
38
+ export {};
39
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../src/store/answers/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAmB,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAE7D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAA;AAE/C,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IAC3C,uHAAuH;IACvH,iBAAiB,EAAE,UAAU,GAAG,IAAI,CAAA;IACpC;;;;OAIG;IACH,gBAAgB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;IACjC;;;OAGG;IACH,iBAAiB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;IAClC;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,aAAa,EAAE,WAAW,CAAA;IAC1B;;OAEG;IACH,gBAAgB,EAAE,eAAe,EAAE,CAAA;CACpC;AAgBD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,YAAY,YAAe,EAAE,MAAM,EAAE,aAAa,GAAG,YAAY,CA6B9G"}
@@ -0,0 +1,55 @@
1
+ import { validateAnswers } from '../../validateAnswers';
2
+ const initialState = {
3
+ answersById: {},
4
+ examStructure: {
5
+ name: 'exam',
6
+ attributes: {},
7
+ childNodes: []
8
+ },
9
+ focusedQuestionId: null,
10
+ supportsAnswerHistory: false,
11
+ serverQuestionIds: new Set(),
12
+ savedQuestionIds: new Set(),
13
+ validationErrors: []
14
+ };
15
+ export default function answersReducer(state = initialState, action) {
16
+ switch (action.type) {
17
+ case 'SAVE_ANSWER': {
18
+ const { questionId } = action.payload;
19
+ const synchronizedQuestionIds = setDelete(state.savedQuestionIds, questionId);
20
+ const answersById = { ...state.answersById, [questionId]: action.payload };
21
+ return { ...state, savedQuestionIds: synchronizedQuestionIds, answersById };
22
+ }
23
+ case 'SAVE_ANSWER_FAILED': {
24
+ return state;
25
+ }
26
+ case 'SAVE_ANSWER_SUCCEEDED': {
27
+ const { questionId } = action.payload;
28
+ const savedQuestionIds = setAdd(state.savedQuestionIds, questionId);
29
+ const serverQuestionIds = setAdd(state.serverQuestionIds, questionId);
30
+ const validationErrors = validateAnswers(state.examStructure, state.answersById);
31
+ return { ...state, serverQuestionIds, savedQuestionIds, validationErrors };
32
+ }
33
+ case 'ANSWER_FOCUSED': {
34
+ const questionId = action.payload;
35
+ return { ...state, focusedQuestionId: questionId };
36
+ }
37
+ case 'ANSWER_BLURRED': {
38
+ const questionId = action.payload;
39
+ return { ...state, focusedQuestionId: state.focusedQuestionId === questionId ? null : state.focusedQuestionId };
40
+ }
41
+ default:
42
+ return state;
43
+ }
44
+ }
45
+ function setAdd(set, value) {
46
+ const copy = new Set(set);
47
+ copy.add(value);
48
+ return copy;
49
+ }
50
+ function setDelete(set, value) {
51
+ const copy = new Set(set);
52
+ copy.delete(value);
53
+ return copy;
54
+ }
55
+ //# sourceMappingURL=reducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../../src/store/answers/reducer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAmB,MAAM,uBAAuB,CAAA;AAoCxE,MAAM,YAAY,GAAiB;IACjC,WAAW,EAAE,EAAE;IACf,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;KACf;IACD,iBAAiB,EAAE,IAAI;IACvB,qBAAqB,EAAE,KAAK;IAC5B,iBAAiB,EAAE,IAAI,GAAG,EAAE;IAC5B,gBAAgB,EAAE,IAAI,GAAG,EAAE;IAC3B,gBAAgB,EAAE,EAAE;CACrB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,QAAsB,YAAY,EAAE,MAAqB;IAC9F,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,aAAa,CAAC,CAAC,CAAC;Y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