@tinyweb_dev/oe-exam-sdk 0.1.28 → 0.1.30
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/README.md +4 -4
- package/dist/api/contest-rooms.js +54 -1
- package/dist/api/contest-rooms.types.js +1 -1
- package/dist/api/exam-create.js +179 -1
- package/dist/api/exam-create.types.js +1 -1
- package/dist/api/exam-entry.js +68 -1
- package/dist/api/exam-entry.types.js +1 -1
- package/dist/api/exam-questions.js +149 -1
- package/dist/api/exam-questions.types.js +1 -1
- package/dist/api/exam-taking.js +84 -1
- package/dist/api/exam-taking.types.d.ts +7 -0
- package/dist/api/exam-taking.types.js +1 -1
- package/dist/api/index.js +8 -1
- package/dist/api/result-review.js +62 -1
- package/dist/api/result-review.types.js +16 -1
- package/dist/components/CueCardEditor.js +58 -1
- package/dist/components/common/ResolvedImage.js +15 -1
- package/dist/components/exams/CompletionDialog.js +8 -1
- package/dist/components/exams/CreateExamInfoForm.js +84 -1
- package/dist/components/exams/CreateExamPageContainer.js +110 -1
- package/dist/components/exams/ExamCreator.js +287 -1
- package/dist/components/exams/ExamPartTabs.js +138 -1
- package/dist/components/exams/ExamPreviewDialog.d.ts +6 -7
- package/dist/components/exams/ExamPreviewDialog.js +121 -1
- package/dist/components/exams/ExamPreviewPartContent.d.ts +18 -0
- package/dist/components/exams/ExamPreviewPartContent.js +27 -0
- package/dist/components/exams/ExamPreviewSidebar.d.ts +17 -0
- package/dist/components/exams/ExamPreviewSidebar.js +37 -0
- package/dist/components/exams/ExamQuestionGrid.js +37 -1
- package/dist/components/exams/ExamQuestionsPageContainer.js +112 -1
- package/dist/components/exams/ExamViewDialog.js +61 -1
- package/dist/components/exams/PartAudioUploader.js +9 -1
- package/dist/components/exams/TemplateSelector.js +76 -1
- package/dist/components/exams/UnsavedChangesDialog.js +7 -1
- package/dist/components/exams/api.js +3 -1
- package/dist/components/exams/create-exam.texts.js +1 -1
- package/dist/components/exams/create-exam.validation.js +18 -1
- package/dist/components/exams/entry/EntryRestartDialog.js +11 -1
- package/dist/components/exams/entry/StudentExamEntryPageContainer.js +358 -1
- package/dist/components/exams/entry/exam-entry.states.js +26 -1
- package/dist/components/exams/entry/exam-entry.utils.js +55 -1
- package/dist/components/exams/entry/fullscreen-loading.js +18 -1
- package/dist/components/exams/entry/index.js +4 -1
- package/dist/components/exams/exam-preview.types.d.ts +30 -0
- package/dist/components/exams/exam-preview.types.js +62 -0
- package/dist/components/exams/exam-question-status.js +45 -1
- package/dist/components/exams/exam-template.utils.js +18 -1
- package/dist/components/exams/index.d.ts +1 -0
- package/dist/components/exams/index.js +19 -1
- package/dist/components/exams/rooms/StudentContestRoomsPageContainer.js +183 -1
- package/dist/components/exams/rooms/contest-rooms.utils.js +93 -1
- package/dist/components/exams/rooms/index.js +2 -1
- package/dist/components/exams/take/ExamTakingApiContext.js +25 -1
- package/dist/components/exams/take/ExamTakingPageContainer.js +955 -1
- package/dist/components/exams/take/GenericQuestionRenderer.js +14 -1
- package/dist/components/exams/take/components/QuestionRenderer.js +207 -1
- package/dist/components/exams/take/components/index.js +11 -1
- package/dist/components/exams/take/components/question-renderers/ArticlesViewer.js +8 -1
- package/dist/components/exams/take/components/question-renderers/MoversAnswerTheQuestionRenderer.js +30 -1
- package/dist/components/exams/take/components/question-renderers/MoversChooseAdjectiveRenderer.js +63 -1
- package/dist/components/exams/take/components/question-renderers/MoversChooseBestAnswerRenderer.js +136 -1
- package/dist/components/exams/take/components/question-renderers/MoversColoringRenderer.js +379 -1
- package/dist/components/exams/take/components/question-renderers/MoversCrossOutWordGroupRenderer.d.ts +20 -0
- package/dist/components/exams/take/components/question-renderers/MoversCrossOutWordGroupRenderer.js +141 -0
- package/dist/components/exams/take/components/question-renderers/MoversFillWordHintRenderer.js +131 -1
- package/dist/components/exams/take/components/question-renderers/MoversGridFillRenderer.js +76 -1
- package/dist/components/exams/take/components/question-renderers/MoversLabelThePictureRenderer.js +68 -1
- package/dist/components/exams/take/components/question-renderers/MoversListenAndWriteRenderer.js +42 -1
- package/dist/components/exams/take/components/question-renderers/MoversMatchByWritingAnswerRenderer.js +131 -1
- package/dist/components/exams/take/components/question-renderers/MoversPictureChooseRenderer.js +76 -1
- package/dist/components/exams/take/components/question-renderers/MoversPictureFillBlankChooseRenderer.js +68 -1
- package/dist/components/exams/take/components/question-renderers/MoversReadingPassageRenderer.js +62 -1
- package/dist/components/exams/take/components/question-renderers/MoversTrueFalseRenderer.d.ts +1 -1
- package/dist/components/exams/take/components/question-renderers/MoversTrueFalseRenderer.js +51 -1
- package/dist/components/exams/take/components/question-renderers/MoversWordFillParagraphRenderer.js +171 -1
- package/dist/components/exams/take/components/question-renderers/MoversWordFillStructuredFormRenderer.js +198 -1
- package/dist/components/exams/take/components/question-renderers/MoversWordOrderAndMatchGroupRenderer.d.ts +15 -0
- package/dist/components/exams/take/components/question-renderers/MoversWordOrderAndMatchGroupRenderer.js +36 -0
- package/dist/components/exams/take/components/question-renderers/MoversWordOrderingRenderer.js +92 -1
- package/dist/components/exams/take/components/question-renderers/MoversWriteSentencesRenderer.js +11 -1
- package/dist/components/exams/take/components/question-renderers/MoversWritingRenderer.js +56 -1
- package/dist/components/exams/take/components/question-renderers/index.d.ts +2 -0
- package/dist/components/exams/take/components/question-renderers/index.js +25 -1
- package/dist/components/exams/take/components/speaking/SpeakingAudioPlayer.js +85 -1
- package/dist/components/exams/take/components/speaking/SpeakingContentFrame.js +10 -1
- package/dist/components/exams/take/components/speaking/SpeakingExamLayout.js +15 -1
- package/dist/components/exams/take/components/speaking/SpeakingHeader.js +6 -1
- package/dist/components/exams/take/components/speaking/SpeakingInstructionBar.js +8 -1
- package/dist/components/exams/take/components/speaking/SpeakingMicButton.js +59 -1
- package/dist/components/exams/take/components/speaking/SpeakingNavButton.js +7 -1
- package/dist/components/exams/take/components/speaking/SpeakingPartBadge.js +5 -1
- package/dist/components/exams/take/components/speaking/SpeakingReadDisplayedContent.module.css +120 -0
- package/dist/components/exams/take/components/speaking/SpeakingRecordingPreview.js +73 -1
- package/dist/components/exams/take/components/speaking/SpeakingReportErrorButton.js +8 -1
- package/dist/components/exams/take/components/speaking/SpeakingSpontaneousQA.module.css +344 -0
- package/dist/components/exams/take/components/speaking/SpeakingVideoIntro.js +32 -1
- package/dist/components/exams/take/components/speaking/index.js +1 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingChooseAnswerGroupRenderer.js +63 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingChooseObjectsRenderer.js +95 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingCompareImagesRenderer.js +35 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingConversationRenderer.js +147 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingCueCardRenderer.js +232 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingDescribeImageRenderer.js +193 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingDragObjectsRenderer.js +155 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingGNInterviewRenderer.js +212 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingInfoExchangeRenderer.js +77 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingListenAndSpeakAnswerRenderer.js +64 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingOddOneOutRenderer.js +69 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingQuestionListRenderer.js +64 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingQuestionRenderer.js +92 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingReadDisplayedContentRenderer.js +202 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingSpontaneousQARenderer.js +339 -1
- package/dist/components/exams/take/components/speaking/renderers/SpeakingSpontaneousQaGroupRenderer.d.ts +19 -0
- package/dist/components/exams/take/components/speaking/renderers/SpeakingSpontaneousQaGroupRenderer.js +76 -0
- package/dist/components/exams/take/components/speaking/renderers/SpeakingStoryImagesRenderer.js +56 -1
- package/dist/components/exams/take/components/speaking/renderers/SpontaneousQACambridgeLayout.d.ts +24 -0
- package/dist/components/exams/take/components/speaking/renderers/SpontaneousQACambridgeLayout.js +120 -0
- package/dist/components/exams/take/components/speaking/renderers/SpontaneousQAInlineAudioPlayer.d.ts +8 -0
- package/dist/components/exams/take/components/speaking/renderers/SpontaneousQAInlineAudioPlayer.js +94 -0
- package/dist/components/exams/take/components/speaking/renderers/SpontaneousQASummerSkyAudioPlayer.d.ts +8 -0
- package/dist/components/exams/take/components/speaking/renderers/SpontaneousQASummerSkyAudioPlayer.js +101 -0
- package/dist/components/exams/take/components/speaking/renderers/index.d.ts +1 -0
- package/dist/components/exams/take/components/speaking/renderers/index.js +14 -1
- package/dist/components/exams/take/exam-taking.utils.d.ts +13 -0
- package/dist/components/exams/take/exam-taking.utils.js +203 -1
- package/dist/components/exams/take/hooks/index.js +2 -1
- package/dist/components/exams/take/hooks/useAnswerAutosave.js +71 -1
- package/dist/components/exams/take/hooks/useAttemptSubmit.js +38 -1
- package/dist/components/exams/take/hooks/useAutoSave.js +83 -1
- package/dist/components/exams/take/hooks/useExamCountdown.js +35 -1
- package/dist/components/exams/take/hooks/useExamTimer.js +97 -1
- package/dist/components/exams/take/hooks/useProctoringCamera.js +118 -1
- package/dist/components/exams/take/hooks/useProctoringSnapshot.js +76 -1
- package/dist/components/exams/take/hooks/useSpeakingConversationAudio.js +178 -1
- package/dist/components/exams/take/hooks/useSpeakingNavigation.js +51 -1
- package/dist/components/exams/take/hooks/useSpeakingRecorder.js +406 -1
- package/dist/components/exams/take/hooks/useSpeakingRendererSetup.js +136 -1
- package/dist/components/exams/take/hooks/useSpontaneousQaGroupRecorder.d.ts +11 -0
- package/dist/components/exams/take/hooks/useSpontaneousQaGroupRecorder.js +352 -0
- package/dist/components/exams/take/hooks/useSpontaneousQaGroupRendererSetup.d.ts +42 -0
- package/dist/components/exams/take/hooks/useSpontaneousQaGroupRendererSetup.js +166 -0
- package/dist/components/exams/take/hooks/useToeicAudio.js +35 -1
- package/dist/components/exams/take/index.js +6 -1
- package/dist/components/exams/take/types/speaking-cue-card.types.js +1 -1
- package/dist/components/exams/take/types/speaking.types.js +7 -1
- package/dist/components/exams/take/types.js +4 -1
- package/dist/components/exams/take/utils/answer-transformers.js +452 -1
- package/dist/components/exams/take/utils/cambridge-yle-inline-speaking.d.ts +21 -0
- package/dist/components/exams/take/utils/cambridge-yle-inline-speaking.js +44 -0
- package/dist/components/exams/take/utils/coloring-assignments.js +40 -1
- package/dist/components/exams/take/utils/cross-out-word-group.transformer.d.ts +21 -0
- package/dist/components/exams/take/utils/cross-out-word-group.transformer.js +83 -0
- package/dist/components/exams/take/utils/question-transformers.d.ts +43 -2
- package/dist/components/exams/take/utils/question-transformers.js +1137 -1
- package/dist/components/features/exam-entry/entry-state-cards.js +19 -1
- package/dist/components/features/exam-entry/index.js +2 -1
- package/dist/components/features/exam-entry/themed/CambridgeYleWaitingRoom.js +121 -1
- package/dist/components/features/exam-entry/themed/ThemedWaitingRoom.js +37 -1
- package/dist/components/features/exam-entry/themed/ToeicWaitingRoom.js +15 -1
- package/dist/components/features/exam-entry/themed/cambridge-yle-waiting-parts.js +80 -1
- package/dist/components/features/exam-entry/themed/components/CloseButton.js +6 -1
- package/dist/components/features/exam-entry/themed/components/ExamInfoPanel.js +17 -1
- package/dist/components/features/exam-entry/themed/components/ModeSelector.js +6 -1
- package/dist/components/features/exam-entry/themed/components/StartButton.js +12 -1
- package/dist/components/features/exam-entry/themed/components/index.js +4 -1
- package/dist/components/features/exam-entry/themed/index.js +3 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +43 -1
- package/dist/components/questions/_shared/config/question-types.config.js +362 -1
- package/dist/components/questions/_shared/constants/color-palette.js +21 -1
- package/dist/components/questions/_shared/hooks/useAnswerGroupQuestionGroup.js +105 -1
- package/dist/components/questions/_shared/hooks/useBasicQuestionGroup.js +222 -1
- package/dist/components/questions/_shared/hooks/useCompareImagesGroup.js +140 -1
- package/dist/components/questions/_shared/hooks/useImageQuestionGroup.js +123 -1
- package/dist/components/questions/_shared/hooks/useInfoExchangeGroup.js +50 -1
- package/dist/components/questions/_shared/hooks/useQuestionFormState.js +54 -1
- package/dist/components/questions/_shared/hooks/useQuestionInitialization.js +123 -1
- package/dist/components/questions/_shared/hooks/useQuestionListGroup.js +121 -1
- package/dist/components/questions/_shared/hooks/useQuestionOnChange.js +70 -1
- package/dist/components/questions/_shared/hooks/useSceneQuestionGroup.js +194 -1
- package/dist/components/questions/_shared/index.js +7 -1
- package/dist/components/questions/_shared/types/answer-the-question.type.js +1 -1
- package/dist/components/questions/_shared/types/arrange-letters-into-words.type.js +1 -1
- package/dist/components/questions/_shared/types/choose-correct-adjective.type.js +3 -1
- package/dist/components/questions/_shared/types/choose-the-correct-answer-group.type.d.ts +1 -0
- package/dist/components/questions/_shared/types/choose-the-correct-answer-group.type.js +1 -1
- package/dist/components/questions/_shared/types/color-region.config.js +1 -1
- package/dist/components/questions/_shared/types/cross-out-word-group.type.d.ts +2 -0
- package/dist/components/questions/_shared/types/cross-out-word-group.type.js +1 -1
- package/dist/components/questions/_shared/types/fill-in-blank.type.js +1 -1
- package/dist/components/questions/_shared/types/fill-missing-words-in-grid.type.js +1 -1
- package/dist/components/questions/_shared/types/gn-speaking-interview.type.js +1 -1
- package/dist/components/questions/_shared/types/index.d.ts +1 -0
- package/dist/components/questions/_shared/types/index.js +14 -1
- package/dist/components/questions/_shared/types/label-the-picture.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-choose-from-answer-group.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-choose-objects-in-scene.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-drag-objects-into-scene.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-speak-answer.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-speak-compare-images.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-speak-image-group.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-speak-info-exchange.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-speak-odd-one-out.type.js +3 -1
- package/dist/components/questions/_shared/types/listen-and-speak-question-list.type.js +1 -1
- package/dist/components/questions/_shared/types/listen-and-speak-with-story-images.type.js +3 -1
- package/dist/components/questions/_shared/types/listen-and-tick-answer.type.js +1 -1
- package/dist/components/questions/_shared/types/listening-drawline.type.js +1 -1
- package/dist/components/questions/_shared/types/look-and-choose-answer.type.js +1 -1
- package/dist/components/questions/_shared/types/look-picture-fill-word-hint.type.js +1 -1
- package/dist/components/questions/_shared/types/match-by-writing-answer.type.js +1 -1
- package/dist/components/questions/_shared/types/multiple-choice.type.d.ts +5 -0
- package/dist/components/questions/_shared/types/multiple-choice.type.js +1 -1
- package/dist/components/questions/_shared/types/question-group.type.js +11 -1
- package/dist/components/questions/_shared/types/read-and-color-objects.type.js +1 -1
- package/dist/components/questions/_shared/types/read-displayed-content.type.js +1 -1
- package/dist/components/questions/_shared/types/read-passage-and-answer-questions.type.js +1 -1
- package/dist/components/questions/_shared/types/speaking-describe-image.type.js +1 -1
- package/dist/components/questions/_shared/types/spontaneous-qa-group.type.d.ts +37 -0
- package/dist/components/questions/_shared/types/spontaneous-qa-group.type.js +1 -0
- package/dist/components/questions/_shared/types/spontaneous-qa.type.js +1 -1
- package/dist/components/questions/_shared/types/true-false-group.type.js +1 -1
- package/dist/components/questions/_shared/types/word-fill-paragraph-with-options.type.js +1 -1
- package/dist/components/questions/_shared/types/word-fill-paragraph.type.js +1 -1
- package/dist/components/questions/_shared/types/word-fill-structured-form.type.d.ts +20 -11
- package/dist/components/questions/_shared/types/word-fill-structured-form.type.js +1 -1
- package/dist/components/questions/_shared/types/word-order-and-match-group.type.d.ts +38 -0
- package/dist/components/questions/_shared/types/word-order-and-match-group.type.js +1 -0
- package/dist/components/questions/_shared/types/word-ordering.type.js +1 -1
- package/dist/components/questions/_shared/types/write-a-short-letter.type.js +1 -1
- package/dist/components/questions/_shared/types/write-correct-verb-form.type.js +3 -1
- package/dist/components/questions/_shared/types/write-sentences.type.js +1 -1
- package/dist/components/questions/_shared/types/write-short-paragraph.type.js +1 -1
- package/dist/components/questions/_shared/utils/answer-builder.js +79 -1
- package/dist/components/questions/_shared/utils/createColorRegionRegistration.js +39 -1
- package/dist/components/questions/_shared/utils/id-generator.js +3 -1
- package/dist/components/questions/_shared/utils/parseFillBlankStem.d.ts +30 -0
- package/dist/components/questions/_shared/utils/parseFillBlankStem.js +69 -0
- package/dist/components/questions/_shared/utils/question-validation.js +21 -1
- package/dist/components/questions/components/ColorNode.js +85 -1
- package/dist/components/questions/components/ColorRegionClient.js +545 -1
- package/dist/components/questions/components/ColorRegionCreator.js +420 -1
- package/dist/components/questions/components/ColorRegionNode.js +59 -1
- package/dist/components/questions/components/CreatorGuide.js +103 -1
- package/dist/components/questions/components/NameNode.js +26 -1
- package/dist/components/questions/components/QuestionBankOption.js +46 -1
- package/dist/components/questions/components/QuestionBasicInfoForm.js +9 -1
- package/dist/components/questions/components/QuestionCommonFields.js +33 -1
- package/dist/components/questions/components/QuestionSearchDropdown.js +258 -1
- package/dist/components/questions/components/QuestionTypeSelector.js +32 -1
- package/dist/components/questions/components/QuestionTypeSpecificForms.js +6 -1
- package/dist/components/questions/components/RegionNode.js +94 -1
- package/dist/components/questions/components/index.js +14 -1
- package/dist/components/questions/creator/QuestionCreator.js +90 -1
- package/dist/components/questions/creator/QuestionGroupCreator.js +119 -1
- package/dist/components/questions/creator/dedicated-component-router.js +79 -1
- package/dist/components/questions/creator/index.js +3 -1
- package/dist/components/questions/creator/question-type-registry.js +90 -1
- package/dist/components/questions/groups/ArticlesGroupCard.js +121 -1
- package/dist/components/questions/groups/BasicQuestionGroupCard.js +50 -1
- package/dist/components/questions/groups/DocumentGroupCard.js +114 -1
- package/dist/components/questions/groups/MatchAnswerGroupCard.js +25 -1
- package/dist/components/questions/index.d.ts +1 -0
- package/dist/components/questions/index.js +11 -1
- package/dist/components/questions/question-bank/EditQuestionBankDialog.d.ts +2 -0
- package/dist/components/questions/question-bank/EditQuestionBankDialog.js +114 -0
- package/dist/components/questions/question-bank/QuestionEditorRenderer.d.ts +23 -0
- package/dist/components/questions/question-bank/QuestionEditorRenderer.js +75 -0
- package/dist/components/questions/question-bank/difficulty.d.ts +15 -0
- package/dist/components/questions/question-bank/difficulty.js +33 -0
- package/dist/components/questions/question-bank/editor-adapters/choice-adapters.d.ts +5 -0
- package/dist/components/questions/question-bank/editor-adapters/choice-adapters.js +101 -0
- package/dist/components/questions/question-bank/editor-adapters/index.d.ts +5 -0
- package/dist/components/questions/question-bank/editor-adapters/index.js +4 -0
- package/dist/components/questions/question-bank/editor-adapters/media-adapters.d.ts +6 -0
- package/dist/components/questions/question-bank/editor-adapters/media-adapters.js +140 -0
- package/dist/components/questions/question-bank/editor-adapters/types.d.ts +1 -0
- package/dist/components/questions/question-bank/editor-adapters/types.js +1 -0
- package/dist/components/questions/question-bank/editor-adapters/unsupported-fallback.d.ts +8 -0
- package/dist/components/questions/question-bank/editor-adapters/unsupported-fallback.js +6 -0
- package/dist/components/questions/question-bank/editor-adapters/writing-adapters.d.ts +5 -0
- package/dist/components/questions/question-bank/editor-adapters/writing-adapters.js +114 -0
- package/dist/components/questions/question-bank/index.d.ts +4 -0
- package/dist/components/questions/question-bank/index.js +3 -0
- package/dist/components/questions/question-bank/types.d.ts +59 -0
- package/dist/components/questions/question-bank/types.js +1 -0
- package/dist/components/questions/types/answer-the-question/AnswerTheQuestionClient.js +37 -1
- package/dist/components/questions/types/answer-the-question/AnswerTheQuestionCreator.js +351 -1
- package/dist/components/questions/types/answer-the-question/register.js +67 -1
- package/dist/components/questions/types/answer-the-question/transform.js +36 -1
- package/dist/components/questions/types/arrange-letters-into-words/ArrangeLettersIntoWordsClient.js +141 -1
- package/dist/components/questions/types/arrange-letters-into-words/ArrangeLettersIntoWordsCreator.js +118 -1
- package/dist/components/questions/types/arrange-letters-into-words/index.js +2 -1
- package/dist/components/questions/types/arrange-letters-into-words/register.js +4 -1
- package/dist/components/questions/types/arrange-letters-into-words/transform.js +24 -1
- package/dist/components/questions/types/choose-correct-adjective/ChooseCorrectAdjectiveClient.js +74 -1
- package/dist/components/questions/types/choose-correct-adjective/ChooseCorrectAdjectiveCreator.js +169 -1
- package/dist/components/questions/types/choose-correct-adjective/index.js +2 -1
- package/dist/components/questions/types/choose-correct-adjective/register.js +55 -1
- package/dist/components/questions/types/choose-correct-adjective/transform.js +16 -1
- package/dist/components/questions/types/choose-the-correct-answer/ChooseTheCorrectAnswerClient.js +149 -1
- package/dist/components/questions/types/choose-the-correct-answer/ChooseTheCorrectAnswerCreator.js +568 -1
- package/dist/components/questions/types/choose-the-correct-answer/index.js +3 -1
- package/dist/components/questions/types/choose-the-correct-answer/normalize.d.ts +9 -0
- package/dist/components/questions/types/choose-the-correct-answer/normalize.js +88 -1
- package/dist/components/questions/types/choose-the-correct-answer/register.js +99 -1
- package/dist/components/questions/types/choose-the-correct-answer/transform.js +70 -1
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseTheCorrectAnswerGroupClient.js +22 -1
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseTheCorrectAnswerGroupCreator.js +163 -1
- package/dist/components/questions/types/choose-the-correct-answer-group/index.js +3 -1
- package/dist/components/questions/types/choose-the-correct-answer-group/map-choose-the-correct-answer-group-data.js +94 -1
- package/dist/components/questions/types/choose-the-correct-answer-group/register.js +36 -1
- package/dist/components/questions/types/choose-the-correct-answer-group/transform.js +55 -1
- package/dist/components/questions/types/cross-out-word-group/CrossOutWordGroupClient.js +27 -1
- package/dist/components/questions/types/cross-out-word-group/CrossOutWordGroupCreator.js +231 -1
- package/dist/components/questions/types/cross-out-word-group/index.js +5 -1
- package/dist/components/questions/types/cross-out-word-group/map-cross-out-word-group-data.d.ts +1 -1
- package/dist/components/questions/types/cross-out-word-group/map-cross-out-word-group-data.js +110 -1
- package/dist/components/questions/types/cross-out-word-group/register.js +36 -1
- package/dist/components/questions/types/cross-out-word-group/transform.js +67 -1
- package/dist/components/questions/types/fill-in-blank/FillInBlankClient.js +275 -1
- package/dist/components/questions/types/fill-in-blank/FillInBlankCreator.js +464 -1
- package/dist/components/questions/types/fill-in-blank/index.js +2 -1
- package/dist/components/questions/types/fill-in-blank/register.js +148 -1
- package/dist/components/questions/types/fill-in-blank/transform.js +88 -1
- package/dist/components/questions/types/fill-missing-words-in-grid/FillMissingWordsInGridClient.js +117 -1
- package/dist/components/questions/types/fill-missing-words-in-grid/FillMissingWordsInGridCreator.js +671 -1
- package/dist/components/questions/types/fill-missing-words-in-grid/index.js +2 -1
- package/dist/components/questions/types/fill-missing-words-in-grid/register.js +37 -1
- package/dist/components/questions/types/fill-missing-words-in-grid/transform.js +15 -1
- package/dist/components/questions/types/gn-speaking-interview/GNSpeakingInterviewCreator.js +262 -1
- package/dist/components/questions/types/gn-speaking-interview/register.js +121 -1
- package/dist/components/questions/types/gn-speaking-interview/transform.js +48 -1
- package/dist/components/questions/types/image-object-matching/ImageObjectMatchingClient.js +16 -1
- package/dist/components/questions/types/image-object-matching/ImageObjectMatchingCreator.js +27 -1
- package/dist/components/questions/types/image-object-matching/index.js +2 -1
- package/dist/components/questions/types/image-object-matching/register.js +3 -1
- package/dist/components/questions/types/image-object-matching/transform.js +2 -1
- package/dist/components/questions/types/label-the-picture/LabelThePictureClient.js +102 -1
- package/dist/components/questions/types/label-the-picture/LabelThePictureCreator.js +344 -1
- package/dist/components/questions/types/label-the-picture/index.js +2 -1
- package/dist/components/questions/types/label-the-picture/register.js +54 -1
- package/dist/components/questions/types/label-the-picture/transform.js +28 -1
- package/dist/components/questions/types/listen-and-choose-from-answer-group/ListenAndChooseFromAnswerGroupClient.js +78 -1
- package/dist/components/questions/types/listen-and-choose-from-answer-group/ListenAndChooseFromAnswerGroupCreator.js +232 -1
- package/dist/components/questions/types/listen-and-choose-from-answer-group/index.js +2 -1
- package/dist/components/questions/types/listen-and-choose-from-answer-group/register.js +82 -1
- package/dist/components/questions/types/listen-and-choose-from-answer-group/transform.js +27 -1
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/ListenAndChooseObjectsInSceneClient.js +70 -1
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/ListenAndChooseObjectsInSceneCreator.js +386 -1
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/index.js +2 -1
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/register.js +100 -1
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/transform.js +33 -1
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/ListenAndDragObjectsIntoSceneClient.js +106 -1
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/ListenAndDragObjectsIntoSceneCreator.js +457 -1
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/index.js +2 -1
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/register.js +110 -1
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/transform.js +35 -1
- package/dist/components/questions/types/listen-and-speak-answer/ArrowIndicator.js +8 -1
- package/dist/components/questions/types/listen-and-speak-answer/ListenAndSpeakAnswerClient.js +22 -1
- package/dist/components/questions/types/listen-and-speak-answer/ListenAndSpeakAnswerCreator.js +291 -1
- package/dist/components/questions/types/listen-and-speak-answer/index.js +2 -1
- package/dist/components/questions/types/listen-and-speak-answer/register.js +84 -1
- package/dist/components/questions/types/listen-and-speak-answer/transform.js +27 -1
- package/dist/components/questions/types/listen-and-speak-compare-images/ListenAndSpeakCompareImagesClient.js +32 -1
- package/dist/components/questions/types/listen-and-speak-compare-images/ListenAndSpeakCompareImagesCreator.js +295 -1
- package/dist/components/questions/types/listen-and-speak-compare-images/register.js +79 -1
- package/dist/components/questions/types/listen-and-speak-compare-images/transform.js +27 -1
- package/dist/components/questions/types/listen-and-speak-image-group/ListenAndSpeakImageGroupClient.js +34 -1
- package/dist/components/questions/types/listen-and-speak-image-group/ListenAndSpeakImageGroupCreator.js +285 -1
- package/dist/components/questions/types/listen-and-speak-image-group/register.js +81 -1
- package/dist/components/questions/types/listen-and-speak-image-group/transform.js +26 -1
- package/dist/components/questions/types/listen-and-speak-info-exchange/ListenAndSpeakInfoExchangeClient.js +38 -1
- package/dist/components/questions/types/listen-and-speak-info-exchange/ListenAndSpeakInfoExchangeCreator.js +385 -1
- package/dist/components/questions/types/listen-and-speak-info-exchange/register.js +87 -1
- package/dist/components/questions/types/listen-and-speak-info-exchange/transform.js +32 -1
- package/dist/components/questions/types/listen-and-speak-odd-one-out/ListenAndSpeakOddOneOutClient.js +26 -1
- package/dist/components/questions/types/listen-and-speak-odd-one-out/ListenAndSpeakOddOneOutCreator.js +247 -1
- package/dist/components/questions/types/listen-and-speak-odd-one-out/register.js +59 -1
- package/dist/components/questions/types/listen-and-speak-odd-one-out/transform.js +18 -1
- package/dist/components/questions/types/listen-and-speak-question-list/ListenAndSpeakQuestionListClient.js +26 -1
- package/dist/components/questions/types/listen-and-speak-question-list/ListenAndSpeakQuestionListCreator.js +256 -1
- package/dist/components/questions/types/listen-and-speak-question-list/register.js +81 -1
- package/dist/components/questions/types/listen-and-speak-question-list/transform.js +26 -1
- package/dist/components/questions/types/listen-and-speak-with-story-images/ListenAndSpeakWithStoryImagesClient.js +26 -1
- package/dist/components/questions/types/listen-and-speak-with-story-images/ListenAndSpeakWithStoryImagesCreator.js +230 -1
- package/dist/components/questions/types/listen-and-speak-with-story-images/register.js +56 -1
- package/dist/components/questions/types/listen-and-speak-with-story-images/transform.js +16 -1
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerClient.js +72 -1
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerCreator.js +230 -1
- package/dist/components/questions/types/look-picture-choose-correct-answer/index.js +1 -1
- package/dist/components/questions/types/look-picture-choose-correct-answer/register.js +66 -1
- package/dist/components/questions/types/look-picture-choose-correct-answer/transform.js +42 -1
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerClient.js +96 -1
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerCreator.js +238 -1
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/index.js +2 -1
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/register.js +76 -1
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/transform.js +19 -1
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintClient.js +134 -1
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintCreator.js +617 -1
- package/dist/components/questions/types/look-picture-fill-word-hint/index.js +2 -1
- package/dist/components/questions/types/look-picture-fill-word-hint/register.js +82 -1
- package/dist/components/questions/types/look-picture-fill-word-hint/transform.js +29 -1
- package/dist/components/questions/types/match-by-writing-answer/MatchByWritingAnswerClient.js +38 -1
- package/dist/components/questions/types/match-by-writing-answer/MatchByWritingAnswerCreator.js +359 -1
- package/dist/components/questions/types/match-by-writing-answer/index.js +3 -1
- package/dist/components/questions/types/match-by-writing-answer/register.js +58 -1
- package/dist/components/questions/types/match-by-writing-answer/transform.js +61 -1
- package/dist/components/questions/types/read-and-color-objects/ReadAndColorObjectsClient.js +16 -1
- package/dist/components/questions/types/read-and-color-objects/ReadAndColorObjectsCreator.js +23 -1
- package/dist/components/questions/types/read-and-color-objects/index.js +2 -1
- package/dist/components/questions/types/read-and-color-objects/register.js +3 -1
- package/dist/components/questions/types/read-and-color-objects/transform.js +36 -1
- package/dist/components/questions/types/read-displayed-content/ReadDisplayedContentCreator.js +125 -1
- package/dist/components/questions/types/read-displayed-content/register.js +64 -1
- package/dist/components/questions/types/read-displayed-content/transform.js +12 -1
- package/dist/components/questions/types/read-passage-and-answer-questions/ReadPassageAndAnswerQuestionsClient.js +65 -1
- package/dist/components/questions/types/read-passage-and-answer-questions/ReadPassageAndAnswerQuestionsCreator.js +511 -1
- package/dist/components/questions/types/read-passage-and-answer-questions/index.js +2 -1
- package/dist/components/questions/types/read-passage-and-answer-questions/register.js +58 -1
- package/dist/components/questions/types/read-passage-and-answer-questions/transform.js +28 -1
- package/dist/components/questions/types/speaking-conversation/SpeakingConversationCreator.js +373 -1
- package/dist/components/questions/types/speaking-conversation/SpeakingConversationPreviewClient.js +41 -1
- package/dist/components/questions/types/speaking-conversation/register.js +110 -1
- package/dist/components/questions/types/speaking-conversation/transform.js +34 -1
- package/dist/components/questions/types/speaking-cue-card/SpeakingCueCardCreator.js +74 -1
- package/dist/components/questions/types/speaking-cue-card/register.js +52 -1
- package/dist/components/questions/types/speaking-cue-card/transform.js +12 -1
- package/dist/components/questions/types/speaking-describe-image/SpeakingDescribeImageClient.js +10 -1
- package/dist/components/questions/types/speaking-describe-image/SpeakingDescribeImageCreator.js +161 -1
- package/dist/components/questions/types/speaking-describe-image/index.js +2 -1
- package/dist/components/questions/types/speaking-describe-image/register.js +69 -1
- package/dist/components/questions/types/speaking-describe-image/transform.js +16 -1
- package/dist/components/questions/types/spontaneous-qa/SpontaneousQACreator.js +234 -1
- package/dist/components/questions/types/spontaneous-qa/register.js +93 -1
- package/dist/components/questions/types/spontaneous-qa/transform.js +34 -1
- package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupClient.d.ts +2 -0
- package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupClient.js +9 -0
- package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupCreator.d.ts +2 -0
- package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupCreator.js +179 -0
- package/dist/components/questions/types/spontaneous-qa-group/creator-helpers.d.ts +5 -0
- package/dist/components/questions/types/spontaneous-qa-group/creator-helpers.js +43 -0
- package/dist/components/questions/types/spontaneous-qa-group/flatten.d.ts +14 -0
- package/dist/components/questions/types/spontaneous-qa-group/flatten.js +69 -0
- package/dist/components/questions/types/spontaneous-qa-group/index.d.ts +2 -0
- package/dist/components/questions/types/spontaneous-qa-group/index.js +2 -0
- package/dist/components/questions/types/spontaneous-qa-group/register.d.ts +2 -0
- package/dist/components/questions/types/spontaneous-qa-group/register.js +139 -0
- package/dist/components/questions/types/spontaneous-qa-group/transform.d.ts +2 -0
- package/dist/components/questions/types/spontaneous-qa-group/transform.js +52 -0
- package/dist/components/questions/types/true-false/TrueFalseClient.js +75 -1
- package/dist/components/questions/types/true-false/TrueFalseCreator.js +244 -1
- package/dist/components/questions/types/true-false/index.js +2 -1
- package/dist/components/questions/types/true-false/register.js +77 -1
- package/dist/components/questions/types/true-false/transform.js +32 -1
- package/dist/components/questions/types/true-false-group/TrueFalseGroupClient.js +25 -1
- package/dist/components/questions/types/true-false-group/TrueFalseGroupCreator.js +129 -1
- package/dist/components/questions/types/true-false-group/index.js +5 -1
- package/dist/components/questions/types/true-false-group/map-true-false-group-data.js +69 -1
- package/dist/components/questions/types/true-false-group/register.js +36 -1
- package/dist/components/questions/types/true-false-group/transform.js +43 -1
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphClient.js +233 -1
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphCreator.js +631 -1
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphWrapper.js +28 -1
- package/dist/components/questions/types/word-fill-paragraph/index.js +2 -1
- package/dist/components/questions/types/word-fill-paragraph/register.js +136 -1
- package/dist/components/questions/types/word-fill-paragraph/transform.js +56 -1
- package/dist/components/questions/types/word-fill-structured-form/WfsfWordBankEditor.js +86 -1
- package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormClient.js +246 -1
- package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormCreator.d.ts +2 -0
- package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormCreator.js +484 -1
- package/dist/components/questions/types/word-fill-structured-form/index.js +3 -1
- package/dist/components/questions/types/word-fill-structured-form/map-wfsf-question-data.js +113 -1
- package/dist/components/questions/types/word-fill-structured-form/register.js +36 -1
- package/dist/components/questions/types/word-fill-structured-form/transform.js +77 -1
- package/dist/components/questions/types/word-fill-structured-form/wfsf-word-bank.utils.js +110 -1
- package/dist/components/questions/types/word-order-and-match-group/WordOrderAndMatchGroupClient.d.ts +3 -0
- package/dist/components/questions/types/word-order-and-match-group/WordOrderAndMatchGroupClient.js +190 -0
- package/dist/components/questions/types/word-order-and-match-group/WordOrderAndMatchGroupCreator.d.ts +3 -0
- package/dist/components/questions/types/word-order-and-match-group/WordOrderAndMatchGroupCreator.js +182 -0
- package/dist/components/questions/types/word-order-and-match-group/index.d.ts +4 -0
- package/dist/components/questions/types/word-order-and-match-group/index.js +4 -0
- package/dist/components/questions/types/word-order-and-match-group/register.d.ts +2 -0
- package/dist/components/questions/types/word-order-and-match-group/register.js +121 -0
- package/dist/components/questions/types/word-order-and-match-group/transform.d.ts +2 -0
- package/dist/components/questions/types/word-order-and-match-group/transform.js +70 -0
- package/dist/components/questions/types/word-ordering/WordOrderingClient.js +84 -1
- package/dist/components/questions/types/word-ordering/WordOrderingCreator.js +192 -1
- package/dist/components/questions/types/word-ordering/index.js +2 -1
- package/dist/components/questions/types/word-ordering/register.js +46 -1
- package/dist/components/questions/types/word-ordering/transform.js +24 -1
- package/dist/components/questions/types/write-a-short-letter/WriteAShortLetterClient.js +99 -1
- package/dist/components/questions/types/write-a-short-letter/WriteAShortLetterCreator.js +320 -1
- package/dist/components/questions/types/write-a-short-letter/index.js +2 -1
- package/dist/components/questions/types/write-a-short-letter/register.js +68 -1
- package/dist/components/questions/types/write-a-short-letter/transform.js +25 -1
- package/dist/components/questions/types/write-correct-verb-form/WriteCorrectVerbFormClient.js +61 -1
- package/dist/components/questions/types/write-correct-verb-form/WriteCorrectVerbFormCreator.js +196 -1
- package/dist/components/questions/types/write-correct-verb-form/index.js +2 -1
- package/dist/components/questions/types/write-correct-verb-form/register.js +62 -1
- package/dist/components/questions/types/write-correct-verb-form/transform.js +17 -1
- package/dist/components/questions/types/write-sentences/WriteSentencesClient.js +22 -1
- package/dist/components/questions/types/write-sentences/WriteSentencesCreator.js +174 -1
- package/dist/components/questions/types/write-sentences/index.js +2 -1
- package/dist/components/questions/types/write-sentences/register.js +58 -1
- package/dist/components/questions/types/write-sentences/transform.js +28 -1
- package/dist/components/questions/types/write-short-paragraph/WriteShortParagraphClient.js +96 -1
- package/dist/components/questions/types/write-short-paragraph/WriteShortParagraphCreator.js +161 -1
- package/dist/components/questions/types/write-short-paragraph/index.js +2 -1
- package/dist/components/questions/types/write-short-paragraph/register.js +4 -1
- package/dist/components/questions/types/write-short-paragraph/transform.js +21 -1
- package/dist/components/questions/viewer/ChooseTheCorrectAnswerGroupViewer.js +11 -1
- package/dist/components/questions/viewer/CrossOutWordGroupViewer.js +8 -1
- package/dist/components/questions/viewer/QuestionGroupViewer.js +36 -1
- package/dist/components/questions/viewer/QuestionViewer.js +692 -1
- package/dist/components/questions/viewer/SpontaneousQaGroupViewer.d.ts +2 -1
- package/dist/components/questions/viewer/SpontaneousQaGroupViewer.js +82 -1
- package/dist/components/questions/viewer/TrueFalseGroupViewer.js +11 -1
- package/dist/components/questions/viewer/WordFillStructuredFormViewer.js +14 -1
- package/dist/components/questions/viewer/WordOrderAndMatchGroupViewer.d.ts +3 -1
- package/dist/components/questions/viewer/WordOrderAndMatchGroupViewer.js +95 -1
- package/dist/components/questions/viewer/index.js +8 -1
- package/dist/components/results/ResultReviewPageContainer.js +220 -1
- package/dist/components/results/ReviewQuestionRenderer.js +55 -1
- package/dist/components/results/hooks/useResultReviewPolling.js +76 -1
- package/dist/components/results/index.js +22 -1
- package/dist/components/results/renderers/QuestionExplanations.js +19 -1
- package/dist/components/results/renderers/ReviewChooseAdjectiveRenderer.js +94 -1
- package/dist/components/results/renderers/ReviewChooseBestAnswerRenderer.js +75 -1
- package/dist/components/results/renderers/ReviewColoringRenderer.js +110 -1
- package/dist/components/results/renderers/ReviewListenAndWriteRenderer.js +48 -1
- package/dist/components/results/renderers/ReviewListenChooseAnswerGroupRenderer.js +87 -1
- package/dist/components/results/renderers/ReviewListenChooseObjectsRenderer.js +104 -1
- package/dist/components/results/renderers/ReviewListenDragObjectsRenderer.js +123 -1
- package/dist/components/results/renderers/ReviewListeningHeader.js +104 -1
- package/dist/components/results/renderers/ReviewSpeakingAIPanel.js +116 -1
- package/dist/components/results/renderers/ReviewSpeakingMedia.js +48 -1
- package/dist/components/results/renderers/ReviewSpeakingQuestionItem.js +42 -1
- package/dist/components/results/renderers/ReviewSpeakingRenderer.js +12 -1
- package/dist/components/results/renderers/ReviewSpeakingRenderer.types.js +85 -1
- package/dist/components/results/renderers/review-question-body-dedicated.js +104 -1
- package/dist/components/results/renderers/review-question-body-movers.js +148 -1
- package/dist/components/results/renderers/review-speaking-map.js +226 -1
- package/dist/components/results/renderers/review-spontaneous-qa-group.d.ts +4 -0
- package/dist/components/results/renderers/review-spontaneous-qa-group.js +74 -0
- package/dist/components/results/report/BadgeTitle.js +5 -1
- package/dist/components/results/report/ExamSkillRow.js +20 -1
- package/dist/components/results/report/OceanEduExamReport.js +58 -1
- package/dist/components/results/report/OceanEduSpeakingReport.js +62 -1
- package/dist/components/results/report/OverallAssessmentSection.js +17 -1
- package/dist/components/results/report/ResultErrorState.js +18 -1
- package/dist/components/results/report/ResultLoadingState.js +10 -1
- package/dist/components/results/report/ResultNotPublicState.js +27 -1
- package/dist/components/results/report/SpeakingReportParts.js +14 -1
- package/dist/components/results/report/SpeakingReportShared.js +86 -1
- package/dist/components/results/report/SpeakingRubricSection.js +171 -1
- package/dist/components/results/report/speaking-report.utils.js +198 -1
- package/dist/components/results/result-review.utils.js +6 -1
- package/dist/components/results/review-data.js +222 -1
- package/dist/components/results/review-renderer.utils.js +97 -1
- package/dist/components/results/review-status.utils.js +36 -1
- package/dist/components/results/review-types.js +1 -1
- package/dist/components/results/speaking/SpeakingResultAudioPlayer.js +77 -1
- package/dist/components/results/speaking/SpeakingReviewResult.js +48 -1
- package/dist/components/results/utils/review-score.utils.js +72 -1
- package/dist/components/results/utils/speaking-summary.js +224 -1
- package/dist/components/results/utils/transform-speaking-review.js +183 -1
- package/dist/components/shared/RichTextEditor.d.ts +9 -0
- package/dist/components/shared/RichTextEditor.js +47 -0
- package/dist/components/shared/audio/SpeakingAudioPlayer.js +100 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleAudioPlayer.js +140 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleBottomNav.js +10 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleExamLayout.d.ts +1 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleExamLayout.js +18 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleExampleText.js +11 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleHeader.js +11 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleInstructionBanner.d.ts +2 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleInstructionBanner.js +19 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleNavButton.js +13 -1
- package/dist/components/themes/cambridge-yle/CambridgeYlePartBanner.d.ts +1 -1
- package/dist/components/themes/cambridge-yle/CambridgeYlePartBanner.js +3 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleProgressBar.js +6 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleQuestionCard.js +5 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleQuestionCardFullWidth.js +9 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleSidebar.d.ts +2 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleSidebar.js +61 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleTimer.d.ts +1 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleTimer.js +25 -1
- package/dist/components/themes/cambridge-yle/index.js +13 -1
- package/dist/components/themes/english-certification/EcAnswerTheQuestion.js +25 -1
- package/dist/components/themes/english-certification/EcMatchByWritingAnswer.js +89 -1
- package/dist/components/themes/english-certification/EcWordFillParagraph.js +56 -1
- package/dist/components/themes/english-certification/EcWordFillStructuredForm.js +192 -1
- package/dist/components/themes/english-certification/EcWritingTask.js +60 -1
- package/dist/components/themes/english-certification/EnglishCertificationAudioPlayer.js +108 -1
- package/dist/components/themes/english-certification/EnglishCertificationBrand.js +11 -1
- package/dist/components/themes/english-certification/EnglishCertificationExamLayout.js +34 -1
- package/dist/components/themes/english-certification/EnglishCertificationFlagButton.js +15 -1
- package/dist/components/themes/english-certification/EnglishCertificationFooterBar.js +19 -1
- package/dist/components/themes/english-certification/EnglishCertificationGroupedQuestion.js +166 -1
- package/dist/components/themes/english-certification/EnglishCertificationHeader.js +31 -1
- package/dist/components/themes/english-certification/EnglishCertificationInstructionBanner.js +79 -1
- package/dist/components/themes/english-certification/EnglishCertificationNavigationPanel.js +71 -1
- package/dist/components/themes/english-certification/EnglishCertificationOptionSelector.js +79 -1
- package/dist/components/themes/english-certification/EnglishCertificationPartHeader.js +47 -1
- package/dist/components/themes/english-certification/EnglishCertificationPassagePanel.js +77 -1
- package/dist/components/themes/english-certification/EnglishCertificationQuestionCard.js +25 -1
- package/dist/components/themes/english-certification/EnglishCertificationQuestionItem.js +36 -1
- package/dist/components/themes/english-certification/EnglishCertificationQuestionRenderer.js +81 -1
- package/dist/components/themes/english-certification/EnglishCertificationReadingSection.js +95 -1
- package/dist/components/themes/english-certification/EnglishCertificationSingleQuestion.js +18 -1
- package/dist/components/themes/english-certification/EnglishCertificationSingleQuestionList.js +32 -1
- package/dist/components/themes/english-certification/english-cert-scroll.js +163 -1
- package/dist/components/themes/english-certification/english-certification-theme.js +58 -1
- package/dist/components/themes/english-certification/grouped-question-utils.js +243 -1
- package/dist/components/themes/english-certification/index.js +24 -1
- package/dist/components/themes/index.js +25 -1
- package/dist/components/themes/summer-sky/SummerSkyAudioPlayer.js +170 -1
- package/dist/components/themes/summer-sky/SummerSkyExitModal.js +21 -1
- package/dist/components/themes/summer-sky/SummerSkyLayout.js +221 -1
- package/dist/components/themes/summer-sky/SummerSkySubmitModal.js +18 -1
- package/dist/components/themes/summer-sky/SummerSkyWaitingRoom.js +193 -1
- package/dist/components/themes/types.js +1 -1
- package/dist/components/ui/alert-dialog.js +26 -1
- package/dist/components/ui/alert.js +22 -1
- package/dist/components/ui/avatar.js +12 -1
- package/dist/components/ui/badge.js +38 -1
- package/dist/components/ui/button.js +35 -1
- package/dist/components/ui/calendar.js +76 -1
- package/dist/components/ui/card.js +16 -1
- package/dist/components/ui/carousel.js +91 -1
- package/dist/components/ui/checkbox.js +9 -1
- package/dist/components/ui/collapsible.js +13 -1
- package/dist/components/ui/command.js +34 -1
- package/dist/components/ui/confirm-dialog.js +49 -1
- package/dist/components/ui/dialog.js +23 -1
- package/dist/components/ui/drawer.js +35 -1
- package/dist/components/ui/dropdown-menu.js +33 -1
- package/dist/components/ui/file-upload.js +155 -1
- package/dist/components/ui/form.js +62 -1
- package/dist/components/ui/hover-card.js +10 -1
- package/dist/components/ui/image-preview.js +29 -1
- package/dist/components/ui/input.js +8 -1
- package/dist/components/ui/label.js +9 -1
- package/dist/components/ui/language-switcher.js +15 -1
- package/dist/components/ui/multi-select.js +90 -1
- package/dist/components/ui/points-input.js +33 -1
- package/dist/components/ui/popover.js +26 -1
- package/dist/components/ui/progress.js +16 -1
- package/dist/components/ui/radio-group.js +12 -1
- package/dist/components/ui/scroll-area.js +11 -1
- package/dist/components/ui/select.js +38 -1
- package/dist/components/ui/separator.js +8 -1
- package/dist/components/ui/sheet.js +40 -1
- package/dist/components/ui/single-select.js +76 -1
- package/dist/components/ui/skeleton.js +6 -1
- package/dist/components/ui/switch.js +8 -1
- package/dist/components/ui/table.js +20 -1
- package/dist/components/ui/tabs.js +17 -1
- package/dist/components/ui/textarea.js +8 -1
- package/dist/components/ui/tooltip.js +11 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +24 -1
- package/dist/shared/constants/ApiConstant.d.ts +1 -0
- package/dist/shared/constants/ApiConstant.js +278 -1
- package/dist/shared/constants/QueryKeyConstant.js +112 -1
- package/dist/shared/constants/exam-level.enum.js +41 -1
- package/dist/shared/constants/landings/placement-test.constants.js +431 -1
- package/dist/shared/constants/question-skills.js +277 -1
- package/dist/shared/constants/routes.js +81 -1
- package/dist/shared/index.js +10 -1
- package/dist/shared/lib/hooks/index.js +10 -1
- package/dist/shared/lib/hooks/useAlertDialog.js +57 -1
- package/dist/shared/lib/hooks/useAudioPlayCounter.js +30 -1
- package/dist/shared/lib/hooks/useAudioPreview.js +81 -1
- package/dist/shared/lib/hooks/useAudioUpload.js +24 -1
- package/dist/shared/lib/hooks/useConfirmDialog.js +89 -1
- package/dist/shared/lib/hooks/useDebouncedCallback.js +32 -1
- package/dist/shared/lib/hooks/useDelayedAutoPlay.js +12 -1
- package/dist/shared/lib/hooks/useFileUpload.js +24 -1
- package/dist/shared/lib/hooks/useImageUrl.js +5 -1
- package/dist/shared/lib/hooks/usePresignedFileUrl.js +108 -1
- package/dist/shared/lib/hooks/useReactHookForm.js +31 -1
- package/dist/shared/lib/hooks/useToast.js +62 -1
- package/dist/shared/lib/html-content.js +22 -1
- package/dist/shared/lib/i18n/index.js +54 -1
- package/dist/shared/lib/i18n/messages/en/admin.d.ts +11 -4
- package/dist/shared/lib/i18n/messages/en/admin.js +2111 -1
- package/dist/shared/lib/i18n/messages/en/auth.js +86 -1
- package/dist/shared/lib/i18n/messages/en/common.js +140 -1
- package/dist/shared/lib/i18n/messages/en/file-upload.js +18 -1
- package/dist/shared/lib/i18n/messages/en/student.js +133 -1
- package/dist/shared/lib/i18n/messages/en/terms.js +37 -1
- package/dist/shared/lib/i18n/messages/en.d.ts +11 -4
- package/dist/shared/lib/i18n/messages/en.js +15 -1
- package/dist/shared/lib/i18n/messages/vi/admin.d.ts +11 -4
- package/dist/shared/lib/i18n/messages/vi/admin.js +2111 -1
- package/dist/shared/lib/i18n/messages/vi/auth.js +86 -1
- package/dist/shared/lib/i18n/messages/vi/common.js +140 -1
- package/dist/shared/lib/i18n/messages/vi/file-upload.js +18 -1
- package/dist/shared/lib/i18n/messages/vi/student.js +133 -1
- package/dist/shared/lib/i18n/messages/vi/terms.js +37 -1
- package/dist/shared/lib/i18n/messages/vi.d.ts +11 -4
- package/dist/shared/lib/i18n/messages/vi.js +15 -1
- package/dist/shared/lib/i18n/types.js +1 -1
- package/dist/shared/lib/stores/examQuestionStore.js +212 -1
- package/dist/shared/lib/stores/examTakingStore.js +240 -1
- package/dist/shared/lib/stores/gradingTransientStore.js +39 -1
- package/dist/shared/lib/stores/localeStore.js +10 -1
- package/dist/shared/lib/themes/config/starters.config.js +71 -1
- package/dist/shared/lib/themes/index.js +49 -1
- package/dist/shared/lib/themes/types.js +2 -1
- package/dist/shared/lib/toast.js +43 -1
- package/dist/shared/lib/utils/public-page.js +44 -1
- package/dist/shared/lib/utils/question-reverse-transform.js +438 -1
- package/dist/shared/lib/utils/question-transform-types.js +1 -1
- package/dist/shared/lib/utils/question-transform-validation.js +194 -1
- package/dist/shared/lib/utils/question-transform.js +199 -1
- package/dist/shared/lib/utils.js +168 -1
- package/dist/shared/lib/validation/choose-correct-answer.validation.js +111 -1
- package/dist/shared/lib/validation/label-the-picture.validation.js +19 -1
- package/dist/shared/lib/validation/listen-and-choose-from-answer-group.validation.js +46 -1
- package/dist/shared/lib/validation/listen-and-choose-objects-in-scene.validation.js +21 -1
- package/dist/shared/lib/validation/listen-and-drag-objects-into-scene.validation.js +34 -1
- package/dist/shared/lib/validation/listen-and-speak-answer.validation.js +40 -1
- package/dist/shared/lib/validation/listen-and-speak-compare-images.validation.js +45 -1
- package/dist/shared/lib/validation/listen-and-speak-image-group.validation.js +19 -1
- package/dist/shared/lib/validation/listen-and-speak-info-exchange.validation.js +39 -1
- package/dist/shared/lib/validation/listen-and-speak-odd-one-out.validation.js +32 -1
- package/dist/shared/lib/validation/listen-and-speak-question-list.validation.js +19 -1
- package/dist/shared/lib/validation/listen-and-speak-with-story-images.validation.js +28 -1
- package/dist/shared/lib/validation/look-picture-choose-correct-answer.validation.js +12 -1
- package/dist/shared/lib/validation/look-picture-fill-blank-choose-answer.validation.js +47 -1
- package/dist/shared/lib/validation/read-and-color-objects.validation.js +29 -1
- package/dist/shared/lib/validation/read-displayed-content.validation.js +28 -1
- package/dist/shared/lib/validation/speaking-conversation.validation.js +75 -1
- package/dist/shared/lib/validation/speaking-describe-image.validation.js +31 -1
- package/dist/shared/lib/validation/spontaneous-qa.validation.js +48 -1
- package/dist/shared/lib/validation/word-fill-paragraph-default.validation.js +38 -1
- package/dist/shared/lib/validation/word-fill-paragraph-with-options.validation.js +39 -1
- package/dist/shared/lib/validation/word-fill-paragraph.validation.js +43 -1
- package/dist/shared/lib/validation/word-ordering.validation.js +33 -1
- package/dist/shared/types/branch.types.js +6 -1
- package/dist/shared/types/common.types.js +49 -1
- package/dist/shared/types/entities/exam-schedule.types.js +5 -1
- package/dist/shared/types/entities/exam.types.js +1 -1
- package/dist/shared/types/entities/question.types.js +4 -1
- package/dist/shared/types/entities/result.types.js +4 -1
- package/dist/shared/types/entities/user.types.js +4 -1
- package/dist/shared/types/exam-taking.types.js +2 -1
- package/dist/shared/types/history.types.js +34 -1
- package/dist/shared/types/index.js +1 -1
- package/dist/shared/types/questions/choose-correct-adjective.js +4 -1
- package/dist/shared/types/questions/choose-the-correct-answer-group.d.ts +1 -0
- package/dist/shared/types/questions/choose-the-correct-answer-group.js +1 -1
- package/dist/shared/types/questions/choose-the-correct-answer.js +9 -1
- package/dist/shared/types/questions/cross-out-word-group.d.ts +2 -0
- package/dist/shared/types/questions/cross-out-word-group.js +1 -1
- package/dist/shared/types/questions/fill-missing-words-in-grid.js +11 -1
- package/dist/shared/types/questions/index.d.ts +1 -0
- package/dist/shared/types/questions/index.js +46 -1
- package/dist/shared/types/questions/listen-and-speak-answer.js +1 -1
- package/dist/shared/types/questions/listen-and-speak-compare-images.js +1 -1
- package/dist/shared/types/questions/listen-and-speak-image-group.js +1 -1
- package/dist/shared/types/questions/listen-and-speak-info-exchange.js +3 -1
- package/dist/shared/types/questions/listen-and-speak-odd-one-out.js +3 -1
- package/dist/shared/types/questions/listen-and-speak-question-list.js +1 -1
- package/dist/shared/types/questions/listen-and-speak-with-story-images.js +3 -1
- package/dist/shared/types/questions/look-picture-choose-correct-answer.js +5 -1
- package/dist/shared/types/questions/look-picture-fill-blank-choose-answer.js +9 -1
- package/dist/shared/types/questions/look-picture-fill-word-hint.js +7 -1
- package/dist/shared/types/questions/read-displayed-content.js +1 -1
- package/dist/shared/types/questions/speaking-conversation.js +7 -1
- package/dist/shared/types/questions/speaking-describe-image.js +1 -1
- package/dist/shared/types/questions/spontaneous-qa.js +1 -1
- package/dist/shared/types/questions/word-order-and-match-group.d.ts +33 -0
- package/dist/shared/types/questions/word-order-and-match-group.js +1 -0
- package/dist/shared/types/questions/write-correct-verb-form.js +12 -1
- package/dist/shared/types/role.types.js +1 -1
- package/dist/shared/types/structure-management.js +28 -1
- package/dist/shared/types/student.types.js +57 -1
- package/dist/shared/types/teacher-dashboard-rooms.js +2 -1
- package/package.json +184 -166
- package/dist/mcp/config.d.ts +0 -12
- package/dist/mcp/config.js +0 -1
- package/dist/mcp/http-client.d.ts +0 -6
- package/dist/mcp/http-client.js +0 -1
- package/dist/mcp/index.d.ts +0 -6
- package/dist/mcp/index.js +0 -2
- package/dist/mcp/tools/_helpers.d.ts +0 -4
- package/dist/mcp/tools/_helpers.js +0 -1
- package/dist/mcp/tools/exams.d.ts +0 -2
- package/dist/mcp/tools/exams.js +0 -1
- package/dist/mcp/tools/index.d.ts +0 -2
- package/dist/mcp/tools/index.js +0 -1
- package/dist/mcp/tools/results.d.ts +0 -2
- package/dist/mcp/tools/results.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Question } from '../../../shared/types/entities/question.types';
|
|
2
|
-
export declare function SpontaneousQaGroupViewer({ question }: {
|
|
2
|
+
export declare function SpontaneousQaGroupViewer({ question, isReviewMode, }: {
|
|
3
3
|
question: Question;
|
|
4
|
+
isReviewMode?: boolean;
|
|
4
5
|
}): import("react").JSX.Element;
|
|
@@ -1 +1,82 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
function isRecord(value) {
|
|
4
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
5
|
+
}
|
|
6
|
+
function asRecord(value) {
|
|
7
|
+
return isRecord(value) ? value : {};
|
|
8
|
+
}
|
|
9
|
+
function asString(value, fallback = '') {
|
|
10
|
+
return typeof value === 'string' ? value : fallback;
|
|
11
|
+
}
|
|
12
|
+
function mapItem(item, index) {
|
|
13
|
+
const record = asRecord(item);
|
|
14
|
+
const content = asRecord(record.content);
|
|
15
|
+
const correctAnswer = asRecord(record.correctAnswer);
|
|
16
|
+
const expected = Array.isArray(correctAnswer.expectedAnswers)
|
|
17
|
+
? correctAnswer.expectedAnswers.map((value) => String(value ?? ''))
|
|
18
|
+
: [];
|
|
19
|
+
return {
|
|
20
|
+
questionText: asString(content.questionText) ||
|
|
21
|
+
asString(content.question) ||
|
|
22
|
+
asString(record.questionText),
|
|
23
|
+
audioUrl: asString(content.audioUrl) || undefined,
|
|
24
|
+
expectedAnswers: expected,
|
|
25
|
+
isExample: record.isExample === true,
|
|
26
|
+
points: typeof record.points === 'number' ? record.points : 1,
|
|
27
|
+
questionNumber: typeof record.questionNumber === 'number' ? record.questionNumber : index + 1,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function isNestedPart(item) {
|
|
31
|
+
const record = asRecord(item);
|
|
32
|
+
return Array.isArray(record.questions);
|
|
33
|
+
}
|
|
34
|
+
function resolveGroup(question) {
|
|
35
|
+
const content = asRecord(question.content);
|
|
36
|
+
const list = asRecord(question.spontaneousQAList ?? content.spontaneousQAList ?? content);
|
|
37
|
+
const itemsRaw = Array.isArray(list.items)
|
|
38
|
+
? list.items
|
|
39
|
+
: Array.isArray(content.items)
|
|
40
|
+
? content.items
|
|
41
|
+
: [];
|
|
42
|
+
const instruction = asString(asRecord(list.meta).instruction) ||
|
|
43
|
+
asString(asRecord(content.meta).instruction) ||
|
|
44
|
+
asString(question.explanation) ||
|
|
45
|
+
'Talk about the topic.';
|
|
46
|
+
if (itemsRaw.some(isNestedPart)) {
|
|
47
|
+
return {
|
|
48
|
+
instruction,
|
|
49
|
+
parts: itemsRaw.map((item, index) => {
|
|
50
|
+
const record = asRecord(item);
|
|
51
|
+
const questions = Array.isArray(record.questions)
|
|
52
|
+
? record.questions.map(mapItem)
|
|
53
|
+
: [];
|
|
54
|
+
return {
|
|
55
|
+
partNumber: typeof record.partNumber === 'number' ? record.partNumber : index + 1,
|
|
56
|
+
partTitle: asString(record.partTitle) || `PART ${index + 1}`,
|
|
57
|
+
topic: asString(record.topic),
|
|
58
|
+
questions,
|
|
59
|
+
};
|
|
60
|
+
}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
instruction,
|
|
65
|
+
parts: [
|
|
66
|
+
{
|
|
67
|
+
partNumber: 1,
|
|
68
|
+
partTitle: '',
|
|
69
|
+
topic: '',
|
|
70
|
+
questions: itemsRaw.map(mapItem),
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function QaPromptCard({ item, index }) {
|
|
76
|
+
return (_jsxs("div", { className: "overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-gray-100 bg-gray-50 px-4 py-2.5", children: [_jsxs("span", { className: "text-sm font-medium text-gray-700", children: ["C\u00E2u ", item.questionNumber || index + 1] }), _jsxs("span", { className: "text-xs text-gray-500", children: [item.points || 0, " \u0111i\u1EC3m"] })] }), _jsxs("div", { className: "space-y-2 p-4", children: [_jsx("p", { className: "text-sm font-semibold text-gray-800", children: item.questionText || 'Câu hỏi chưa được nhập' }), item.audioUrl ? (_jsxs("p", { className: "text-xs text-gray-500", children: ["Audio: ", item.audioUrl] })) : null, item.expectedAnswers.length > 0 ? (_jsxs("div", { className: "rounded-lg border border-emerald-100 bg-emerald-50 px-3 py-2 text-sm text-emerald-800", children: [_jsx("p", { className: "mb-1 font-medium", children: "G\u1EE3i \u00FD \u0111\u00E1p \u00E1n" }), _jsx("ul", { className: "list-disc space-y-1 pl-4", children: item.expectedAnswers.map((answer) => (_jsx("li", { children: answer }, answer))) })] })) : null] })] }));
|
|
77
|
+
}
|
|
78
|
+
export function SpontaneousQaGroupViewer({ question, isReviewMode, }) {
|
|
79
|
+
const { instruction, parts } = resolveGroup(question);
|
|
80
|
+
const showPartChrome = parts.length > 1 || parts.some((part) => part.partTitle || part.topic);
|
|
81
|
+
return (_jsxs("div", { className: "space-y-5", children: [instruction ? (_jsx("div", { className: "rounded-xl border border-indigo-100 bg-indigo-50 px-4 py-3 text-sm font-medium text-indigo-800", children: instruction })) : null, parts.map((part) => (_jsxs("section", { className: "space-y-3", children: [showPartChrome ? (_jsxs("div", { children: [part.partTitle ? (_jsx("h3", { className: "text-base font-bold tracking-wide text-sky-600", children: part.partTitle })) : null, part.topic ? (_jsx("p", { className: "text-sm font-semibold text-slate-600", children: part.topic })) : null] })) : null, _jsx("div", { className: "space-y-3", children: part.questions.map((item, index) => (_jsx(QaPromptCard, { item: item, index: index }, `${part.partNumber}-${item.questionNumber}-${index}`))) })] }, `part-${part.partNumber}`)))] }));
|
|
82
|
+
}
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { TrueFalseGroupClient } from '../types/true-false-group/TrueFalseGroupClient';
|
|
4
|
+
import { mapQuestionToTrueFalseGroupData } from '../types/true-false-group/map-true-false-group-data';
|
|
5
|
+
export function TrueFalseGroupViewer({ question, isReviewMode = false, userAnswer, }) {
|
|
6
|
+
const questionData = mapQuestionToTrueFalseGroupData(question);
|
|
7
|
+
const reviewAnswers = isReviewMode && !userAnswer
|
|
8
|
+
? questionData.items.map((item) => item.correctAnswer)
|
|
9
|
+
: userAnswer;
|
|
10
|
+
return (_jsx(TrueFalseGroupClient, { questionData: questionData, isReviewMode: isReviewMode, userAnswers: reviewAnswers }));
|
|
11
|
+
}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { WordFillStructuredFormClient } from '../types/word-fill-structured-form/WordFillStructuredFormClient';
|
|
5
|
+
import { mapQuestionToWfsfData } from '../types/word-fill-structured-form/map-wfsf-question-data';
|
|
6
|
+
export function WordFillStructuredFormViewer({ question, isReviewMode = false, userAnswer, onSubmitAnswer, }) {
|
|
7
|
+
const questionData = mapQuestionToWfsfData(question);
|
|
8
|
+
const [draftAnswers, setDraftAnswers] = useState(() => userAnswer ?? {});
|
|
9
|
+
return (_jsx(WordFillStructuredFormClient, { questionData: questionData, isReviewMode: isReviewMode, userAnswer: userAnswer, autoFillCorrectAnswers: isReviewMode && !userAnswer, instruction: questionData.instruction, questionNumber: question.questionNumber, explanation: question.explanation, onAnswerChange: (key, value) => {
|
|
10
|
+
const next = { ...draftAnswers, [key]: value };
|
|
11
|
+
setDraftAnswers(next);
|
|
12
|
+
onSubmitAnswer?.(next);
|
|
13
|
+
} }));
|
|
14
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Question } from '../../../shared/types/entities/question.types';
|
|
2
|
-
export declare function WordOrderAndMatchGroupViewer({ question, }: {
|
|
2
|
+
export declare function WordOrderAndMatchGroupViewer({ question, isReviewMode, userAnswer, }: {
|
|
3
3
|
question: Question;
|
|
4
|
+
isReviewMode?: boolean;
|
|
5
|
+
userAnswer?: any;
|
|
4
6
|
}): import("react").JSX.Element;
|
|
@@ -1 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { WordOrderAndMatchGroupClient } from '../types/word-order-and-match-group/WordOrderAndMatchGroupClient';
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
6
|
+
}
|
|
7
|
+
function asRecord(value) {
|
|
8
|
+
return isRecord(value) ? value : {};
|
|
9
|
+
}
|
|
10
|
+
function asString(value, fallback = '') {
|
|
11
|
+
return typeof value === 'string' ? value : fallback;
|
|
12
|
+
}
|
|
13
|
+
function mapItem(item, index, fallbackAnswer) {
|
|
14
|
+
const record = asRecord(item);
|
|
15
|
+
const content = asRecord(record.content);
|
|
16
|
+
const fb = asRecord(fallbackAnswer);
|
|
17
|
+
const correctAnswer = asRecord(record.correctAnswer ??
|
|
18
|
+
record.correct_answer ??
|
|
19
|
+
record.answer ??
|
|
20
|
+
fb.correctAnswer ??
|
|
21
|
+
fb.correct_answer ??
|
|
22
|
+
fb.answer ??
|
|
23
|
+
fb);
|
|
24
|
+
const words = Array.isArray(content.scrambledWords)
|
|
25
|
+
? content.scrambledWords.map((value) => String(value ?? ''))
|
|
26
|
+
: Array.isArray(record.scrambledWords)
|
|
27
|
+
? record.scrambledWords.map((value) => String(value ?? ''))
|
|
28
|
+
: [];
|
|
29
|
+
return {
|
|
30
|
+
scrambledWords: words,
|
|
31
|
+
orderedPhrase: asString(correctAnswer.orderedPhrase) ||
|
|
32
|
+
asString(record.orderedPhrase) ||
|
|
33
|
+
asString(fb.orderedPhrase),
|
|
34
|
+
matchLabel: asString(correctAnswer.matchLabel) ||
|
|
35
|
+
asString(record.matchLabel) ||
|
|
36
|
+
asString(fb.matchLabel) ||
|
|
37
|
+
'A',
|
|
38
|
+
isExample: record.isExample === true || record.is_example === true,
|
|
39
|
+
points: typeof record.points === 'number' ? record.points : 1,
|
|
40
|
+
questionNumber: typeof record.questionNumber === 'number' ? record.questionNumber : index + 1,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function resolveGroup(question) {
|
|
44
|
+
const content = asRecord(question.content);
|
|
45
|
+
const answer = asRecord(question.answer);
|
|
46
|
+
const correctAnswer = asRecord(question.correctAnswer ?? question.correct_answer);
|
|
47
|
+
const list = asRecord(question.wordOrderMatchList ??
|
|
48
|
+
content.wordOrderMatchList ??
|
|
49
|
+
answer.wordOrderMatchList ??
|
|
50
|
+
(content.items ? content : null) ??
|
|
51
|
+
(answer.items ? answer : null) ??
|
|
52
|
+
content);
|
|
53
|
+
const meta = asRecord(list.meta ?? content.meta ?? answer.meta);
|
|
54
|
+
const itemsRaw = Array.isArray(list.items)
|
|
55
|
+
? list.items
|
|
56
|
+
: Array.isArray(content.items)
|
|
57
|
+
? content.items
|
|
58
|
+
: Array.isArray(answer.items)
|
|
59
|
+
? answer.items
|
|
60
|
+
: [];
|
|
61
|
+
const answersRaw = Array.isArray(correctAnswer.answer)
|
|
62
|
+
? correctAnswer.answer
|
|
63
|
+
: Array.isArray(answer.answer)
|
|
64
|
+
? answer.answer
|
|
65
|
+
: [];
|
|
66
|
+
return {
|
|
67
|
+
instruction: asString(meta.instruction) ||
|
|
68
|
+
asString(answer.instruction) ||
|
|
69
|
+
asString(question.explanation) ||
|
|
70
|
+
'Put the phrases in order, then match the labels.',
|
|
71
|
+
matchOptions: Array.isArray(meta.matchOptions)
|
|
72
|
+
? meta.matchOptions.map((value) => String(value ?? ''))
|
|
73
|
+
: Array.isArray(answer.matchOptions)
|
|
74
|
+
? answer.matchOptions.map((value) => String(value ?? ''))
|
|
75
|
+
: ['A', 'B', 'C', 'D', 'E', 'F'],
|
|
76
|
+
items: itemsRaw.map((item, idx) => mapItem(item, idx, answersRaw[idx])),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export function WordOrderAndMatchGroupViewer({ question, isReviewMode = false, userAnswer, }) {
|
|
80
|
+
const { instruction, matchOptions, items } = resolveGroup(question);
|
|
81
|
+
const questionData = {
|
|
82
|
+
instruction,
|
|
83
|
+
matchOptions,
|
|
84
|
+
items,
|
|
85
|
+
};
|
|
86
|
+
const autoUserAnswers = isReviewMode
|
|
87
|
+
? items.map((item) => ({
|
|
88
|
+
orderedPhrase: item.orderedPhrase,
|
|
89
|
+
matchLabel: item.matchLabel,
|
|
90
|
+
}))
|
|
91
|
+
: Array.isArray(userAnswer)
|
|
92
|
+
? userAnswer
|
|
93
|
+
: undefined;
|
|
94
|
+
return (_jsx(WordOrderAndMatchGroupClient, { questionData: questionData, isReviewMode: isReviewMode, userAnswers: autoUserAnswers }));
|
|
95
|
+
}
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export{QuestionViewer}from
|
|
1
|
+
export { QuestionViewer } from './QuestionViewer';
|
|
2
|
+
export { QuestionGroupViewer } from './QuestionGroupViewer';
|
|
3
|
+
export { WordFillStructuredFormViewer } from './WordFillStructuredFormViewer';
|
|
4
|
+
export { ChooseTheCorrectAnswerGroupViewer } from './ChooseTheCorrectAnswerGroupViewer';
|
|
5
|
+
export { TrueFalseGroupViewer } from './TrueFalseGroupViewer';
|
|
6
|
+
export { CrossOutWordGroupViewer } from './CrossOutWordGroupViewer';
|
|
7
|
+
export { SpontaneousQaGroupViewer } from './SpontaneousQaGroupViewer';
|
|
8
|
+
export { WordOrderAndMatchGroupViewer } from './WordOrderAndMatchGroupViewer';
|
|
@@ -1 +1,220 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import { ChevronLeft, Download, Loader2, Sparkles } from 'lucide-react';
|
|
5
|
+
import { ResultTemplateType, } from '../../api/result-review';
|
|
6
|
+
import { useToast } from '../../shared/lib/hooks/useToast';
|
|
7
|
+
import { ReviewQuestionRenderer } from './ReviewQuestionRenderer';
|
|
8
|
+
import { useResultReviewPolling } from './hooks/useResultReviewPolling';
|
|
9
|
+
import { BadgeTitle } from './report/BadgeTitle';
|
|
10
|
+
import { OceanEduExamReport } from './report/OceanEduExamReport';
|
|
11
|
+
import { OverallAssessmentSection } from './report/OverallAssessmentSection';
|
|
12
|
+
import { ResultErrorState } from './report/ResultErrorState';
|
|
13
|
+
import { ResultLoadingState } from './report/ResultLoadingState';
|
|
14
|
+
import { ResultNotPublicState } from './report/ResultNotPublicState';
|
|
15
|
+
import { SpeakingRubricSection } from './report/SpeakingRubricSection';
|
|
16
|
+
import { SpeakingReviewResult } from './speaking/SpeakingReviewResult';
|
|
17
|
+
import { transformResultAnswersForReview } from './review-data';
|
|
18
|
+
import { isResultNotPublic, setPdfReady } from './review-status.utils';
|
|
19
|
+
import { unwrap } from './result-review.utils';
|
|
20
|
+
import { formatTotalScore } from './utils/review-score.utils';
|
|
21
|
+
import { transformSpeakingResultForReview } from './utils/transform-speaking-review';
|
|
22
|
+
const DEFAULT_RESULTS_PATH = '/student/contests/my-contests';
|
|
23
|
+
export var PartRubricTemplateCode;
|
|
24
|
+
(function (PartRubricTemplateCode) {
|
|
25
|
+
PartRubricTemplateCode["KINDY_VER3"] = "PLACEMENT_TEST_KINDY_VER3";
|
|
26
|
+
PartRubricTemplateCode["PRESCHOOL"] = "PLACEMENT_TEST_PRESCHOOL";
|
|
27
|
+
})(PartRubricTemplateCode || (PartRubricTemplateCode = {}));
|
|
28
|
+
const PART_RUBRIC_TEMPLATE_CODES = new Set(Object.values(PartRubricTemplateCode));
|
|
29
|
+
export function ResultReviewPageContainer({ attemptId, token, api, isPrintMode = false, canExportPdf = false, reviewUrl, assetBaseUrl, loginHref, onBack, onNavigate, topActionsSlot, beforeReportSlot, afterReportSlot, }) {
|
|
30
|
+
const { error: errorToast, success } = useToast();
|
|
31
|
+
const [detail, setDetail] = useState(null);
|
|
32
|
+
const [attempt, setAttempt] = useState(null);
|
|
33
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
34
|
+
const [loadError, setLoadError] = useState(null);
|
|
35
|
+
const [isExporting, setIsExporting] = useState(false);
|
|
36
|
+
const loadResult = useCallback(async (showSpinner) => {
|
|
37
|
+
if (showSpinner)
|
|
38
|
+
setIsLoading(true);
|
|
39
|
+
try {
|
|
40
|
+
const [detailResult, attemptResult] = await Promise.all([
|
|
41
|
+
api.getDetailedResult(attemptId, token),
|
|
42
|
+
api.getAttempt?.(attemptId, token),
|
|
43
|
+
]);
|
|
44
|
+
setDetail(unwrap(detailResult));
|
|
45
|
+
setAttempt(attemptResult ? unwrap(attemptResult) : null);
|
|
46
|
+
setLoadError(null);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
setLoadError(error);
|
|
50
|
+
if (!isResultNotPublic(error, Boolean(token))) {
|
|
51
|
+
errorToast({
|
|
52
|
+
message: 'Không thể tải kết quả',
|
|
53
|
+
description: error instanceof Error ? error.message : undefined,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
if (showSpinner)
|
|
59
|
+
setIsLoading(false);
|
|
60
|
+
}
|
|
61
|
+
}, [api, attemptId, token, errorToast]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
void loadResult(true);
|
|
64
|
+
}, [loadResult]);
|
|
65
|
+
const refetch = useCallback(() => void loadResult(false), [loadResult]);
|
|
66
|
+
const { hasPendingQuestions, hasPendingLlm, hasFailedLlm, retryLlm } = useResultReviewPolling({
|
|
67
|
+
detail,
|
|
68
|
+
isPrintMode,
|
|
69
|
+
isLoading,
|
|
70
|
+
onRefetch: refetch,
|
|
71
|
+
});
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (!isPrintMode || isLoading)
|
|
74
|
+
return undefined;
|
|
75
|
+
const raf = requestAnimationFrame(() => setPdfReady(true));
|
|
76
|
+
return () => {
|
|
77
|
+
cancelAnimationFrame(raf);
|
|
78
|
+
setPdfReady(false);
|
|
79
|
+
};
|
|
80
|
+
}, [isPrintMode, isLoading]);
|
|
81
|
+
const template = attempt?.exam?.template;
|
|
82
|
+
const templateParts = template?.parts;
|
|
83
|
+
const studentName = attempt?.studentName ?? 'Học sinh';
|
|
84
|
+
const studentCode = attempt?.studentUsername ?? null;
|
|
85
|
+
const branchName = attempt?.branchName ?? 'Chưa tham gia chi nhánh';
|
|
86
|
+
const examDateText = formatExamDate(detail?.submittedAt);
|
|
87
|
+
const canonicalReviewUrl = useMemo(() => buildReviewUrl(reviewUrl, token ?? attempt?.verificationToken), [reviewUrl, token, attempt?.verificationToken]);
|
|
88
|
+
const reviewData = useMemo(() => transformResultAnswersForReview(detail?.answers ?? [], templateParts), [detail?.answers, templateParts]);
|
|
89
|
+
const speakingReviewData = useMemo(() => detail && template?.type === ResultTemplateType.SPEAKING
|
|
90
|
+
? transformSpeakingResultForReview(detail, studentName, templateParts)
|
|
91
|
+
: null, [detail, studentName, template?.type, templateParts]);
|
|
92
|
+
const hidePerQuestionGrading = detail?.templateCode
|
|
93
|
+
? PART_RUBRIC_TEMPLATE_CODES.has(detail.templateCode)
|
|
94
|
+
: false;
|
|
95
|
+
const rubricScores = useMemo(() => buildRubricPartScores(detail), [detail?.speakingRubric]);
|
|
96
|
+
// Intercept browser back button to navigate to My Contests tab
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (typeof window === 'undefined')
|
|
99
|
+
return undefined;
|
|
100
|
+
window.history.pushState(null, '', window.location.href);
|
|
101
|
+
const handlePopState = () => {
|
|
102
|
+
if (onBack) {
|
|
103
|
+
onBack();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (onNavigate) {
|
|
107
|
+
onNavigate(DEFAULT_RESULTS_PATH);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
window.location.replace(DEFAULT_RESULTS_PATH);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
window.addEventListener('popstate', handlePopState);
|
|
114
|
+
return () => {
|
|
115
|
+
window.removeEventListener('popstate', handlePopState);
|
|
116
|
+
};
|
|
117
|
+
}, [onBack, onNavigate]);
|
|
118
|
+
const handleBack = useCallback(() => {
|
|
119
|
+
if (onBack)
|
|
120
|
+
return onBack();
|
|
121
|
+
if (onNavigate) {
|
|
122
|
+
onNavigate(DEFAULT_RESULTS_PATH);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (typeof window !== 'undefined')
|
|
126
|
+
window.location.href = DEFAULT_RESULTS_PATH;
|
|
127
|
+
}, [onBack, onNavigate]);
|
|
128
|
+
const handleExport = async () => {
|
|
129
|
+
if (!detail || !api.exportPdf)
|
|
130
|
+
return;
|
|
131
|
+
setIsExporting(true);
|
|
132
|
+
try {
|
|
133
|
+
const { blob, filename } = await api.exportPdf(attemptId, template?.type);
|
|
134
|
+
downloadBlob(blob, filename);
|
|
135
|
+
success({ message: 'Xuất PDF thành công' });
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
errorToast({
|
|
139
|
+
message: 'Không xuất được PDF',
|
|
140
|
+
description: error instanceof Error ? error.message : undefined,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
finally {
|
|
144
|
+
setIsExporting(false);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
if (isLoading)
|
|
148
|
+
return _jsx(ResultLoadingState, {});
|
|
149
|
+
if (isResultNotPublic(loadError, Boolean(token))) {
|
|
150
|
+
return _jsx(ResultNotPublicState, { loginHref: loginHref, assetBaseUrl: assetBaseUrl, onLogin: onNavigate });
|
|
151
|
+
}
|
|
152
|
+
if (!detail)
|
|
153
|
+
return _jsx(ResultErrorState, { error: loadError, onBack: handleBack });
|
|
154
|
+
if (speakingReviewData) {
|
|
155
|
+
return (_jsx(SpeakingReviewResult, { reviewData: speakingReviewData, studentName: studentName, studentCode: studentCode, branchName: branchName, examDateText: examDateText, examTitle: template?.title, showDetailedResults: detail.showDetailedResults, speakingRubric: detail.speakingRubric, reviewUrl: canonicalReviewUrl, assetBaseUrl: assetBaseUrl, canExportPdf: canExportPdf && Boolean(api.exportPdf), isExporting: isExporting, hasPendingQuestions: hasPendingQuestions, onBack: handleBack, onExportPdf: handleExport, topActionsSlot: topActionsSlot, beforeReportSlot: beforeReportSlot, afterReportSlot: afterReportSlot }));
|
|
156
|
+
}
|
|
157
|
+
return (_jsx("div", { className: "min-h-screen bg-[#e0e0e0] py-4 md:py-6", children: _jsxs("div", { className: "mx-auto flex w-full max-w-[1160px] flex-col gap-4 px-0 sm:px-4", children: [_jsx(ReviewToolbar, { onBack: handleBack, onExport: handleExport, canExport: canExportPdf && Boolean(api.exportPdf), isExporting: isExporting, topActionsSlot: topActionsSlot }), hasPendingQuestions ? _jsx(PendingGradingBanner, {}) : null, beforeReportSlot, _jsx(OceanEduExamReport, { studentName: studentName, studentCode: studentCode, branchName: branchName, examDateText: examDateText, totalScore: detail.totalScore, maxScore: detail.maxScore, isPendingGrading: Boolean(detail.isPendingGrading || hasPendingQuestions), examSubTitle: detail.roomName, examTitle: template?.title, reviewUrl: canonicalReviewUrl, assetBaseUrl: assetBaseUrl, readingScore: detail.readingScore, maxReadingScore: detail.maxReadingScore, listeningScore: detail.listeningScore, maxListeningScore: detail.maxListeningScore, writingScore: detail.writingScore, maxWritingScore: detail.maxWritingScore, speakingScore: detail.speakingScore, maxSpeakingScore: detail.maxSpeakingScore, overallAssessmentSlot: (_jsxs(_Fragment, { children: [_jsx(OverallAssessmentSection, { isPending: hasPendingLlm, isFailed: hasFailedLlm, onRetry: retryLlm, llmOverallAssessment: detail.llmOverallAssessment, llmSkillAssessment: detail.llmSkillAssessment, correctAnswers: detail.correctAnswers, totalQuestions: detail.totalQuestions }), detail.speakingRubric?.criteria?.length ? (_jsx(SpeakingRubricSection, { rubric: detail.speakingRubric })) : null] })), children: detail.showDetailedResults !== false ? (_jsx(AnswerSections, { reviewData: reviewData, hidePerQuestionGrading: hidePerQuestionGrading, rubricScores: rubricScores })) : null }), afterReportSlot] }) }));
|
|
158
|
+
}
|
|
159
|
+
function buildRubricPartScores(detail) {
|
|
160
|
+
const scores = {};
|
|
161
|
+
detail?.speakingRubric?.criteria?.forEach((criterion) => {
|
|
162
|
+
const match = /^C(\d+)$/.exec(criterion.code);
|
|
163
|
+
if (!match)
|
|
164
|
+
return;
|
|
165
|
+
const weighted = criterion.weightedScore != null && criterion.maxScore != null;
|
|
166
|
+
scores[Number(match[1])] = weighted
|
|
167
|
+
? { score: criterion.weightedScore, maxScore: criterion.maxScore, weighted }
|
|
168
|
+
: { score: criterion.score, maxScore: 5, weighted };
|
|
169
|
+
});
|
|
170
|
+
return scores;
|
|
171
|
+
}
|
|
172
|
+
function ReviewToolbar({ onBack, onExport, canExport, isExporting, topActionsSlot }) {
|
|
173
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-3 px-3 print:hidden sm:px-0", children: [_jsxs("button", { type: "button", onClick: onBack, className: "inline-flex items-center gap-2 rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-sm font-semibold text-slate-700 shadow-sm transition hover:bg-slate-50", children: [_jsx(ChevronLeft, { className: "h-4 w-4" }), "Quay l\u1EA1i"] }), _jsxs("div", { className: "flex items-center gap-3", children: [canExport ? (_jsxs("button", { type: "button", onClick: () => void onExport(), disabled: isExporting, className: "inline-flex items-center gap-2 rounded-xl bg-gradient-to-r from-[#00AEEF] to-[#0099D6] px-5 py-2.5 text-sm font-bold text-white shadow-lg disabled:opacity-50", children: [isExporting ? _jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : _jsx(Download, { className: "h-4 w-4" }), isExporting ? 'Đang xuất...' : 'Xuất PDF'] })) : null, topActionsSlot] })] }));
|
|
174
|
+
}
|
|
175
|
+
function PendingGradingBanner() {
|
|
176
|
+
return (_jsxs("div", { className: "mx-3 flex items-center gap-3 rounded-2xl border border-[#b3dfff] bg-gradient-to-r from-[#e8f6ff] to-[#f0f8ff] px-5 py-4 shadow-sm sm:mx-0", children: [_jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[#d0edff]", children: _jsx(Sparkles, { className: "h-5 w-5 animate-pulse text-[#00AEEF]" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-bold text-[#0054A6]", children: "AI \u0111ang ch\u1EA5m \u0111i\u1EC3m..." }), _jsx("p", { className: "text-xs text-[#0078c8]", children: "Trang s\u1EBD t\u1EF1 \u0111\u1ED9ng c\u1EADp nh\u1EADt cho \u0111\u1EBFn khi ho\u00E0n t\u1EA5t." })] })] }));
|
|
177
|
+
}
|
|
178
|
+
function AnswerSections({ reviewData, hidePerQuestionGrading, rubricScores }) {
|
|
179
|
+
return _jsx("div", { className: "space-y-6", children: reviewData.parts.map((part, index) => {
|
|
180
|
+
const rubricScore = hidePerQuestionGrading ? rubricScores[part.partNo] : undefined;
|
|
181
|
+
const score = reviewData.partScoresMap[index];
|
|
182
|
+
const scoreText = rubricScore
|
|
183
|
+
? `${rubricScore.weighted ? Number(rubricScore.score.toFixed(1)) : Math.round(rubricScore.score)} / ${Math.round(rubricScore.maxScore)}`
|
|
184
|
+
: score ? `${formatTotalScore(score.score)} / ${formatTotalScore(score.maxScore)}` : null;
|
|
185
|
+
return (_jsxs("section", { className: "relative rounded-[20px] border-2 border-[#00AEEF] bg-white px-5 pb-6 pt-11 md:px-8", children: [_jsx(BadgeTitle, { number: String(part.partNo), title: part.name || `PHẦN ${part.partNo}` }), _jsxs("div", { className: "mb-6 flex flex-col gap-4", children: [scoreText ? _jsx("div", { className: "flex justify-end", children: _jsxs("div", { className: "rounded-full bg-[#0054A6] px-4 py-2 text-sm font-bold text-white", children: ["\u0110i\u1EC3m: ", scoreText] }) }) : null, part.instructions ? _jsx(PartInstructions, { value: part.instructions }) : null] }), _jsx(ReviewQuestionRenderer, { part: part, reviewData: reviewData, hidePerQuestionGrading: hidePerQuestionGrading })] }, `${part.partId}-${index}`));
|
|
186
|
+
}) });
|
|
187
|
+
}
|
|
188
|
+
function PartInstructions({ value }) {
|
|
189
|
+
if (/<[a-z][\s\S]*>/i.test(value)) {
|
|
190
|
+
return _jsx("div", { className: "text-[17px] font-bold leading-relaxed text-[#0054A6] [&_p]:mb-2 [&_p:last-child]:mb-0", dangerouslySetInnerHTML: { __html: value } });
|
|
191
|
+
}
|
|
192
|
+
return _jsx("h3", { className: "text-[17px] font-bold leading-relaxed text-[#0054A6]", children: value });
|
|
193
|
+
}
|
|
194
|
+
function buildReviewUrl(explicitUrl, reviewToken) {
|
|
195
|
+
const source = explicitUrl ?? (typeof window !== 'undefined' ? window.location.href : undefined);
|
|
196
|
+
if (!source || !reviewToken)
|
|
197
|
+
return source;
|
|
198
|
+
try {
|
|
199
|
+
const url = new URL(source, typeof window !== 'undefined' ? window.location.origin : undefined);
|
|
200
|
+
url.searchParams.set('token', reviewToken);
|
|
201
|
+
return url.toString();
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return source;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function formatExamDate(value) {
|
|
208
|
+
const date = value ? new Date(value) : new Date();
|
|
209
|
+
return Number.isNaN(date.getTime()) ? new Date().toLocaleDateString('vi-VN') : date.toLocaleDateString('vi-VN');
|
|
210
|
+
}
|
|
211
|
+
function downloadBlob(blob, filename) {
|
|
212
|
+
const url = URL.createObjectURL(blob);
|
|
213
|
+
const link = document.createElement('a');
|
|
214
|
+
link.href = url;
|
|
215
|
+
link.download = filename;
|
|
216
|
+
document.body.appendChild(link);
|
|
217
|
+
link.click();
|
|
218
|
+
document.body.removeChild(link);
|
|
219
|
+
URL.revokeObjectURL(url);
|
|
220
|
+
}
|
|
@@ -1 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { QuestionExplanations } from './renderers/QuestionExplanations';
|
|
4
|
+
import { renderDedicatedReviewBody } from './renderers/review-question-body-dedicated';
|
|
5
|
+
import { renderMoversReviewBody } from './renderers/review-question-body-movers';
|
|
6
|
+
const SPEAKING_QUESTION_TYPES = new Set([
|
|
7
|
+
'READ_DISPLAYED_CONTENT',
|
|
8
|
+
'SPEAKING_DESCRIBE_IMAGE',
|
|
9
|
+
'SPEAKING_CUE_CARD',
|
|
10
|
+
'SPONTANEOUS_QA',
|
|
11
|
+
'SPONTANEOUS_QA_GROUP',
|
|
12
|
+
'LISTEN_AND_SPEAK_ANSWER',
|
|
13
|
+
'LISTEN_AND_SPEAK_IMAGE_GROUP',
|
|
14
|
+
'LISTEN_AND_SPEAK_QUESTION_LIST',
|
|
15
|
+
'LISTEN_AND_SPEAK_COMPARE_IMAGES',
|
|
16
|
+
'LISTEN_AND_SPEAK_WITH_STORY_IMAGES',
|
|
17
|
+
'LISTEN_AND_SPEAK_INFO_EXCHANGE',
|
|
18
|
+
'LISTEN_AND_SPEAK_ODD_ONE_OUT',
|
|
19
|
+
]);
|
|
20
|
+
export function ReviewQuestionRenderer(props) {
|
|
21
|
+
const { part } = props;
|
|
22
|
+
const explanationItems = part.questions.map((question) => ({
|
|
23
|
+
id: question.id,
|
|
24
|
+
questionNumber: question.question_number,
|
|
25
|
+
explanation: question.explanation ?? null,
|
|
26
|
+
}));
|
|
27
|
+
return (_jsxs(_Fragment, { children: [renderQuestionBody(props), !SPEAKING_QUESTION_TYPES.has(part.questionType) && (_jsx(QuestionExplanations, { items: explanationItems }))] }));
|
|
28
|
+
}
|
|
29
|
+
function renderQuestionBody({ part, reviewData, hidePerQuestionGrading = false, }) {
|
|
30
|
+
const dedicated = renderDedicatedReviewBody({
|
|
31
|
+
part,
|
|
32
|
+
answers: reviewData.studentAnswers,
|
|
33
|
+
isCorrectMap: reviewData.isCorrectMap,
|
|
34
|
+
correctAnswerTextMap: reviewData.correctAnswerTextMap,
|
|
35
|
+
correctOptionIdMap: reviewData.correctOptionIdMap,
|
|
36
|
+
rawCorrectAnswerMap: reviewData.rawCorrectAnswerMap,
|
|
37
|
+
questionScoreMap: reviewData.questionScoreMap,
|
|
38
|
+
hidePerQuestionGrading,
|
|
39
|
+
});
|
|
40
|
+
if (dedicated)
|
|
41
|
+
return dedicated;
|
|
42
|
+
const movers = renderMoversReviewBody({
|
|
43
|
+
part,
|
|
44
|
+
answers: reviewData.studentAnswers,
|
|
45
|
+
isCorrectMap: reviewData.isCorrectMap,
|
|
46
|
+
correctAnswerTextMap: reviewData.correctAnswerTextMap,
|
|
47
|
+
correctOptionIdMap: reviewData.correctOptionIdMap,
|
|
48
|
+
cellAnswersMap: reviewData.cellAnswersMap,
|
|
49
|
+
essayGradingMap: reviewData.essayGradingMap,
|
|
50
|
+
rawCorrectAnswerMap: reviewData.rawCorrectAnswerMap,
|
|
51
|
+
});
|
|
52
|
+
if (movers)
|
|
53
|
+
return movers;
|
|
54
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center", children: _jsxs("div", { className: "text-center", children: [_jsx("p", { className: "text-lg font-semibold text-red-500", children: "Unsupported question type" }), _jsx("p", { className: "mt-2 text-gray-500", children: part.questionType })] }) }));
|
|
55
|
+
}
|
|
@@ -1 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
/** Default poll cadence for pending grading (5 seconds). */
|
|
4
|
+
const DEFAULT_INTERVAL_MS = 5000;
|
|
5
|
+
/**
|
|
6
|
+
* How long the assessment may stay absent before we call it failed.
|
|
7
|
+
*
|
|
8
|
+
* The backend retries the LLM job 3x with exponential backoff (5s/10s/20s) on
|
|
9
|
+
* top of the model call itself, so this must comfortably exceed that total —
|
|
10
|
+
* otherwise a run that would have succeeded gets reported as failed.
|
|
11
|
+
*/
|
|
12
|
+
const DEFAULT_LLM_TIMEOUT_MS = 120000;
|
|
13
|
+
/**
|
|
14
|
+
* Grading statuses that mean an answer is still being processed. `FAILED` is
|
|
15
|
+
* terminal and deliberately excluded — polling on it never converges.
|
|
16
|
+
*/
|
|
17
|
+
const POLLABLE_STATUSES = new Set(['PENDING', 'QUEUED', 'PROCESSING']);
|
|
18
|
+
function hasPendingGrading(answers) {
|
|
19
|
+
if (!answers)
|
|
20
|
+
return false;
|
|
21
|
+
return answers.some((answer) => answer.gradingStatus != null && POLLABLE_STATUSES.has(answer.gradingStatus));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* An empty `llmSkillAssessment` object is not an assessment: the generator can
|
|
25
|
+
* legitimately persist `{}` when no skill has a percentage, so treat it the same
|
|
26
|
+
* as absent rather than rendering an empty table.
|
|
27
|
+
*/
|
|
28
|
+
function hasLlmAssessmentData(detail) {
|
|
29
|
+
if (!detail)
|
|
30
|
+
return false;
|
|
31
|
+
if (detail.llmOverallAssessment)
|
|
32
|
+
return true;
|
|
33
|
+
const skills = detail.llmSkillAssessment;
|
|
34
|
+
return Boolean(skills && Object.values(skills).some((skill) => Boolean(skill)));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Polls the result endpoint while any answer is still being graded or the LLM
|
|
38
|
+
* assessment hasn't been generated yet. Ports the host app's behaviour: polling
|
|
39
|
+
* is suppressed in print mode so the headless PDF renderer reaches an idle state.
|
|
40
|
+
*
|
|
41
|
+
* A missing assessment is indistinguishable from a failed one — the API exposes
|
|
42
|
+
* no status for it — so the wait is bounded by `llmTimeoutMs` and reported as
|
|
43
|
+
* `hasFailedLlm` once it elapses, instead of polling forever.
|
|
44
|
+
*/
|
|
45
|
+
export function useResultReviewPolling({ detail, isPrintMode, isLoading, intervalMs = DEFAULT_INTERVAL_MS, llmTimeoutMs = DEFAULT_LLM_TIMEOUT_MS, onRefetch, }) {
|
|
46
|
+
const hasPendingQuestions = hasPendingGrading(detail?.answers);
|
|
47
|
+
const isAwaitingLlm = Boolean(detail) && !hasLlmAssessmentData(detail);
|
|
48
|
+
const [llmWaitExpired, setLlmWaitExpired] = useState(false);
|
|
49
|
+
const [retryNonce, setRetryNonce] = useState(0);
|
|
50
|
+
const onRefetchRef = useRef(onRefetch);
|
|
51
|
+
onRefetchRef.current = onRefetch;
|
|
52
|
+
// Bound the assessment wait. `isAwaitingLlm` is a boolean, so this timer keeps
|
|
53
|
+
// running across refetches and only resets when the assessment arrives (or the
|
|
54
|
+
// user retries) — it is a deadline on the wait, not on each poll.
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
setLlmWaitExpired(false);
|
|
57
|
+
if (!isAwaitingLlm || isPrintMode || isLoading)
|
|
58
|
+
return undefined;
|
|
59
|
+
const timer = setTimeout(() => setLlmWaitExpired(true), llmTimeoutMs);
|
|
60
|
+
return () => clearTimeout(timer);
|
|
61
|
+
}, [isAwaitingLlm, isPrintMode, isLoading, llmTimeoutMs, retryNonce]);
|
|
62
|
+
const hasPendingLlm = isAwaitingLlm && !llmWaitExpired;
|
|
63
|
+
const hasFailedLlm = isAwaitingLlm && llmWaitExpired;
|
|
64
|
+
const isPolling = !isPrintMode && !isLoading && (hasPendingQuestions || hasPendingLlm);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!isPolling)
|
|
67
|
+
return undefined;
|
|
68
|
+
const timer = setInterval(() => onRefetchRef.current(), intervalMs);
|
|
69
|
+
return () => clearInterval(timer);
|
|
70
|
+
}, [intervalMs, isPolling]);
|
|
71
|
+
const retryLlm = useCallback(() => {
|
|
72
|
+
setRetryNonce((nonce) => nonce + 1);
|
|
73
|
+
onRefetchRef.current();
|
|
74
|
+
}, []);
|
|
75
|
+
return { hasPendingQuestions, hasPendingLlm, hasFailedLlm, isPolling, retryLlm };
|
|
76
|
+
}
|