@digabi/exam-engine-core 24.0.0 → 25.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AnswerToolbar.js +22 -17
- package/dist/components/AnswerToolbar.js.map +1 -1
- package/dist/components/AnsweringInstructions.js +44 -6
- package/dist/components/AnsweringInstructions.js.map +1 -1
- package/dist/components/DocumentTitle.js +40 -5
- package/dist/components/DocumentTitle.js.map +1 -1
- package/dist/components/NotificationIcon.js +10 -5
- package/dist/components/NotificationIcon.js.map +1 -1
- package/dist/components/RenderChildNodes.js +8 -3
- package/dist/components/RenderChildNodes.js.map +1 -1
- package/dist/components/RenderExamElements.js +8 -3
- package/dist/components/RenderExamElements.js.map +1 -1
- package/dist/components/RenderIf.js +10 -3
- package/dist/components/RenderIf.js.map +1 -1
- package/dist/components/ScreenReaderOnly.js +9 -2
- package/dist/components/ScreenReaderOnly.js.map +1 -1
- package/dist/components/SectionElement.js +10 -5
- package/dist/components/SectionElement.js.map +1 -1
- package/dist/components/attachments/Attachment.js +40 -5
- package/dist/components/attachments/Attachment.js.map +1 -1
- package/dist/components/attachments/AttachmentTitle.js +42 -7
- package/dist/components/attachments/AttachmentTitle.js.map +1 -1
- package/dist/components/attachments/Attachments.js +87 -47
- package/dist/components/attachments/Attachments.js.map +1 -1
- package/dist/components/attachments/ExternalMaterial.js +77 -39
- package/dist/components/attachments/ExternalMaterial.js.map +1 -1
- package/dist/components/attachments/Question.js +47 -9
- package/dist/components/attachments/Question.js.map +1 -1
- package/dist/components/attachments/QuestionTitle.js +45 -10
- package/dist/components/attachments/QuestionTitle.js.map +1 -1
- package/dist/components/context/AnnotationProvider.js +10 -4
- package/dist/components/context/AnnotationProvider.js.map +1 -1
- package/dist/components/context/AttachmentContext.js +12 -6
- package/dist/components/context/AttachmentContext.js.map +1 -1
- package/dist/components/context/AudioRecorderContext.js +41 -5
- package/dist/components/context/AudioRecorderContext.js.map +1 -1
- package/dist/components/context/CommonExamContext.js +22 -15
- package/dist/components/context/CommonExamContext.js.map +1 -1
- package/dist/components/context/ExamContext.js +10 -4
- package/dist/components/context/ExamContext.js.map +1 -1
- package/dist/components/context/GradingInstructionContext.js +8 -2
- package/dist/components/context/GradingInstructionContext.js.map +1 -1
- package/dist/components/context/IsInSidebarContext.js +5 -2
- package/dist/components/context/IsInSidebarContext.js.map +1 -1
- package/dist/components/context/QuestionContext.js +21 -15
- package/dist/components/context/QuestionContext.js.map +1 -1
- package/dist/components/context/ResultsContext.js +57 -14
- package/dist/components/context/ResultsContext.js.map +1 -1
- package/dist/components/context/SectionContext.js +16 -10
- package/dist/components/context/SectionContext.js.map +1 -1
- package/dist/components/context/TOCContext.js +5 -2
- package/dist/components/context/TOCContext.js.map +1 -1
- package/dist/components/context/withContext.js +13 -6
- package/dist/components/context/withContext.js.map +1 -1
- package/dist/components/exam/Attachment.js +40 -5
- package/dist/components/exam/Attachment.js.map +1 -1
- package/dist/components/exam/AudioAnswer.js +51 -16
- package/dist/components/exam/AudioAnswer.js.map +1 -1
- package/dist/components/exam/ChoiceAnswer.js +63 -25
- package/dist/components/exam/ChoiceAnswer.js.map +1 -1
- package/dist/components/exam/DNDAllOptions.js +19 -12
- package/dist/components/exam/DNDAllOptions.js.map +1 -1
- package/dist/components/exam/DNDAnswerContainer.js +67 -30
- package/dist/components/exam/DNDAnswerContainer.js.map +1 -1
- package/dist/components/exam/DNDAnswerOptionDraggable.js +20 -13
- package/dist/components/exam/DNDAnswerOptionDraggable.js.map +1 -1
- package/dist/components/exam/DropdownAnswer.js +85 -47
- package/dist/components/exam/DropdownAnswer.js.map +1 -1
- package/dist/components/exam/Exam.js +184 -145
- package/dist/components/exam/Exam.js.map +1 -1
- package/dist/components/exam/ExamFooter.js +8 -3
- package/dist/components/exam/ExamFooter.js.map +1 -1
- package/dist/components/exam/ExamInstruction.js +8 -3
- package/dist/components/exam/ExamInstruction.js.map +1 -1
- package/dist/components/exam/ExternalMaterial.js +57 -22
- package/dist/components/exam/ExternalMaterial.js.map +1 -1
- package/dist/components/exam/GoToExamineAnswersButton.js +42 -7
- package/dist/components/exam/GoToExamineAnswersButton.js.map +1 -1
- package/dist/components/exam/Hints.js +21 -16
- package/dist/components/exam/Hints.js.map +1 -1
- package/dist/components/exam/Question.js +76 -37
- package/dist/components/exam/Question.js.map +1 -1
- package/dist/components/exam/QuestionInstruction.js +10 -5
- package/dist/components/exam/QuestionInstruction.js.map +1 -1
- package/dist/components/exam/QuestionTitle.js +57 -19
- package/dist/components/exam/QuestionTitle.js.map +1 -1
- package/dist/components/exam/RichTextAnswer.js +23 -18
- package/dist/components/exam/RichTextAnswer.js.map +1 -1
- package/dist/components/exam/Section.js +76 -38
- package/dist/components/exam/Section.js.map +1 -1
- package/dist/components/exam/SectionInstruction.js +8 -3
- package/dist/components/exam/SectionInstruction.js.map +1 -1
- package/dist/components/exam/SectionTitle.js +58 -20
- package/dist/components/exam/SectionTitle.js.map +1 -1
- package/dist/components/exam/StudentNameHeader.js +9 -2
- package/dist/components/exam/StudentNameHeader.js.map +1 -1
- package/dist/components/exam/TextAnswer.js +19 -14
- package/dist/components/exam/TextAnswer.js.map +1 -1
- package/dist/components/exam/UndoHistoryEntry.js +21 -14
- package/dist/components/exam/UndoHistoryEntry.js.map +1 -1
- package/dist/components/exam/UndoView.d.ts +0 -1
- package/dist/components/exam/UndoView.d.ts.map +1 -1
- package/dist/components/exam/UndoView.js +45 -69
- package/dist/components/exam/UndoView.js.map +1 -1
- package/dist/components/exam/internal/AudioRecorder.js +78 -39
- package/dist/components/exam/internal/AudioRecorder.js.map +1 -1
- package/dist/components/exam/internal/ErrorIndicator.js +71 -32
- package/dist/components/exam/internal/ErrorIndicator.js.map +1 -1
- package/dist/components/exam/internal/ProgressBar.js +46 -8
- package/dist/components/exam/internal/ProgressBar.js.map +1 -1
- package/dist/components/exam/internal/SaveIndicator.js +16 -11
- package/dist/components/exam/internal/SaveIndicator.js.map +1 -1
- package/dist/components/exam/internal/TextAnswerInput.js +97 -58
- package/dist/components/exam/internal/TextAnswerInput.js.map +1 -1
- package/dist/components/exam/multipleContainersKeyboardCoordinates.js +13 -9
- package/dist/components/exam/multipleContainersKeyboardCoordinates.js.map +1 -1
- package/dist/components/grading/AnswerCharacterCounter.js +12 -6
- package/dist/components/grading/AnswerCharacterCounter.js.map +1 -1
- package/dist/components/grading/GradingAnswer.js +112 -73
- package/dist/components/grading/GradingAnswer.js.map +1 -1
- package/dist/components/grading/GradingAnswerAnnotationList.js +9 -4
- package/dist/components/grading/GradingAnswerAnnotationList.js.map +1 -1
- package/dist/components/grading/editAnnotations.js +66 -16
- package/dist/components/grading/editAnnotations.js.map +1 -1
- package/dist/components/grading/largeImageDetector.js +6 -2
- package/dist/components/grading/largeImageDetector.js.map +1 -1
- package/dist/components/grading-instructions/AnswerGradingInstruction.js +42 -7
- package/dist/components/grading-instructions/AnswerGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/AutogradedAnswer.js +59 -21
- package/dist/components/grading-instructions/AutogradedAnswer.js.map +1 -1
- package/dist/components/grading-instructions/AutogradedAnswerOption.js +13 -8
- package/dist/components/grading-instructions/AutogradedAnswerOption.js.map +1 -1
- package/dist/components/grading-instructions/ExamGradingInstruction.js +8 -3
- package/dist/components/grading-instructions/ExamGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/GradingInstructionProvider.js +10 -3
- package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.js +132 -92
- package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
- package/dist/components/grading-instructions/Question.js +45 -7
- package/dist/components/grading-instructions/Question.js.map +1 -1
- package/dist/components/grading-instructions/QuestionTitle.js +50 -12
- package/dist/components/grading-instructions/QuestionTitle.js.map +1 -1
- package/dist/components/grading-instructions/Recording.js +20 -13
- package/dist/components/grading-instructions/Recording.js.map +1 -1
- package/dist/components/grading-instructions/RenderAttachmentElements.js +11 -6
- package/dist/components/grading-instructions/RenderAttachmentElements.js.map +1 -1
- package/dist/components/grading-instructions/Section.js +45 -7
- package/dist/components/grading-instructions/Section.js.map +1 -1
- package/dist/components/grading-instructions/SectionTitle.js +45 -10
- package/dist/components/grading-instructions/SectionTitle.js.map +1 -1
- package/dist/components/grading-instructions/gradingInstructionContent.js +4 -1
- package/dist/components/grading-instructions/gradingInstructionContent.js.map +1 -1
- package/dist/components/results/AudioAnswer.js +62 -24
- package/dist/components/results/AudioAnswer.js.map +1 -1
- package/dist/components/results/AudioContainer.js +27 -20
- package/dist/components/results/AudioContainer.js.map +1 -1
- package/dist/components/results/ChoiceAnswer.js +67 -29
- package/dist/components/results/ChoiceAnswer.js.map +1 -1
- package/dist/components/results/CorrectDNDAnswers.js +48 -11
- package/dist/components/results/CorrectDNDAnswers.js.map +1 -1
- package/dist/components/results/DNDAnswerOption.js +13 -6
- package/dist/components/results/DNDAnswerOption.js.map +1 -1
- package/dist/components/results/DropdownAnswer.js +68 -30
- package/dist/components/results/DropdownAnswer.js.map +1 -1
- package/dist/components/results/EndExamSession.js +22 -15
- package/dist/components/results/EndExamSession.js.map +1 -1
- package/dist/components/results/MultiLineAnswer.js +60 -20
- package/dist/components/results/MultiLineAnswer.js.map +1 -1
- package/dist/components/results/Question.js +53 -15
- package/dist/components/results/Question.js.map +1 -1
- package/dist/components/results/QuestionTitle.js +57 -19
- package/dist/components/results/QuestionTitle.js.map +1 -1
- package/dist/components/results/Results.js +144 -106
- package/dist/components/results/Results.js.map +1 -1
- package/dist/components/results/ScoredTextAnswer.js +54 -16
- package/dist/components/results/ScoredTextAnswer.js.map +1 -1
- package/dist/components/results/Section.js +46 -8
- package/dist/components/results/Section.js.map +1 -1
- package/dist/components/results/SingleLineAnswer.js +54 -16
- package/dist/components/results/SingleLineAnswer.js.map +1 -1
- package/dist/components/results/TextAnswer.js +68 -30
- package/dist/components/results/TextAnswer.js.map +1 -1
- package/dist/components/results/internal/AnnotationList.js +51 -16
- package/dist/components/results/internal/AnnotationList.js.map +1 -1
- package/dist/components/results/internal/QuestionAutoScore.js +47 -9
- package/dist/components/results/internal/QuestionAutoScore.js.map +1 -1
- package/dist/components/results/internal/QuestionManualScore.js +61 -23
- package/dist/components/results/internal/QuestionManualScore.js.map +1 -1
- package/dist/components/results/internal/QuestionScoresContainer.js +53 -15
- package/dist/components/results/internal/QuestionScoresContainer.js.map +1 -1
- package/dist/components/results/isExamineExamPageHook.js +8 -4
- package/dist/components/results/isExamineExamPageHook.js.map +1 -1
- package/dist/components/shared/AnnotationLists.js +19 -13
- package/dist/components/shared/AnnotationLists.js.map +1 -1
- package/dist/components/shared/AnswerIndicator.js +51 -12
- package/dist/components/shared/AnswerIndicator.js.map +1 -1
- package/dist/components/shared/AnswerLengthInfo.js +13 -8
- package/dist/components/shared/AnswerLengthInfo.js.map +1 -1
- package/dist/components/shared/AttachmentLink.js +53 -15
- package/dist/components/shared/AttachmentLink.js.map +1 -1
- package/dist/components/shared/AttachmentLinks.js +53 -15
- package/dist/components/shared/AttachmentLinks.js.map +1 -1
- package/dist/components/shared/Audio.js +63 -25
- package/dist/components/shared/Audio.js.map +1 -1
- package/dist/components/shared/AudioGroup.js +10 -5
- package/dist/components/shared/AudioGroup.js.map +1 -1
- package/dist/components/shared/AudioTest.js +67 -29
- package/dist/components/shared/AudioTest.js.map +1 -1
- package/dist/components/shared/DNDAnswerContainer.js +52 -15
- package/dist/components/shared/DNDAnswerContainer.js.map +1 -1
- package/dist/components/shared/DNDDroppable.js +23 -16
- package/dist/components/shared/DNDDroppable.js.map +1 -1
- package/dist/components/shared/DNDTitleAndDroppable.js +68 -28
- package/dist/components/shared/DNDTitleAndDroppable.js.map +1 -1
- package/dist/components/shared/ExamTranslation.js +10 -5
- package/dist/components/shared/ExamTranslation.js.map +1 -1
- package/dist/components/shared/File.js +44 -6
- package/dist/components/shared/File.js.map +1 -1
- package/dist/components/shared/Footer.js +9 -2
- package/dist/components/shared/Footer.js.map +1 -1
- package/dist/components/shared/Formula.js +15 -10
- package/dist/components/shared/Formula.js.map +1 -1
- package/dist/components/shared/Image.js +64 -25
- package/dist/components/shared/Image.js.map +1 -1
- package/dist/components/shared/ImageOverlay.js +65 -27
- package/dist/components/shared/ImageOverlay.js.map +1 -1
- package/dist/components/shared/Popup.js +63 -23
- package/dist/components/shared/Popup.js.map +1 -1
- package/dist/components/shared/QuestionNumber.js +42 -6
- package/dist/components/shared/QuestionNumber.js.map +1 -1
- package/dist/components/shared/Reference.js +70 -32
- package/dist/components/shared/Reference.js.map +1 -1
- package/dist/components/shared/References.js +60 -22
- package/dist/components/shared/References.js.map +1 -1
- package/dist/components/shared/Score.js +13 -6
- package/dist/components/shared/Score.js.map +1 -1
- package/dist/components/shared/TOCQuestion.js +73 -33
- package/dist/components/shared/TOCQuestion.js.map +1 -1
- package/dist/components/shared/TOCSection.js +48 -11
- package/dist/components/shared/TOCSection.js.map +1 -1
- package/dist/components/shared/TOCSectionTitle.js +65 -25
- package/dist/components/shared/TOCSectionTitle.js.map +1 -1
- package/dist/components/shared/TableOfContents.js +77 -37
- package/dist/components/shared/TableOfContents.js.map +1 -1
- package/dist/components/shared/VersionNumber.js +46 -6
- package/dist/components/shared/VersionNumber.js.map +1 -1
- package/dist/components/shared/Video.js +55 -17
- package/dist/components/shared/Video.js.map +1 -1
- package/dist/components/shared/internal/AttachmentLinkAnchor.js +8 -3
- package/dist/components/shared/internal/AttachmentLinkAnchor.js.map +1 -1
- package/dist/components/shared/internal/AudioPlayer.js +58 -23
- package/dist/components/shared/internal/AudioPlayer.js.map +1 -1
- package/dist/components/shared/internal/ModalDialog.js +40 -5
- package/dist/components/shared/internal/ModalDialog.js.map +1 -1
- package/dist/components/shared/internal/RenderIfNoError.js +15 -10
- package/dist/components/shared/internal/RenderIfNoError.js.map +1 -1
- package/dist/components/shared/internal/ResponsiveMediaContainer.js +11 -6
- package/dist/components/shared/internal/ResponsiveMediaContainer.js.map +1 -1
- package/dist/components/shared/internal/RestrictedAudioPlayer.js +64 -25
- package/dist/components/shared/internal/RestrictedAudioPlayer.js.map +1 -1
- package/dist/createRenderChildNodes.js +19 -12
- package/dist/createRenderChildNodes.js.map +1 -1
- package/dist/dom-utils.js +89 -32
- package/dist/dom-utils.js.map +1 -1
- package/dist/fonts.js +15 -9
- package/dist/fonts.js.map +1 -1
- package/dist/formatting.js +4 -1
- package/dist/formatting.js.map +1 -1
- package/dist/getDisplayName.js +4 -1
- package/dist/getDisplayName.js.map +1 -1
- package/dist/i18n/A_E.js +4 -1
- package/dist/i18n/A_E.js.map +1 -1
- package/dist/i18n/BA.js +39 -3
- package/dist/i18n/BA.js.map +1 -1
- package/dist/i18n/CA.js +39 -3
- package/dist/i18n/CA.js.map +1 -1
- package/dist/i18n/EA.js +4 -1
- package/dist/i18n/EA.js.map +1 -1
- package/dist/i18n/FA.js +4 -1
- package/dist/i18n/FA.js.map +1 -1
- package/dist/i18n/GC.js +4 -1
- package/dist/i18n/GC.js.map +1 -1
- package/dist/i18n/I.js +4 -1
- package/dist/i18n/I.js.map +1 -1
- package/dist/i18n/M.js +4 -1
- package/dist/i18n/M.js.map +1 -1
- package/dist/i18n/O_E.js +4 -1
- package/dist/i18n/O_E.js.map +1 -1
- package/dist/i18n/PA.js +4 -1
- package/dist/i18n/PA.js.map +1 -1
- package/dist/i18n/SA.js +4 -1
- package/dist/i18n/SA.js.map +1 -1
- package/dist/i18n/TC.js +4 -1
- package/dist/i18n/TC.js.map +1 -1
- package/dist/i18n/VA.js +4 -1
- package/dist/i18n/VA.js.map +1 -1
- package/dist/i18n/Z.js +4 -1
- package/dist/i18n/Z.js.map +1 -1
- package/dist/i18n/fi-FI.js +4 -1
- package/dist/i18n/fi-FI.js.map +1 -1
- package/dist/i18n/index.js +93 -51
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/sv-FI.js +4 -1
- package/dist/i18n/sv-FI.js.map +1 -1
- package/dist/ids.js +16 -13
- package/dist/ids.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -14
- package/dist/index.js.map +1 -1
- package/dist/indexedDBExamServerAPI.d.ts.map +1 -1
- package/dist/indexedDBExamServerAPI.js +14 -4
- package/dist/indexedDBExamServerAPI.js.map +1 -1
- package/dist/main.css +4486 -1
- package/dist/parser/parseExam.js +44 -8
- package/dist/parser/parseExam.js.map +1 -1
- package/dist/parser/parseExamStructure.js +18 -15
- package/dist/parser/parseExamStructure.js.map +1 -1
- package/dist/renderAnnotations.js +21 -12
- package/dist/renderAnnotations.js.map +1 -1
- package/dist/scrollToHash.js +4 -1
- package/dist/scrollToHash.js.map +1 -1
- package/dist/shortDisplayNumber.js +38 -2
- package/dist/shortDisplayNumber.js.map +1 -1
- package/dist/store/answers/actions.js +16 -7
- package/dist/store/answers/actions.js.map +1 -1
- package/dist/store/answers/reducer.js +6 -3
- package/dist/store/answers/reducer.js.map +1 -1
- package/dist/store/answers/sagas.js +22 -18
- package/dist/store/answers/sagas.js.map +1 -1
- package/dist/store/audio/actions.js +16 -7
- package/dist/store/audio/actions.js.map +1 -1
- package/dist/store/audio/reducer.js +38 -2
- package/dist/store/audio/reducer.js.map +1 -1
- package/dist/store/audio/sagas.js +18 -15
- package/dist/store/audio/sagas.js.map +1 -1
- package/dist/store/cas/actions.js +13 -7
- package/dist/store/cas/actions.js.map +1 -1
- package/dist/store/cas/reducer.js +4 -1
- package/dist/store/cas/reducer.js.map +1 -1
- package/dist/store/cas/sagas.js +19 -15
- package/dist/store/cas/sagas.js.map +1 -1
- package/dist/store/countdown.js +12 -9
- package/dist/store/countdown.js.map +1 -1
- package/dist/store/index.js +63 -24
- package/dist/store/index.js.map +1 -1
- package/dist/store/selectors.js +53 -9
- package/dist/store/selectors.js.map +1 -1
- package/dist/types/ExamAnswer.js +2 -1
- package/dist/types/ExamServerAPI.d.ts +1 -1
- package/dist/types/ExamServerAPI.d.ts.map +1 -1
- package/dist/types/ExamServerAPI.js +2 -1
- package/dist/types/GradingStructure.js +2 -1
- package/dist/types/Score.js +2 -1
- package/dist/url.js +38 -2
- package/dist/url.js.map +1 -1
- package/dist/useCached.js +6 -3
- package/dist/useCached.js.map +1 -1
- package/dist/utils.js +8 -3
- package/dist/utils.js.map +1 -1
- package/dist/validateAnswers.js +38 -2
- package/dist/validateAnswers.js.map +1 -1
- package/package.json +39 -37
- package/dist/__tests__/AnsweringInstructions.test.d.ts +0 -2
- package/dist/__tests__/AnsweringInstructions.test.d.ts.map +0 -1
- package/dist/__tests__/AnsweringInstructions.test.js +0 -95
- package/dist/__tests__/AnsweringInstructions.test.js.map +0 -1
- package/dist/__tests__/casSaga.test.d.ts +0 -2
- package/dist/__tests__/casSaga.test.d.ts.map +0 -1
- package/dist/__tests__/casSaga.test.js +0 -80
- package/dist/__tests__/casSaga.test.js.map +0 -1
- package/dist/__tests__/examServerApi.d.ts +0 -3
- package/dist/__tests__/examServerApi.d.ts.map +0 -1
- package/dist/__tests__/examServerApi.js +0 -17
- package/dist/__tests__/examServerApi.js.map +0 -1
- package/dist/__tests__/playwright/SectionElement.test.d.ts +0 -2
- package/dist/__tests__/playwright/SectionElement.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/SectionElement.test.js +0 -20
- package/dist/__tests__/playwright/SectionElement.test.js.map +0 -1
- package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts +0 -2
- package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/exam/AudioAnswer.test.js +0 -132
- package/dist/__tests__/playwright/exam/AudioAnswer.test.js.map +0 -1
- package/dist/__tests__/playwright/exam/AudioPlayer.test.d.ts +0 -2
- package/dist/__tests__/playwright/exam/AudioPlayer.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/exam/AudioPlayer.test.js +0 -69
- package/dist/__tests__/playwright/exam/AudioPlayer.test.js.map +0 -1
- package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.d.ts +0 -2
- package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js +0 -125
- package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js.map +0 -1
- package/dist/__tests__/playwright/exam/Exam.test.d.ts +0 -2
- package/dist/__tests__/playwright/exam/Exam.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/exam/Exam.test.js +0 -29
- package/dist/__tests__/playwright/exam/Exam.test.js.map +0 -1
- package/dist/__tests__/playwright/exam/TextAnswerInput.test.d.ts +0 -2
- package/dist/__tests__/playwright/exam/TextAnswerInput.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/exam/TextAnswerInput.test.js +0 -81
- package/dist/__tests__/playwright/exam/TextAnswerInput.test.js.map +0 -1
- package/dist/__tests__/playwright/pages/AudioPlayer.page.d.ts +0 -13
- package/dist/__tests__/playwright/pages/AudioPlayer.page.d.ts.map +0 -1
- package/dist/__tests__/playwright/pages/AudioPlayer.page.js +0 -16
- package/dist/__tests__/playwright/pages/AudioPlayer.page.js.map +0 -1
- package/dist/__tests__/playwright/results/MultiLineAnswer.test.d.ts +0 -2
- package/dist/__tests__/playwright/results/MultiLineAnswer.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/results/MultiLineAnswer.test.js +0 -45
- package/dist/__tests__/playwright/results/MultiLineAnswer.test.js.map +0 -1
- package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts +0 -5
- package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js +0 -14
- package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js.map +0 -1
- package/dist/__tests__/playwright/stories/exam/DNDAnswerContainer.story.d.ts +0 -10
- package/dist/__tests__/playwright/stories/exam/DNDAnswerContainer.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/exam/DNDAnswerContainer.story.js +0 -20
- package/dist/__tests__/playwright/stories/exam/DNDAnswerContainer.story.js.map +0 -1
- package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts +0 -8
- package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/exam/Exam.story.js +0 -18
- package/dist/__tests__/playwright/stories/exam/Exam.story.js.map +0 -1
- package/dist/__tests__/playwright/stories/exam/Question.story.d.ts +0 -5
- package/dist/__tests__/playwright/stories/exam/Question.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/exam/Question.story.js +0 -19
- package/dist/__tests__/playwright/stories/exam/Question.story.js.map +0 -1
- package/dist/__tests__/playwright/stories/results/MultiLineAnswer.story.d.ts +0 -8
- package/dist/__tests__/playwright/stories/results/MultiLineAnswer.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/results/MultiLineAnswer.story.js +0 -51
- package/dist/__tests__/playwright/stories/results/MultiLineAnswer.story.js.map +0 -1
- package/dist/__tests__/playwright/template/index.d.ts +0 -1
- package/dist/__tests__/playwright/template/index.d.ts.map +0 -1
- package/dist/__tests__/playwright/template/index.js +0 -5
- package/dist/__tests__/playwright/template/index.js.map +0 -1
- package/dist/__tests__/playwright/utils/ExamComponentWrapper.d.ts +0 -9
- package/dist/__tests__/playwright/utils/ExamComponentWrapper.d.ts.map +0 -1
- package/dist/__tests__/playwright/utils/ExamComponentWrapper.js +0 -26
- package/dist/__tests__/playwright/utils/ExamComponentWrapper.js.map +0 -1
- package/dist/__tests__/playwright/utils/utils.d.ts +0 -6
- package/dist/__tests__/playwright/utils/utils.d.ts.map +0 -1
- package/dist/__tests__/playwright/utils/utils.js +0 -52
- package/dist/__tests__/playwright/utils/utils.js.map +0 -1
- package/dist/__tests__/renderAnnotations.test.d.ts +0 -2
- package/dist/__tests__/renderAnnotations.test.d.ts.map +0 -1
- package/dist/__tests__/renderAnnotations.test.js +0 -134
- package/dist/__tests__/renderAnnotations.test.js.map +0 -1
- package/dist/__tests__/results/AnnotationList.test.d.ts +0 -2
- package/dist/__tests__/results/AnnotationList.test.d.ts.map +0 -1
- package/dist/__tests__/results/AnnotationList.test.js +0 -168
- package/dist/__tests__/results/AnnotationList.test.js.map +0 -1
- package/dist/__tests__/results/ResultsContext.test.d.ts +0 -2
- package/dist/__tests__/results/ResultsContext.test.d.ts.map +0 -1
- package/dist/__tests__/results/ResultsContext.test.js +0 -185
- package/dist/__tests__/results/ResultsContext.test.js.map +0 -1
- package/dist/__tests__/results/ResultsExamQuestionAutoScore.test.d.ts +0 -2
- package/dist/__tests__/results/ResultsExamQuestionAutoScore.test.d.ts.map +0 -1
- package/dist/__tests__/results/ResultsExamQuestionAutoScore.test.js +0 -60
- package/dist/__tests__/results/ResultsExamQuestionAutoScore.test.js.map +0 -1
- package/dist/__tests__/results/ResultsExamQuestionManualScore.test.d.ts +0 -2
- package/dist/__tests__/results/ResultsExamQuestionManualScore.test.d.ts.map +0 -1
- package/dist/__tests__/results/ResultsExamQuestionManualScore.test.js +0 -145
- package/dist/__tests__/results/ResultsExamQuestionManualScore.test.js.map +0 -1
- package/dist/__tests__/testExamRendering.d.ts +0 -2
- package/dist/__tests__/testExamRendering.d.ts.map +0 -1
- package/dist/__tests__/testExamRendering.js +0 -149
- package/dist/__tests__/testExamRendering.js.map +0 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +0 -1
- package/dist/__tests__/util.test.d.ts +0 -2
- package/dist/__tests__/util.test.d.ts.map +0 -1
- package/dist/__tests__/util.test.js +0 -12
- package/dist/__tests__/util.test.js.map +0 -1
- package/dist/__tests__/validateAnswers.test.d.ts +0 -2
- package/dist/__tests__/validateAnswers.test.d.ts.map +0 -1
- package/dist/__tests__/validateAnswers.test.js +0 -243
- package/dist/__tests__/validateAnswers.test.js.map +0 -1
- package/dist/main-bundle.js +0 -366
- package/dist/main-bundle.js.LICENSE.txt +0 -69
- /package/{src/css → dist}/colors.less +0 -0
package/dist/utils.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapMaybe = mapMaybe;
|
|
4
|
+
exports.intersperse = intersperse;
|
|
5
|
+
exports.isWhitespace = isWhitespace;
|
|
1
6
|
/**
|
|
2
7
|
* Maps an array, skipping the value if `fn` returns `undefined`.
|
|
3
8
|
*
|
|
4
9
|
* @example mapMaybe(array, fn) ≡ array.map(fn).filter(v => v !== undefined)
|
|
5
10
|
*/
|
|
6
|
-
|
|
11
|
+
function mapMaybe(array, fn) {
|
|
7
12
|
const result = [];
|
|
8
13
|
for (let i = 0; i < array.length; i++) {
|
|
9
14
|
const value = fn(array[i], i);
|
|
@@ -18,7 +23,7 @@ export function mapMaybe(array, fn) {
|
|
|
18
23
|
*
|
|
19
24
|
* @example intersperse(',', ['a', 'b', 'c']) ≡ ['a', ',', 'b', ',' 'c']
|
|
20
25
|
*/
|
|
21
|
-
|
|
26
|
+
function intersperse(separator, array) {
|
|
22
27
|
if (array.length === 0)
|
|
23
28
|
return [];
|
|
24
29
|
const result = new Array(array.length * 2 - 1);
|
|
@@ -29,7 +34,7 @@ export function intersperse(separator, array) {
|
|
|
29
34
|
result[result.length - 1] = array[array.length - 1];
|
|
30
35
|
return result;
|
|
31
36
|
}
|
|
32
|
-
|
|
37
|
+
function isWhitespace(node) {
|
|
33
38
|
return typeof node === 'string' && node.trim().length === 0;
|
|
34
39
|
}
|
|
35
40
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAOA,4BAUC;AAOD,kCAWC;AAED,oCAEC;AArCD;;;;GAIG;AACH,SAAgB,QAAQ,CAAO,KAAU,EAAE,EAA8C;IACvF,MAAM,MAAM,GAAQ,EAAE,CAAA;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAC7B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,SAAgB,WAAW,CAAI,SAAY,EAAE,KAAU;IACrD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IACjC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAI,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IAEjD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACxB,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAA;IAC/B,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACnD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,YAAY,CAAC,IAAqB;IAChD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAA;AAC7D,CAAC"}
|
package/dist/validateAnswers.js
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.validateAnswers = validateAnswers;
|
|
37
|
+
const _ = __importStar(require("lodash-es"));
|
|
2
38
|
function reduceExam(examStructure, reducer, initialValue) {
|
|
3
39
|
function go(accumulator, element) {
|
|
4
40
|
return element.childNodes.reduce(go, reducer(accumulator, element));
|
|
@@ -85,7 +121,7 @@ function validateExtraAnswers(examStructure, answersById) {
|
|
|
85
121
|
}
|
|
86
122
|
return go(examStructure).extraAnswers;
|
|
87
123
|
}
|
|
88
|
-
|
|
124
|
+
function validateAnswers(examStructure, answersById) {
|
|
89
125
|
return _.flatMap([validateAnswerLength, validateExtraAnswers], validationFn => validationFn(examStructure, answersById));
|
|
90
126
|
}
|
|
91
127
|
//# sourceMappingURL=validateAnswers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateAnswers.js","sourceRoot":"","sources":["../src/validateAnswers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validateAnswers.js","sourceRoot":"","sources":["../src/validateAnswers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,0CAOC;AAlID,6CAA8B;AAiB9B,SAAS,UAAU,CACjB,aAA0B,EAC1B,OAAoD,EACpD,YAAe;IAEf,SAAS,EAAE,CAAC,WAAc,EAAE,OAAoB;QAC9C,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;IACrE,CAAC;IAED,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;AACxC,CAAC;AAED,SAAS,oBAAoB,CAC3B,aAA0B,EAC1B,WAA2C;IAE3C,OAAO,UAAU,CACf,aAAa,EACb,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QAClB,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC3E,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;YAC9D,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,UAAU,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,MAAK,MA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,CAAC,CAAA;gBACnD,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE,CAAA;YAChF,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC,aAAa,CAAC,CAAC,YAAY,CAAA;AACvC,CAAC;AAED,SAAgB,eAAe,CAC7B,aAA0B,EAC1B,WAA2C;IAE3C,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,EAAE,YAAY,CAAC,EAAE,CAC5E,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CACzC,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,67 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digabi/exam-engine-core",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "25.0.0-alpha.1",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "dist/index.js",
|
|
5
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./main.css": "./dist/main.css",
|
|
14
|
+
"./dist/main.css": "./dist/main.css",
|
|
15
|
+
"./colors.less": "./dist/colors.less"
|
|
16
|
+
},
|
|
6
17
|
"repository": "https://github.com/digabi/exam-engine",
|
|
7
18
|
"author": "Matriculation Examination Board, Finland",
|
|
8
19
|
"license": "EUPL-1.1",
|
|
9
20
|
"sideEffects": [
|
|
10
|
-
"*.less",
|
|
11
21
|
"*.css"
|
|
12
22
|
],
|
|
13
23
|
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
"src/css/colors.less"
|
|
24
|
+
"dist"
|
|
16
25
|
],
|
|
17
26
|
"scripts": {
|
|
18
|
-
"build": "
|
|
19
|
-
"
|
|
20
|
-
"watch": "webpack --mode=development --watch",
|
|
21
|
-
"prepublishOnly": "webpack --mode=production && perl -pi -e 's|&&define.amd||' dist/main-bundle.js # Compatibility with our 💩 AMD loader"
|
|
27
|
+
"build": "tsc --build && node build.mjs",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
22
29
|
},
|
|
23
30
|
"peerDependencies": {
|
|
24
|
-
"react": "^18.2.0"
|
|
31
|
+
"react": "^18.2.0",
|
|
32
|
+
"react-dom": "^18.2.0"
|
|
25
33
|
},
|
|
26
|
-
"
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@dnd-kit/core": "^6.1.0",
|
|
36
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
29
37
|
"@fortawesome/fontawesome-svg-core": "^7.3.1",
|
|
30
38
|
"@fortawesome/free-solid-svg-icons": "^7.3.1",
|
|
31
39
|
"@fortawesome/react-fontawesome": "^3.5.0",
|
|
32
|
-
"@playwright/experimental-ct-react": "^1.53.0",
|
|
33
40
|
"classnames": "^2.2.6",
|
|
34
|
-
"
|
|
35
|
-
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
36
|
-
"date-fns": "^4.4.0",
|
|
41
|
+
"dexie": "^4.4.6",
|
|
37
42
|
"downshift": "^9.4.0",
|
|
38
43
|
"fontfaceobserver": "^2.1.0",
|
|
39
|
-
"i18next": "^26.
|
|
40
|
-
"jquery": "^4.0.0",
|
|
41
|
-
"less": "^4.8.1",
|
|
42
|
-
"less-loader": "^12.3.3",
|
|
44
|
+
"i18next": "^26.4.2",
|
|
43
45
|
"lodash-es": "^4.18.1",
|
|
44
|
-
"mini-css-extract-plugin": "^2.10.2",
|
|
45
|
-
"postcss": "^8.5.26",
|
|
46
|
-
"postcss-loader": "^8.1.0",
|
|
47
|
-
"postcss-preset-env": "^10.0.0",
|
|
48
|
-
"react": "^18.2.0",
|
|
49
46
|
"react-css-transition-replace": "^5.0.1",
|
|
50
|
-
"react-
|
|
51
|
-
"react-i18next": "^17.0.11",
|
|
47
|
+
"react-i18next": "^17.0.15",
|
|
52
48
|
"react-redux": "^9.3.0",
|
|
53
|
-
"react-test-renderer": "^18.2.0",
|
|
54
49
|
"redux": "^5.0.1",
|
|
55
50
|
"redux-saga": "^1.5.1",
|
|
56
|
-
"redux-saga-test-plan": "^4.0.6",
|
|
57
51
|
"rich-text-editor": "^8.12.0",
|
|
58
|
-
"sanitize-html": "^2.17.6",
|
|
59
52
|
"typesafe-actions": "^5.1.0",
|
|
60
|
-
"utility-types": "^3.10.0"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
53
|
+
"utility-types": "^3.10.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@digabi/mathquill": "^0.10.12",
|
|
57
|
+
"@digabi/noto-sans": "^3.2.0",
|
|
58
|
+
"@playwright/experimental-ct-react": "^1.53.0",
|
|
59
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
60
|
+
"esbuild": "^0.28.2",
|
|
61
|
+
"esbuild-plugin-less": "^1.3.39",
|
|
62
|
+
"less": "^4.9.1",
|
|
63
|
+
"react": "^18.2.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
65
|
+
"react-test-renderer": "^18.2.0",
|
|
66
|
+
"redux-saga-test-plan": "^4.0.6"
|
|
65
67
|
},
|
|
66
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "6ad0b2126ace77fb2106dfff35944233c9e77b05"
|
|
67
69
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AnsweringInstructions.test.d.ts","sourceRoot":"","sources":["../../__tests__/AnsweringInstructions.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const react_i18next_1 = require("react-i18next");
|
|
9
|
-
const react_test_renderer_1 = __importDefault(require("react-test-renderer"));
|
|
10
|
-
const AnsweringInstructions_1 = __importDefault(require("../src/components/AnsweringInstructions"));
|
|
11
|
-
const i18n_1 = require("../src/i18n");
|
|
12
|
-
describe('<AnsweringInstructions />', () => {
|
|
13
|
-
let i18n;
|
|
14
|
-
beforeAll(() => {
|
|
15
|
-
i18n = (0, i18n_1.initI18n)('fi-FI');
|
|
16
|
-
});
|
|
17
|
-
describe('question', () => {
|
|
18
|
-
it('numerals', () => {
|
|
19
|
-
expectRendering({
|
|
20
|
-
maxAnswers: 1,
|
|
21
|
-
elementType: 'question',
|
|
22
|
-
childQuestions: mkQuestions(range(1, 10, '1.'))
|
|
23
|
-
});
|
|
24
|
-
expectRendering({
|
|
25
|
-
maxAnswers: 5,
|
|
26
|
-
elementType: 'question',
|
|
27
|
-
childQuestions: mkQuestions(range(1, 10, '1.'))
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
it('2 child questions and maxAnswers = 1', () => {
|
|
31
|
-
expectRendering({
|
|
32
|
-
maxAnswers: 1,
|
|
33
|
-
elementType: 'question',
|
|
34
|
-
childQuestions: mkQuestions(range(1, 2, '1.'))
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
it('fallback', () => {
|
|
38
|
-
expectRendering({
|
|
39
|
-
maxAnswers: 11,
|
|
40
|
-
elementType: 'question',
|
|
41
|
-
childQuestions: mkQuestions(range(1, 12, '1.'))
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
describe('section', () => {
|
|
46
|
-
it('numerals', () => {
|
|
47
|
-
expectRendering({
|
|
48
|
-
maxAnswers: 1,
|
|
49
|
-
elementType: 'section',
|
|
50
|
-
childQuestions: mkQuestions(range(1, 10))
|
|
51
|
-
});
|
|
52
|
-
expectRendering({
|
|
53
|
-
maxAnswers: 5,
|
|
54
|
-
elementType: 'section',
|
|
55
|
-
childQuestions: mkQuestions(range(1, 10))
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
it('2 child questions and maxAnswers = 1', () => {
|
|
59
|
-
expectRendering({
|
|
60
|
-
maxAnswers: 1,
|
|
61
|
-
elementType: 'section',
|
|
62
|
-
childQuestions: mkQuestions(range(1, 2))
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
it('fallback', () => {
|
|
66
|
-
expectRendering({
|
|
67
|
-
minAnswers: 2,
|
|
68
|
-
maxAnswers: 5,
|
|
69
|
-
elementType: 'section',
|
|
70
|
-
childQuestions: mkQuestions(range(1, 12))
|
|
71
|
-
});
|
|
72
|
-
expectRendering({
|
|
73
|
-
maxAnswers: 11,
|
|
74
|
-
elementType: 'section',
|
|
75
|
-
childQuestions: mkQuestions(range(1, 12))
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
function range(start, end, prefix = '') {
|
|
80
|
-
return lodash_1.default.range(start, end + 1).map(n => `${prefix}${n}`);
|
|
81
|
-
}
|
|
82
|
-
function expectRendering(props) {
|
|
83
|
-
const container = react_test_renderer_1.default.create(react_1.default.createElement(react_i18next_1.I18nextProvider, { i18n: i18n },
|
|
84
|
-
react_1.default.createElement(AnsweringInstructions_1.default, { ...props })));
|
|
85
|
-
expect(container.toJSON()).toMatchSnapshot();
|
|
86
|
-
}
|
|
87
|
-
function mkQuestions(displayNumbers) {
|
|
88
|
-
return displayNumbers.map(displayNumber => {
|
|
89
|
-
const question = document.createElement('question');
|
|
90
|
-
question.setAttribute('display-number', displayNumber);
|
|
91
|
-
return question;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
//# sourceMappingURL=AnsweringInstructions.test.js.map
|
|
@@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GAAW,EAAE,MAAM,GAAG,EAAE;QACpD,OAAO,gBAAC,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1D,CAAC;IAED,SAAS,eAAe,CAAC,KAAgC;QACvD,MAAM,SAAS,GAAG,6BAAY,CAAC,MAAM,CACnC,8BAAC,+BAAe,IAAC,IAAI,EAAE,IAAI;YACzB,8BAAC,+BAAqB,OAAK,KAAK,GAAI,CACpB,CACnB,CAAA;QACD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAA;IAC9C,CAAC;IAED,SAAS,WAAW,CAAC,cAAwB;QAC3C,OAAO,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;YACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAA;YACnD,QAAQ,CAAC,YAAY,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA;YACtD,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"casSaga.test.d.ts","sourceRoot":"","sources":["../../__tests__/casSaga.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const redux_saga_test_plan_1 = require("redux-saga-test-plan");
|
|
4
|
-
const actions_1 = require("../src/store/cas/actions");
|
|
5
|
-
const sagas_1 = require("../src/store/cas/sagas");
|
|
6
|
-
describe('performEnableCas', () => {
|
|
7
|
-
describe('in the successful case', () => {
|
|
8
|
-
it(`calls setCasStatus with 'allowing', performs the countdown and calls setCasStatus with 'allowed'`, async () => {
|
|
9
|
-
const setCasStatus = jest.fn((casStatus) => Promise.resolve(casStatus));
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
11
|
-
await (0, redux_saga_test_plan_1.expectSaga)(sagas_1.performEnableCas, { setCasStatus }, (0, actions_1.allowCas)(2))
|
|
12
|
-
.put((0, actions_1.allowCasCountdown)(2))
|
|
13
|
-
.put((0, actions_1.updateCasRemaining)(1))
|
|
14
|
-
.put((0, actions_1.allowCasSucceeded)())
|
|
15
|
-
.run(false);
|
|
16
|
-
expect(setCasStatus).toHaveBeenCalledTimes(2);
|
|
17
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(1, 'allowing');
|
|
18
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(2, 'allowed');
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
describe('when CAS software is already enabled', () => {
|
|
22
|
-
it(`skips the countdown and calls setCasStatus with 'allowed'`, async () => {
|
|
23
|
-
const setCasStatus = jest.fn(() => Promise.resolve('allowed'));
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
25
|
-
await (0, redux_saga_test_plan_1.expectSaga)(sagas_1.performEnableCas, { setCasStatus }, (0, actions_1.allowCas)(2))
|
|
26
|
-
.put((0, actions_1.allowCasSucceeded)())
|
|
27
|
-
.run(false);
|
|
28
|
-
expect(setCasStatus).toHaveBeenCalledTimes(1);
|
|
29
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(1, 'allowing');
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
describe('when the user cancels the countdown', () => {
|
|
33
|
-
it(`calls setCasStatus with 'forbidden' if the user cancels the countdown`, async () => {
|
|
34
|
-
const setCasStatus = jest.fn((casStatus) => Promise.resolve(casStatus));
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
36
|
-
await (0, redux_saga_test_plan_1.expectSaga)(sagas_1.performEnableCas, { setCasStatus }, (0, actions_1.allowCas)(2))
|
|
37
|
-
.put((0, actions_1.allowCasCountdown)(2))
|
|
38
|
-
.put((0, actions_1.updateCasRemaining)(1))
|
|
39
|
-
.delay(1500)
|
|
40
|
-
.dispatch((0, actions_1.allowCasCancelled)())
|
|
41
|
-
.run(false);
|
|
42
|
-
expect(setCasStatus).toHaveBeenCalledTimes(2);
|
|
43
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(1, 'allowing');
|
|
44
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(2, 'forbidden');
|
|
45
|
-
});
|
|
46
|
-
it(`doesn't cancel the countdown if CAS software has been allowed during the countdown`, async () => {
|
|
47
|
-
const setCasStatus = jest
|
|
48
|
-
.fn((casStatus) => Promise.resolve(casStatus))
|
|
49
|
-
.mockImplementationOnce(() => Promise.resolve('allowing'))
|
|
50
|
-
.mockImplementationOnce(() => Promise.resolve('allowed'));
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
52
|
-
await (0, redux_saga_test_plan_1.expectSaga)(sagas_1.performEnableCas, { setCasStatus }, (0, actions_1.allowCas)(2))
|
|
53
|
-
.put((0, actions_1.allowCasCountdown)(2))
|
|
54
|
-
.put((0, actions_1.updateCasRemaining)(1))
|
|
55
|
-
.put((0, actions_1.allowCasSucceeded)())
|
|
56
|
-
.delay(1500)
|
|
57
|
-
.dispatch((0, actions_1.allowCasCancelled)())
|
|
58
|
-
.run(false);
|
|
59
|
-
expect(setCasStatus).toHaveBeenCalledTimes(2);
|
|
60
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(1, 'allowing');
|
|
61
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(2, 'forbidden');
|
|
62
|
-
});
|
|
63
|
-
it(`cancels the process if the post-countdown setCasStatus returns 'forbidden'`, async () => {
|
|
64
|
-
const setCasStatus = jest
|
|
65
|
-
.fn((casStatus) => Promise.resolve(casStatus))
|
|
66
|
-
.mockImplementationOnce(() => Promise.resolve('allowing'))
|
|
67
|
-
.mockImplementationOnce(() => Promise.resolve('forbidden'));
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
69
|
-
await (0, redux_saga_test_plan_1.expectSaga)(sagas_1.performEnableCas, { setCasStatus }, (0, actions_1.allowCas)(2))
|
|
70
|
-
.put((0, actions_1.allowCasCountdown)(2))
|
|
71
|
-
.put((0, actions_1.updateCasRemaining)(1))
|
|
72
|
-
.put((0, actions_1.allowCasCancelled)())
|
|
73
|
-
.run(false);
|
|
74
|
-
expect(setCasStatus).toHaveBeenCalledTimes(2);
|
|
75
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(1, 'allowing');
|
|
76
|
-
expect(setCasStatus).toHaveBeenNthCalledWith(2, 'allowed');
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
//# sourceMappingURL=casSaga.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"casSaga.test.js","sourceRoot":"","sources":["../../__tests__/casSaga.test.ts"],"names":[],"mappings":";;AAAA,+DAAiD;AACjD,sDAMiC;AACjC,kDAAyD;AAGzD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,kGAAkG,EAAE,KAAK,IAAI,EAAE;YAChH,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAA;YAElF,iEAAiE;YACjE,MAAM,IAAA,iCAAU,EAAC,wBAAgB,EAAE,EAAE,YAAY,EAAS,EAAE,IAAA,kBAAQ,EAAC,CAAC,CAAC,CAAC;iBACrE,GAAG,CAAC,IAAA,2BAAiB,EAAC,CAAC,CAAC,CAAC;iBACzB,GAAG,CAAC,IAAA,4BAAkB,EAAC,CAAC,CAAC,CAAC;iBAC1B,GAAG,CAAC,IAAA,2BAAiB,GAAE,CAAC;iBACxB,GA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CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"examServerApi.d.ts","sourceRoot":"","sources":["../../__tests__/examServerApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,eAAO,MAAM,aAAa,EAAE,aAY3B,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.examServerApi = void 0;
|
|
4
|
-
exports.examServerApi = {
|
|
5
|
-
getAnswers: () => Promise.resolve([]),
|
|
6
|
-
getAnswerHistory: () => Promise.resolve([]),
|
|
7
|
-
setCasStatus: casStatus => Promise.resolve(casStatus),
|
|
8
|
-
saveAnswer: () => Promise.resolve(),
|
|
9
|
-
saveScreenshot: () => Promise.resolve('ok'),
|
|
10
|
-
saveAudio: () => Promise.resolve('ok'),
|
|
11
|
-
deleteAudio: () => Promise.resolve(),
|
|
12
|
-
playAudio: () => Promise.resolve('ok'),
|
|
13
|
-
playRestrictedAudio: () => Promise.resolve('ok'),
|
|
14
|
-
getRestrictedAudio: () => Promise.resolve(new Blob()),
|
|
15
|
-
examineExam: () => undefined
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=examServerApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"examServerApi.js","sourceRoot":"","sources":["../../__tests__/examServerApi.ts"],"names":[],"mappings":";;;AAEa,QAAA,aAAa,GAAkB;IAC1C,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,gBAAgB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3C,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IACrD,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;IACnC,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IACtC,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;IACpC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IACtC,mBAAmB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAChD,kBAAkB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IACrD,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;CAC7B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SectionElement.test.d.ts","sourceRoot":"","sources":["../../../__tests__/playwright/SectionElement.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const SectionElement_1 = __importDefault(require("../../src/components/SectionElement"));
|
|
9
|
-
experimental_ct_react_1.test.describe('SectionElement', () => {
|
|
10
|
-
(0, experimental_ct_react_1.test)('renders SectionElement correctly', async ({ mount }) => {
|
|
11
|
-
const content = 'Test SectionElement';
|
|
12
|
-
const component = await mount(react_1.default.createElement("div", null,
|
|
13
|
-
react_1.default.createElement(SectionElement_1.default, { className: "custom className" }, content)));
|
|
14
|
-
const section = component.locator('section');
|
|
15
|
-
await (0, experimental_ct_react_1.expect)(section).toBeVisible();
|
|
16
|
-
await (0, experimental_ct_react_1.expect)(section).toContainText(content);
|
|
17
|
-
await (0, experimental_ct_react_1.expect)(section).toHaveClass(/custom className/);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=SectionElement.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SectionElement.test.js","sourceRoot":"","sources":["../../../__tests__/playwright/SectionElement.test.tsx"],"names":[],"mappings":";;;;;AAAA,6EAAgE;AAChE,kDAAyB;AACzB,yFAAgE;AAEhE,4BAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IACnC,IAAA,4BAAI,EAAC,kCAAkC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QAC3D,MAAM,OAAO,GAAG,qBAAqB,CAAA;QACrC,MAAM,SAAS,GAAG,MAAM,KAAK,CAC3B;YACE,8BAAC,wBAAc,IAAC,SAAS,EAAC,kBAAkB,IAAE,OAAO,CAAkB,CACnE,CACP,CAAA;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAC5C,MAAM,IAAA,8BAAM,EAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;QACnC,MAAM,IAAA,8BAAM,EAAC,OAAO,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QAC5C,MAAM,IAAA,8BAAM,EAAC,OAAO,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AudioAnswer.test.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/AudioAnswer.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
|
|
8
|
-
const AudioAnswer_story_1 = require("../stories/exam/AudioAnswer.story");
|
|
9
|
-
const exam_engine_mastering_1 = require("@digabi/exam-engine-mastering");
|
|
10
|
-
const AudioPlayer_page_1 = require("../pages/AudioPlayer.page");
|
|
11
|
-
const RECORD = 'Äänitä vastaus';
|
|
12
|
-
const STOP = 'Lopeta äänitys';
|
|
13
|
-
const DELETE = 'Poista äänitteesi';
|
|
14
|
-
experimental_ct_react_1.test.describe('AudioAnswer', () => {
|
|
15
|
-
let component;
|
|
16
|
-
experimental_ct_react_1.test.beforeEach(async ({ mount }) => {
|
|
17
|
-
const results = await (0, exam_engine_mastering_1.masterExam)(audioXml, () => '', getMediaMetadata);
|
|
18
|
-
const examXml = results[0].xml;
|
|
19
|
-
component = await mount(react_1.default.createElement(AudioAnswer_story_1.AudioAnswerStory, { examXml: examXml }));
|
|
20
|
-
});
|
|
21
|
-
(0, experimental_ct_react_1.test)('contains only button to start recording', async () => {
|
|
22
|
-
await expectStartRecordingButtonToBeVisible();
|
|
23
|
-
});
|
|
24
|
-
(0, experimental_ct_react_1.test)('clicking start button starts recording', async () => {
|
|
25
|
-
await startRecording();
|
|
26
|
-
await expectStopRecordingButtonToBeVisible();
|
|
27
|
-
});
|
|
28
|
-
(0, experimental_ct_react_1.test)('clicking stop button after start stops recording and shows player for the recording', async () => {
|
|
29
|
-
await startRecording();
|
|
30
|
-
await expectTimeElapsed('0:02');
|
|
31
|
-
await stopRecording();
|
|
32
|
-
await expectAudioPlayerToBeVisible();
|
|
33
|
-
});
|
|
34
|
-
(0, experimental_ct_react_1.test)('recording shows time elapsed', async () => {
|
|
35
|
-
await startRecording();
|
|
36
|
-
await expectTimeElapsed('0:01');
|
|
37
|
-
await expectTimeElapsed('0:02');
|
|
38
|
-
await expectTimeElapsed('0:03');
|
|
39
|
-
await stopRecording();
|
|
40
|
-
});
|
|
41
|
-
(0, experimental_ct_react_1.test)('audio player shows same duration as elapsed recording time', async ({ browserName }) => {
|
|
42
|
-
experimental_ct_react_1.test.skip(browserName === 'firefox', 'Does not work in Firefox for some reason in test browser, in real browser it works');
|
|
43
|
-
await startRecording();
|
|
44
|
-
await expectTimeElapsed('0:03');
|
|
45
|
-
await stopRecording();
|
|
46
|
-
const audioPlayer = new AudioPlayer_page_1.AudioPlayerPage(component);
|
|
47
|
-
await (0, experimental_ct_react_1.expect)(audioPlayer.durationDisplay).toHaveText('00:03');
|
|
48
|
-
await (0, experimental_ct_react_1.expect)(audioPlayer.playButton).toBeVisible();
|
|
49
|
-
});
|
|
50
|
-
(0, experimental_ct_react_1.test)('recorded audio can be played', async ({ page, browserName }) => {
|
|
51
|
-
experimental_ct_react_1.test.skip(browserName === 'firefox', 'Does not work in Firefox for some reason in test browser, in real browser it works');
|
|
52
|
-
await startRecording();
|
|
53
|
-
await expectTimeElapsed('0:02');
|
|
54
|
-
await stopRecording();
|
|
55
|
-
const audioPlayer = new AudioPlayer_page_1.AudioPlayerPage(component);
|
|
56
|
-
await (0, experimental_ct_react_1.expect)(audioPlayer.currentTimeDisplay).toHaveText('00:00');
|
|
57
|
-
await audioPlayer.playButton.click();
|
|
58
|
-
await page.waitForTimeout(3000);
|
|
59
|
-
await (0, experimental_ct_react_1.expect)(audioPlayer.currentTimeDisplay).toHaveText('00:02');
|
|
60
|
-
});
|
|
61
|
-
(0, experimental_ct_react_1.test)('recorded audio can be deleted', async () => {
|
|
62
|
-
await startRecording();
|
|
63
|
-
await expectTimeElapsed('0:03');
|
|
64
|
-
await stopRecording();
|
|
65
|
-
await expectDeleteRecordingButtonToBeVisible();
|
|
66
|
-
await deleteRecording();
|
|
67
|
-
await expectStartRecordingButtonToBeVisible();
|
|
68
|
-
});
|
|
69
|
-
(0, experimental_ct_react_1.test)('recording is available for one audio recorder at the time', async () => {
|
|
70
|
-
await startRecording();
|
|
71
|
-
await expectTimeElapsed('0:01');
|
|
72
|
-
await expectAlreadyRecordingError(1);
|
|
73
|
-
});
|
|
74
|
-
async function expectButtonToBeVisible(name, nth) {
|
|
75
|
-
await (0, experimental_ct_react_1.expect)(component.getByTestId('audio-answer').nth(nth).getByRole('button', { name })).toBeVisible();
|
|
76
|
-
}
|
|
77
|
-
async function expectStartRecordingButtonToBeVisible(nth = 0) {
|
|
78
|
-
await expectButtonToBeVisible(RECORD, nth);
|
|
79
|
-
}
|
|
80
|
-
async function expectStopRecordingButtonToBeVisible(nth = 0) {
|
|
81
|
-
await expectButtonToBeVisible(STOP, nth);
|
|
82
|
-
}
|
|
83
|
-
async function expectDeleteRecordingButtonToBeVisible(nth = 0) {
|
|
84
|
-
await expectButtonToBeVisible(DELETE, nth);
|
|
85
|
-
}
|
|
86
|
-
async function expectAudioPlayerToBeVisible(nth = 0) {
|
|
87
|
-
const audioPlayer = new AudioPlayer_page_1.AudioPlayerPage(component, nth);
|
|
88
|
-
await (0, experimental_ct_react_1.expect)(audioPlayer.baseLocator).toBeVisible();
|
|
89
|
-
}
|
|
90
|
-
async function expectAlreadyRecordingError(nth = 0) {
|
|
91
|
-
await (0, experimental_ct_react_1.expect)(component.getByTestId('audio-answer').nth(nth)).toContainText('Äänitys on käynnissä toisessa tehtävässä');
|
|
92
|
-
}
|
|
93
|
-
async function expectTimeElapsed(text, nth = 0) {
|
|
94
|
-
await (0, experimental_ct_react_1.expect)(component.getByTestId('audio-answer-time-elapsed').nth(nth)).toHaveText(text);
|
|
95
|
-
}
|
|
96
|
-
async function pushButton(name, nth) {
|
|
97
|
-
await component.getByTestId('audio-answer').nth(nth).getByRole('button', { name }).click();
|
|
98
|
-
}
|
|
99
|
-
async function startRecording(nth = 0) {
|
|
100
|
-
await expectButtonToBeVisible(RECORD, nth);
|
|
101
|
-
await pushButton(RECORD, nth);
|
|
102
|
-
await expectButtonToBeVisible(STOP, nth);
|
|
103
|
-
}
|
|
104
|
-
async function stopRecording(nth = 0) {
|
|
105
|
-
await expectButtonToBeVisible(STOP, nth);
|
|
106
|
-
await pushButton(STOP, nth);
|
|
107
|
-
}
|
|
108
|
-
async function deleteRecording(nth = 0) {
|
|
109
|
-
await expectButtonToBeVisible(DELETE, nth);
|
|
110
|
-
await pushButton(DELETE, nth);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
const getMediaMetadata = (_src, _type) => Promise.resolve({ duration: 999 });
|
|
114
|
-
const audioXml = `<e:exam xmlns:e="http://ylioppilastutkinto.fi/exam.xsd" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ylioppilastutkinto.fi/exam.xsd https://abitti.net/schema/exam.xsd" exam-schema-version="0.5">
|
|
115
|
-
<e:exam-versions>
|
|
116
|
-
<e:exam-version lang="fi-FI"/>
|
|
117
|
-
</e:exam-versions>
|
|
118
|
-
<e:exam-title>Exam</e:exam-title>
|
|
119
|
-
<e:exam-instruction/>
|
|
120
|
-
<e:table-of-contents/>
|
|
121
|
-
<e:section>
|
|
122
|
-
<e:section-title>Section</e:section-title>
|
|
123
|
-
<e:section-instruction/>
|
|
124
|
-
<e:question>
|
|
125
|
-
<e:question-title>Audiotehtävä</e:question-title>
|
|
126
|
-
<e:question-instruction />
|
|
127
|
-
<e:audio-answer max-score="5" />
|
|
128
|
-
<e:audio-answer max-score="5" />
|
|
129
|
-
</e:question>
|
|
130
|
-
</e:section>
|
|
131
|
-
</e:exam>`;
|
|
132
|
-
//# sourceMappingURL=AudioAnswer.test.js.map
|