@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 +1,90 @@
|
|
|
1
|
-
|
|
1
|
+
// ─── Registration imports ───────────────────────────────────────────────────
|
|
2
|
+
import { fillInBlankRegistration } from '../types/fill-in-blank/register';
|
|
3
|
+
import { arrangeLettersIntoWordsRegistration } from '../types/arrange-letters-into-words/register';
|
|
4
|
+
import { writeShortParagraphRegistration } from '../types/write-short-paragraph/register';
|
|
5
|
+
import { fillMissingWordsInGridRegistration } from '../types/fill-missing-words-in-grid/register';
|
|
6
|
+
import { lookPictureChooseCorrectAnswerRegistration } from '../types/look-picture-choose-correct-answer/register';
|
|
7
|
+
import { lookPictureFillBlankChooseAnswerRegistration } from '../types/look-picture-fill-blank-choose-answer/register';
|
|
8
|
+
import { lookPictureFillWordHintRegistration } from '../types/look-picture-fill-word-hint/register';
|
|
9
|
+
import { labelThePictureRegistration } from '../types/label-the-picture/register';
|
|
10
|
+
import { readAndColorObjectsRegistration } from '../types/read-and-color-objects/register';
|
|
11
|
+
import { imageObjectMatchingRegistration } from '../types/image-object-matching/register';
|
|
12
|
+
import { readPassageAndAnswerQuestionsRegistration } from '../types/read-passage-and-answer-questions/register';
|
|
13
|
+
import { chooseTheCorrectAnswerRegistration } from '../types/choose-the-correct-answer/register';
|
|
14
|
+
import { chooseTheCorrectAnswerGroupRegistration } from '../types/choose-the-correct-answer-group/register';
|
|
15
|
+
import { trueFalseGroupRegistration } from '../types/true-false-group/register';
|
|
16
|
+
import { crossOutWordGroupRegistration } from '../types/cross-out-word-group/register';
|
|
17
|
+
import { writeAShortLetterRegistration } from '../types/write-a-short-letter/register';
|
|
18
|
+
import { writeCorrectVerbFormRegistration } from '../types/write-correct-verb-form/register';
|
|
19
|
+
import { chooseCorrectAdjectiveRegistration } from '../types/choose-correct-adjective/register';
|
|
20
|
+
import { answerTheQuestionRegistration } from '../types/answer-the-question/register';
|
|
21
|
+
import { trueFalseRegistration } from '../types/true-false/register';
|
|
22
|
+
import { wordOrderingRegistration } from '../types/word-ordering/register';
|
|
23
|
+
import { wordFillParagraphRegistration } from '../types/word-fill-paragraph/register';
|
|
24
|
+
import { matchByWritingAnswerRegistration } from '../types/match-by-writing-answer/register';
|
|
25
|
+
import { writeSentencesRegistration } from '../types/write-sentences/register';
|
|
26
|
+
import { listenAndChooseFromAnswerGroupRegistration } from '../types/listen-and-choose-from-answer-group/register';
|
|
27
|
+
import { listenAndChooseObjectsInSceneRegistration } from '../types/listen-and-choose-objects-in-scene/register';
|
|
28
|
+
import { listenAndDragObjectsIntoSceneRegistration } from '../types/listen-and-drag-objects-into-scene/register';
|
|
29
|
+
import { listenAndSpeakAnswerRegistration } from '../types/listen-and-speak-answer/register';
|
|
30
|
+
import { listenAndSpeakImageGroupRegistration } from '../types/listen-and-speak-image-group/register';
|
|
31
|
+
import { listenAndSpeakQuestionListRegistration } from '../types/listen-and-speak-question-list/register';
|
|
32
|
+
import { ListenAndSpeakCompareImagesRegistration } from '../types/listen-and-speak-compare-images/register';
|
|
33
|
+
import { listenAndSpeakWithStoryImagesRegistration } from '../types/listen-and-speak-with-story-images/register';
|
|
34
|
+
import { listenAndSpeakOddOneOutRegistration } from '../types/listen-and-speak-odd-one-out/register';
|
|
35
|
+
import { listenAndSpeakInfoExchangeRegistration } from '../types/listen-and-speak-info-exchange/register';
|
|
36
|
+
import { speakingDescribeImageRegistration } from '../types/speaking-describe-image/register';
|
|
37
|
+
import { spontaneousQARegistration } from '../types/spontaneous-qa/register';
|
|
38
|
+
import { spontaneousQaGroupRegistration } from '../types/spontaneous-qa-group/register';
|
|
39
|
+
import { readDisplayedContentRegistration } from '../types/read-displayed-content/register';
|
|
40
|
+
import { speakingConversationRegistration } from '../types/speaking-conversation/register';
|
|
41
|
+
import { gnSpeakingInterviewRegistration } from '../types/gn-speaking-interview/register';
|
|
42
|
+
import { speakingCueCardRegistration } from '../types/speaking-cue-card/register';
|
|
43
|
+
import { wordFillStructuredFormRegistration } from '../types/word-fill-structured-form/register';
|
|
44
|
+
import { wordOrderAndMatchGroupRegistration } from '../types/word-order-and-match-group/register';
|
|
45
|
+
// ─── Registry map ───────────────────────────────────────────────────────────
|
|
46
|
+
export const questionTypeRegistry = {
|
|
47
|
+
CHOOSE_THE_CORRECT_ANSWER: chooseTheCorrectAnswerRegistration,
|
|
48
|
+
CHOOSE_THE_CORRECT_ANSWER_GROUP: chooseTheCorrectAnswerGroupRegistration,
|
|
49
|
+
TRUE_FALSE_GROUP: trueFalseGroupRegistration,
|
|
50
|
+
CROSS_OUT_WORD_GROUP: crossOutWordGroupRegistration,
|
|
51
|
+
WORD_ORDER_AND_MATCH_GROUP: wordOrderAndMatchGroupRegistration,
|
|
52
|
+
FILL_IN_BLANK: fillInBlankRegistration,
|
|
53
|
+
ARRANGE_LETTERS_INTO_WORDS: arrangeLettersIntoWordsRegistration,
|
|
54
|
+
WRITE_SHORT_PARAGRAPH: writeShortParagraphRegistration,
|
|
55
|
+
FILL_MISSING_WORDS_IN_GRID: fillMissingWordsInGridRegistration,
|
|
56
|
+
LOOK_PICTURE_CHOOSE_CORRECT_ANSWER: lookPictureChooseCorrectAnswerRegistration,
|
|
57
|
+
LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER: lookPictureFillBlankChooseAnswerRegistration,
|
|
58
|
+
LOOK_PICTURE_FILL_WORD_HINT: lookPictureFillWordHintRegistration,
|
|
59
|
+
LABEL_THE_PICTURE: labelThePictureRegistration,
|
|
60
|
+
READ_AND_COLOR_OBJECTS: readAndColorObjectsRegistration,
|
|
61
|
+
IMAGE_OBJECT_MATCHING: imageObjectMatchingRegistration,
|
|
62
|
+
READ_PASSAGE_AND_ANSWER_QUESTIONS: readPassageAndAnswerQuestionsRegistration,
|
|
63
|
+
WRITE_A_SHORT_LETTER: writeAShortLetterRegistration,
|
|
64
|
+
WRITE_CORRECT_VERB_FORM: writeCorrectVerbFormRegistration,
|
|
65
|
+
CHOOSE_CORRECT_ADJECTIVE: chooseCorrectAdjectiveRegistration,
|
|
66
|
+
ANSWER_THE_QUESTION: answerTheQuestionRegistration,
|
|
67
|
+
TRUE_FALSE: trueFalseRegistration,
|
|
68
|
+
WORD_ORDERING: wordOrderingRegistration,
|
|
69
|
+
WORD_FILL_PARAGRAPH: wordFillParagraphRegistration, // Will need to handle viewMode mapping either here or in wrapper
|
|
70
|
+
MATCH_BY_WRITING_ANSWER: matchByWritingAnswerRegistration,
|
|
71
|
+
WRITE_SENTENCES: writeSentencesRegistration,
|
|
72
|
+
LISTEN_AND_CHOOSE_FROM_ANSWER_GROUP: listenAndChooseFromAnswerGroupRegistration,
|
|
73
|
+
LISTEN_AND_CHOOSE_OBJECTS_IN_SCENE: listenAndChooseObjectsInSceneRegistration,
|
|
74
|
+
LISTEN_AND_DRAG_OBJECTS_INTO_SCENE: listenAndDragObjectsIntoSceneRegistration,
|
|
75
|
+
LISTEN_AND_SPEAK_ANSWER: listenAndSpeakAnswerRegistration,
|
|
76
|
+
LISTEN_AND_SPEAK_IMAGE_GROUP: listenAndSpeakImageGroupRegistration,
|
|
77
|
+
LISTEN_AND_SPEAK_QUESTION_LIST: listenAndSpeakQuestionListRegistration,
|
|
78
|
+
LISTEN_AND_SPEAK_COMPARE_IMAGES: ListenAndSpeakCompareImagesRegistration,
|
|
79
|
+
LISTEN_AND_SPEAK_WITH_STORY_IMAGES: listenAndSpeakWithStoryImagesRegistration,
|
|
80
|
+
LISTEN_AND_SPEAK_ODD_ONE_OUT: listenAndSpeakOddOneOutRegistration,
|
|
81
|
+
LISTEN_AND_SPEAK_INFO_EXCHANGE: listenAndSpeakInfoExchangeRegistration,
|
|
82
|
+
SPEAKING_DESCRIBE_IMAGE: speakingDescribeImageRegistration,
|
|
83
|
+
SPONTANEOUS_QA: spontaneousQARegistration,
|
|
84
|
+
SPONTANEOUS_QA_GROUP: spontaneousQaGroupRegistration,
|
|
85
|
+
READ_DISPLAYED_CONTENT: readDisplayedContentRegistration,
|
|
86
|
+
SPEAKING_CONVERSATION: speakingConversationRegistration,
|
|
87
|
+
GN_SPEAKING_INTERVIEW: gnSpeakingInterviewRegistration,
|
|
88
|
+
SPEAKING_CUE_CARD: speakingCueCardRegistration,
|
|
89
|
+
WORD_FILL_STRUCTURED_FORM: wordFillStructuredFormRegistration,
|
|
90
|
+
};
|
|
@@ -1 +1,121 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { useEditor, EditorContent } from '@tiptap/react';
|
|
5
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
6
|
+
import TextAlign from '@tiptap/extension-text-align';
|
|
7
|
+
import { ImagePreview } from '../../../components/ui/image-preview';
|
|
8
|
+
import { Input } from '../../../components/ui/input';
|
|
9
|
+
import { Label } from '../../../components/ui/label';
|
|
10
|
+
import { Card, CardContent, CardHeader, CardTitle } from '../../../components/ui/card';
|
|
11
|
+
import { FileUpload } from '../../../components/ui/file-upload';
|
|
12
|
+
import { ImageIcon, Layers, Type, FileText, PlusCircle, Trash2, Bold, Italic, Strikethrough, Heading1, Heading2, List, ListOrdered, AlignLeft, AlignCenter, AlignRight, Undo2, Redo2, } from 'lucide-react';
|
|
13
|
+
import { Button } from '../../../components/ui/button';
|
|
14
|
+
import { usePresignedFileUrl } from '../../../shared/lib/hooks';
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Toolbar helpers
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
function ToolbarBtn({ onClick, active, disabled, title, children, }) {
|
|
19
|
+
return (_jsx("button", { type: "button", title: title, onClick: onClick, disabled: disabled, className: `flex h-7 w-7 items-center justify-center rounded-md text-sm transition-colors
|
|
20
|
+
${active ? 'bg-teal-500 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-200 hover:text-gray-900'}
|
|
21
|
+
${disabled ? 'cursor-not-allowed opacity-40' : 'cursor-pointer'}
|
|
22
|
+
`, children: children }));
|
|
23
|
+
}
|
|
24
|
+
function ToolbarSep() {
|
|
25
|
+
return _jsx("div", { className: "mx-0.5 h-5 w-px shrink-0 bg-gray-300" });
|
|
26
|
+
}
|
|
27
|
+
function ArticleEditor({ value, onChange, isReadOnly = false }) {
|
|
28
|
+
const [mounted, setMounted] = useState(false);
|
|
29
|
+
const editor = useEditor({
|
|
30
|
+
immediatelyRender: false,
|
|
31
|
+
editable: !isReadOnly,
|
|
32
|
+
extensions: [
|
|
33
|
+
StarterKit,
|
|
34
|
+
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
|
35
|
+
],
|
|
36
|
+
content: value || '',
|
|
37
|
+
onUpdate: ({ editor }) => {
|
|
38
|
+
onChange(editor.getHTML());
|
|
39
|
+
},
|
|
40
|
+
editorProps: {
|
|
41
|
+
attributes: {
|
|
42
|
+
class: [
|
|
43
|
+
'focus:outline-none min-h-[120px] max-h-[400px] overflow-y-auto p-3 text-sm text-gray-800 leading-relaxed',
|
|
44
|
+
'prose prose-sm max-w-none',
|
|
45
|
+
'[&_h1]:text-xl [&_h1]:font-bold [&_h1]:mb-2',
|
|
46
|
+
'[&_h2]:text-lg [&_h2]:font-bold [&_h2]:mb-1.5',
|
|
47
|
+
'[&_ul]:list-disc [&_ul]:ml-5 [&_ol]:list-decimal [&_ol]:ml-5',
|
|
48
|
+
'[&_li]:mb-0.5',
|
|
49
|
+
'[&_strong]:font-bold [&_em]:italic [&_s]:line-through',
|
|
50
|
+
'[&_hr]:border-gray-300 [&_hr]:my-3',
|
|
51
|
+
isReadOnly ? 'bg-gray-50 cursor-not-allowed' : 'bg-white',
|
|
52
|
+
].join(' '),
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
useEffect(() => { setMounted(true); }, []);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (editor && value !== undefined && value !== editor.getHTML()) {
|
|
59
|
+
setTimeout(() => editor.commands.setContent(value, { emitUpdate: false }), 0);
|
|
60
|
+
}
|
|
61
|
+
}, [value, editor]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
editor?.setEditable(!isReadOnly);
|
|
64
|
+
}, [isReadOnly, editor]);
|
|
65
|
+
if (!mounted)
|
|
66
|
+
return null;
|
|
67
|
+
return (_jsxs("div", { className: `overflow-hidden rounded-sm border-2 transition-all ${isReadOnly
|
|
68
|
+
? 'border-gray-200 bg-gray-50'
|
|
69
|
+
: 'border-gray-200 bg-white focus-within:border-teal-400 focus-within:shadow-sm focus-within:shadow-teal-100'}`, children: [!isReadOnly && (_jsxs("div", { className: "flex flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50/80 px-2 py-1.5", children: [_jsx(ToolbarBtn, { title: "Ho\u00E0n t\u00E1c", onClick: () => editor?.chain().focus().undo().run(), disabled: !editor?.can().undo(), children: _jsx(Undo2, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "L\u00E0m l\u1EA1i", onClick: () => editor?.chain().focus().redo().run(), disabled: !editor?.can().redo(), children: _jsx(Redo2, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "Heading 1", active: editor?.isActive('heading', { level: 1 }), onClick: () => editor?.chain().focus().toggleHeading({ level: 1 }).run(), children: _jsx(Heading1, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "Heading 2", active: editor?.isActive('heading', { level: 2 }), onClick: () => editor?.chain().focus().toggleHeading({ level: 2 }).run(), children: _jsx(Heading2, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "In \u0111\u1EADm", active: editor?.isActive('bold'), onClick: () => editor?.chain().focus().toggleBold().run(), children: _jsx(Bold, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "In nghi\u00EAng", active: editor?.isActive('italic'), onClick: () => editor?.chain().focus().toggleItalic().run(), children: _jsx(Italic, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "G\u1EA1ch ngang", active: editor?.isActive('strike'), onClick: () => editor?.chain().focus().toggleStrike().run(), children: _jsx(Strikethrough, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "Danh s\u00E1ch ch\u1EA5m", active: editor?.isActive('bulletList'), onClick: () => editor?.chain().focus().toggleBulletList().run(), children: _jsx(List, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "Danh s\u00E1ch s\u1ED1", active: editor?.isActive('orderedList'), onClick: () => editor?.chain().focus().toggleOrderedList().run(), children: _jsx(ListOrdered, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "C\u0103n tr\u00E1i", active: editor?.isActive({ textAlign: 'left' }), onClick: () => editor?.chain().focus().setTextAlign('left').run(), children: _jsx(AlignLeft, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "C\u0103n gi\u1EEFa", active: editor?.isActive({ textAlign: 'center' }), onClick: () => editor?.chain().focus().setTextAlign('center').run(), children: _jsx(AlignCenter, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "C\u0103n ph\u1EA3i", active: editor?.isActive({ textAlign: 'right' }), onClick: () => editor?.chain().focus().setTextAlign('right').run(), children: _jsx(AlignRight, { className: "h-3.5 w-3.5" }) })] })), _jsx(EditorContent, { editor: editor })] }));
|
|
70
|
+
}
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// Sub-component: single article image preview with presigned URL
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
function ArticleImagePreview({ src, alt }) {
|
|
75
|
+
const { previewUrl } = usePresignedFileUrl(src);
|
|
76
|
+
const displayUrl = previewUrl || '';
|
|
77
|
+
if (!displayUrl)
|
|
78
|
+
return null;
|
|
79
|
+
return (_jsx(ImagePreview, { src: displayUrl, alt: alt, className: "mt-2 h-40 w-full max-w-xs rounded-lg border border-gray-200" }));
|
|
80
|
+
}
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// Component
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
/**
|
|
85
|
+
* `ArticlesGroupCard`
|
|
86
|
+
*
|
|
87
|
+
* Renders N article cards within a single group. Each article has:
|
|
88
|
+
* - name (e.g. "Ariel", "Clive", "Vicky")
|
|
89
|
+
* - content (textarea for the reading passage)
|
|
90
|
+
* - imageUrl (file upload for the person's photo)
|
|
91
|
+
*
|
|
92
|
+
* Used for question types that require multiple reading passages per group,
|
|
93
|
+
* such as KEY_FOR_SCHOOLS Reading Part 2.
|
|
94
|
+
*/
|
|
95
|
+
export function ArticlesGroupCard({ groupNumber, articleCount, articles, onArticlesChange, title = '', onTitleChange, isReadOnly = false, uploadIdPrefix = 'articles-group', }) {
|
|
96
|
+
// Use the articles array directly. If empty, fallback to articleCount
|
|
97
|
+
const displayArticles = articles.length > 0
|
|
98
|
+
? articles
|
|
99
|
+
: Array.from({ length: articleCount }, () => ({ name: '', content: '', imageUrl: '' }));
|
|
100
|
+
const handleFieldChange = (index, field, value) => {
|
|
101
|
+
if (isReadOnly)
|
|
102
|
+
return;
|
|
103
|
+
const updated = displayArticles.map((article, i) => i === index ? { ...article, [field]: value } : article);
|
|
104
|
+
onArticlesChange(updated);
|
|
105
|
+
};
|
|
106
|
+
const handleAddArticle = () => {
|
|
107
|
+
if (isReadOnly)
|
|
108
|
+
return;
|
|
109
|
+
onArticlesChange([...displayArticles, { name: '', content: '', imageUrl: '' }]);
|
|
110
|
+
};
|
|
111
|
+
const handleDeleteArticle = (index) => {
|
|
112
|
+
if (isReadOnly)
|
|
113
|
+
return;
|
|
114
|
+
const updated = displayArticles.filter((_, i) => i !== index);
|
|
115
|
+
onArticlesChange(updated);
|
|
116
|
+
};
|
|
117
|
+
return (_jsxs(Card, { className: "overflow-hidden border-0 bg-white shadow-lg shadow-teal-100/50", children: [_jsx("div", { className: "h-1.5 bg-gradient-to-r from-teal-500 via-emerald-500 to-green-500" }), _jsx(CardHeader, { className: "pb-4", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-teal-500 to-emerald-600 shadow-md", children: _jsx(Layers, { className: "h-5 w-5 text-white" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CardTitle, { className: "text-lg font-bold text-gray-900", children: "B\u00E0i vi\u1EBFt nh\u00F3m" }), _jsxs("span", { className: "inline-flex items-center rounded-full border border-teal-300 bg-teal-100 px-2.5 py-0.5 text-xs font-semibold text-teal-700", children: ["Nh\u00F3m ", groupNumber] }), _jsxs("span", { className: "inline-flex items-center rounded-full border border-emerald-200 bg-emerald-50 px-2.5 py-0.5 text-xs font-medium text-emerald-600", children: [articles.length || articleCount, " b\u00E0i vi\u1EBFt"] })] }), _jsxs("p", { className: "text-sm text-gray-500", children: ["Nh\u1EADp n\u1ED9i dung t\u1EEBng b\u00E0i vi\u1EBFt \u2014 d\u00F9ng chung cho t\u1EA5t c\u1EA3 c\u00E2u h\u1ECFi trong Nh\u00F3m ", groupNumber, ". B\u1EA1n c\u00F3 th\u1EC3 th\u00EAm ho\u1EB7c x\u00F3a b\u00E0i vi\u1EBFt."] })] })] }) }), _jsxs(CardContent, { className: "space-y-5", children: [_jsxs("div", { className: "space-y-2 pb-2", children: [_jsxs(Label, { htmlFor: `${uploadIdPrefix}-title`, className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(Type, { className: "h-4 w-4 text-teal-500" }), "Ti\u00EAu \u0111\u1EC1 nh\u00F3m b\u00E0i vi\u1EBFt", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), _jsx(Input, { id: `${uploadIdPrefix}-title`, value: title, onChange: (e) => onTitleChange?.(e.target.value), placeholder: "Nh\u1EADp ti\u00EAu \u0111\u1EC1 chung cho nh\u00F3m b\u00E0i vi\u1EBFt\u2026", readOnly: isReadOnly, className: `border-gray-200 bg-white transition-all focus:border-teal-300 focus:ring-teal-200 ${isReadOnly ? 'bg-gray-50 text-gray-500 cursor-not-allowed border-transparent focus:border-transparent focus:ring-0' : ''}` })] }), displayArticles.map((article, index) => {
|
|
118
|
+
const letter = String.fromCharCode(65 + index); // A, B, C...
|
|
119
|
+
return (_jsxs("div", { className: "rounded-xl border-2 border-gray-200 bg-gradient-to-r from-gray-50 to-slate-50 p-4 transition-all hover:border-teal-200 hover:shadow-sm", children: [_jsxs("div", { className: "mb-3 flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-lg bg-gradient-to-br from-teal-500 to-emerald-600 text-sm font-bold text-white shadow-sm", children: letter }), _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: ["B\u00E0i vi\u1EBFt ", index + 1] })] }), displayArticles.length > 1 && !isReadOnly && (_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => handleDeleteArticle(index), className: "h-8 w-8 p-0 text-red-500 hover:bg-red-50 hover:text-red-600", title: "X\u00F3a b\u00E0i vi\u1EBFt", children: _jsx(Trash2, { className: "h-4 w-4" }) }))] }), _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsxs(Label, { htmlFor: `${uploadIdPrefix}-name-${index}`, className: "flex items-center gap-1.5 text-sm font-medium text-gray-700", children: [_jsx(Type, { className: "h-3.5 w-3.5 text-teal-500" }), "T\u00EAn ng\u01B0\u1EDDi / ti\u00EAu \u0111\u1EC1"] }), _jsx(Input, { id: `${uploadIdPrefix}-name-${index}`, value: article.name, onChange: (e) => handleFieldChange(index, 'name', e.target.value), placeholder: `VD: Ariel, Clive, Vicky...`, readOnly: isReadOnly, className: `border-gray-200 bg-white transition-all focus:border-teal-300 focus:ring-teal-200 ${isReadOnly ? 'bg-gray-50 text-gray-500 cursor-not-allowed border-transparent focus:border-transparent focus:ring-0' : ''}` })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsxs(Label, { className: "flex items-center gap-1.5 text-sm font-medium text-gray-700", children: [_jsx(FileText, { className: "h-3.5 w-3.5 text-teal-500" }), "N\u1ED9i dung b\u00E0i vi\u1EBFt"] }), _jsx(ArticleEditor, { value: article.content, onChange: (html) => handleFieldChange(index, 'content', html), isReadOnly: isReadOnly })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsxs(Label, { className: "flex items-center gap-1.5 text-sm font-medium text-gray-700", children: [_jsx(ImageIcon, { className: "h-3.5 w-3.5 text-teal-500" }), "H\u00ECnh \u1EA3nh", ' ', _jsx("span", { className: "text-xs font-normal text-gray-400", children: "(T\u00F9y ch\u1ECDn)" })] }), !isReadOnly && (_jsx(FileUpload, { id: `${uploadIdPrefix}-image-${index}`, label: "", accept: "image/*", value: article.imageUrl, onChange: (url) => handleFieldChange(index, 'imageUrl', url), maxSize: 5, placeholder: "Upload \u1EA3nh ho\u1EB7c paste URL", autoUpload: true, prefix: "questions" })), article.imageUrl && (_jsx(ArticleImagePreview, { src: article.imageUrl, alt: `Article ${letter} image` }))] })] })] }, index));
|
|
120
|
+
}), !isReadOnly && (_jsxs(Button, { type: "button", variant: "outline", className: "w-full border-dashed border-teal-300 bg-teal-50/50 text-teal-700 hover:bg-teal-50 hover:text-teal-800 hover:border-teal-400", onClick: handleAddArticle, children: [_jsx(PlusCircle, { className: "mr-2 h-4 w-4" }), "Th\u00EAm b\u00E0i vi\u1EBFt"] }))] })] }));
|
|
121
|
+
}
|
|
@@ -1 +1,50 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ImagePreview } from '../../../components/ui/image-preview';
|
|
4
|
+
import { Input } from '../../../components/ui/input';
|
|
5
|
+
import { Label } from '../../../components/ui/label';
|
|
6
|
+
import { Textarea } from '../../../components/ui/textarea';
|
|
7
|
+
import { Card, CardContent, CardHeader, CardTitle } from '../../../components/ui/card';
|
|
8
|
+
import { FileUpload } from '../../../components/ui/file-upload';
|
|
9
|
+
import { ImageIcon, Layers, MessageSquare, Type } from 'lucide-react';
|
|
10
|
+
import { usePresignedFileUrl } from '../../../shared/lib/hooks';
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Component
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
/**
|
|
15
|
+
* `BasicQuestionGroupCard`
|
|
16
|
+
*
|
|
17
|
+
* The shared group header card used by:
|
|
18
|
+
* - ANSWER_THE_QUESTION
|
|
19
|
+
* - CHOOSE_THE_CORRECT_ANSWER
|
|
20
|
+
* - FILL_IN_BLANK
|
|
21
|
+
*
|
|
22
|
+
* It renders three optional fields that are **shared across all questions in
|
|
23
|
+
* the same group**: a title, a content/passage textarea, and an image upload.
|
|
24
|
+
*
|
|
25
|
+
* This component is **purely presentational** – all state lives in the parent
|
|
26
|
+
* (managed by `useBasicQuestionGroup`).
|
|
27
|
+
*/
|
|
28
|
+
export function BasicQuestionGroupCard({ groupNumber, title, subtitle, content, imageUrl, onTitleChange, onSubtitleChange, onContentChange, onImageChange, onImagePresignedUrlChange, showContent = true, groupConfig, uploadIdPrefix = 'basic-group', isReadOnly = false, }) {
|
|
29
|
+
const hasConfig = groupConfig && groupConfig.length > 0;
|
|
30
|
+
const showTitle = !hasConfig || groupConfig.includes('title');
|
|
31
|
+
const showSubtitle = !hasConfig || groupConfig.includes('subtitle');
|
|
32
|
+
const showContentField = (!hasConfig || groupConfig.includes('content')) && showContent;
|
|
33
|
+
const showImage = !hasConfig || groupConfig.includes('imageUrl');
|
|
34
|
+
// Resolve presigned preview URL for the stored image key
|
|
35
|
+
const { previewUrl } = usePresignedFileUrl(imageUrl);
|
|
36
|
+
const displayPreviewUrl = previewUrl || '';
|
|
37
|
+
return (_jsxs(Card, { className: "overflow-hidden border-0 bg-white shadow-lg shadow-purple-100/50", children: [_jsx("div", { className: "h-1.5 bg-gradient-to-r from-purple-500 via-violet-500 to-indigo-500" }), _jsx(CardHeader, { className: "pb-4", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-purple-500 to-violet-600 shadow-md", children: _jsx(Layers, { className: "h-5 w-5 text-white" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CardTitle, { className: "text-lg font-bold text-gray-900", children: "D\u1EEF li\u1EC7u nh\u00F3m" }), _jsxs("span", { className: "inline-flex items-center rounded-full border border-purple-300 bg-purple-100 px-2.5 py-0.5 text-xs font-semibold text-purple-700", children: ["Nh\u00F3m ", groupNumber] })] }), _jsxs("p", { className: "text-sm text-gray-500", children: ["D\u00F9ng chung cho t\u1EA5t c\u1EA3 c\u00E2u h\u1ECFi trong Nh\u00F3m ", groupNumber] })] })] }) }), _jsxs(CardContent, { className: "space-y-5", children: [showTitle && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { htmlFor: `${uploadIdPrefix}-title`, className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(Type, { className: "h-4 w-4 text-purple-500" }), "Ti\u00EAu \u0111\u1EC1 nh\u00F3m", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), _jsx(Input, { id: `${uploadIdPrefix}-title`, value: title, onChange: (e) => {
|
|
38
|
+
if (!isReadOnly)
|
|
39
|
+
onTitleChange(e.target.value);
|
|
40
|
+
}, readOnly: isReadOnly, placeholder: "Nh\u1EADp ti\u00EAu \u0111\u1EC1 nh\u00F3m c\u00E2u h\u1ECFi\u2026", className: `border-gray-200 bg-white transition-all focus:border-purple-300 focus:ring-purple-200 ${isReadOnly ? 'bg-gray-50 text-gray-500 cursor-not-allowed border-transparent focus:border-transparent focus:ring-0' : ''}` })] })), showSubtitle && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { htmlFor: `${uploadIdPrefix}-subtitle`, className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(Type, { className: "h-4 w-4 text-purple-500" }), "Ph\u1EE5 \u0111\u1EC1 nh\u00F3m", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), _jsx(Input, { id: `${uploadIdPrefix}-subtitle`, value: subtitle, onChange: (e) => {
|
|
41
|
+
if (!isReadOnly)
|
|
42
|
+
onSubtitleChange(e.target.value);
|
|
43
|
+
}, readOnly: isReadOnly, placeholder: "Nh\u1EADp ph\u1EE5 \u0111\u1EC1 nh\u00F3m c\u00E2u h\u1ECFi\u2026", className: `border-gray-200 bg-white transition-all focus:border-purple-300 focus:ring-purple-200 ${isReadOnly ? 'bg-gray-50 text-gray-500 cursor-not-allowed border-transparent focus:border-transparent focus:ring-0' : ''}` })] })), showContentField && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { htmlFor: `${uploadIdPrefix}-content`, className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(MessageSquare, { className: "h-4 w-4 text-purple-500" }), "N\u1ED9i dung nh\u00F3m", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), _jsx(Textarea, { id: `${uploadIdPrefix}-content`, value: content, onChange: (e) => {
|
|
44
|
+
if (!isReadOnly)
|
|
45
|
+
onContentChange(e.target.value);
|
|
46
|
+
}, readOnly: isReadOnly, placeholder: "Nh\u1EADp \u0111o\u1EA1n v\u0103n / c\u00E2u chuy\u1EC7n chung cho nh\u00F3m c\u00E2u h\u1ECFi n\u00E0y\u2026", rows: 5, className: `min-h-[120px] border-gray-200 bg-white transition-all focus:border-purple-300 focus:ring-purple-200 ${isReadOnly ? 'bg-gray-50 text-gray-500 cursor-not-allowed border-transparent focus:border-transparent focus:ring-0' : ''}` })] })), showImage && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(ImageIcon, { className: "h-4 w-4 text-purple-500" }), "H\u00ECnh \u1EA3nh nh\u00F3m", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), !isReadOnly && (_jsx(FileUpload, { id: `${uploadIdPrefix}-image`, label: "", accept: "image/*", value: imageUrl, onChange: (url) => {
|
|
47
|
+
if (!isReadOnly)
|
|
48
|
+
onImageChange(url);
|
|
49
|
+
}, onPresignedUrlChange: onImagePresignedUrlChange, maxSize: 5, placeholder: "Upload \u1EA3nh ho\u1EB7c paste URL", autoUpload: true, prefix: "questions" })), displayPreviewUrl && (_jsx(ImagePreview, { src: displayPreviewUrl, alt: "Group image preview", className: "mt-2 h-48 w-full max-w-md rounded-lg border border-gray-200" }))] }))] })] }));
|
|
50
|
+
}
|
|
@@ -1 +1,114 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useEffect as n,useState as i}from"react";import{useEditor as a,EditorContent as l}from"@tiptap/react";import o from"@tiptap/starter-kit";import r from"@tiptap/extension-text-align";import{ImagePreview as s}from"../../../components/ui/image-preview";import{Input as c}from"../../../components/ui/input";import{Label as d}from"../../../components/ui/label";import{Card as h,CardContent as m,CardHeader as g,CardTitle as u}from"../../../components/ui/card";import{FileUpload as p}from"../../../components/ui/file-upload";import{usePresignedFileUrl as x}from"../../../shared/lib/hooks";import{Layers as b,Type as f,Pilcrow as v,ImageIcon as N,Bold as y,Italic as w,Strikethrough as _,Heading1 as C,Heading2 as k,Heading3 as A,List as T,ListOrdered as U,AlignLeft as H,AlignCenter as L,AlignRight as I,Minus as $,Undo2 as j,Redo2 as O,FileText as P,Info as R}from"lucide-react";function G({onClick:t,active:n,disabled:i,title:a,children:l}){return e("button",{type:"button",title:a,onClick:t,disabled:i,className:`flex h-7 w-7 items-center justify-center rounded-md text-sm transition-colors\n ${n?"bg-indigo-500 text-white shadow-sm":"text-gray-600 hover:bg-gray-200 hover:text-gray-900"}\n ${i?"cursor-not-allowed opacity-40":"cursor-pointer"}\n `,children:l})}function S(){return e("div",{className:"mx-0.5 h-5 w-px shrink-0 bg-gray-300"})}function z({value:s,onChange:c,isReadOnly:d=!1,placeholder:h}){const[m,g]=i(!1),u=a({immediatelyRender:!1,editable:!d,extensions:[o,r.configure({types:["heading","paragraph"]})],content:s||"",onUpdate:({editor:e})=>{c(e.getHTML())},editorProps:{attributes:{class:["focus:outline-none min-h-[200px] max-h-[520px] overflow-y-auto p-4 text-sm text-gray-800 leading-relaxed","prose prose-sm max-w-none","[&_h1]:text-xl [&_h1]:font-bold [&_h1]:mb-2","[&_h2]:text-lg [&_h2]:font-bold [&_h2]:mb-1.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:mb-1","[&_ul]:list-disc [&_ul]:ml-5 [&_ol]:list-decimal [&_ol]:ml-5","[&_li]:mb-0.5","[&_strong]:font-bold [&_em]:italic [&_s]:line-through","[&_hr]:border-gray-300 [&_hr]:my-3","bg-white"].join(" "),...h&&!s?{"data-placeholder":h}:{}}}});return n(()=>{g(!0)},[]),n(()=>{u&&void 0!==s&&s!==u.getHTML()&&setTimeout(()=>u.commands.setContent(s,{emitUpdate:!1}),0)},[s,u]),n(()=>{u?.setEditable(!d)},[d,u]),m?t("div",{className:"overflow-hidden rounded-sm border-2 transition-all "+(d?"border-gray-200":"border-gray-200 focus-within:border-indigo-400 focus-within:ring-2 focus-within:ring-indigo-100"),children:[!d&&t("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-gray-200 bg-gray-50 px-2 py-1.5",children:[e(G,{title:"Hoàn tác",onClick:()=>u?.chain().focus().undo().run(),disabled:!u?.can().undo(),children:e(j,{className:"h-3.5 w-3.5"})}),e(G,{title:"Làm lại",onClick:()=>u?.chain().focus().redo().run(),disabled:!u?.can().redo(),children:e(O,{className:"h-3.5 w-3.5"})}),e(S,{}),e(G,{title:"Tiêu đề 1",active:u?.isActive("heading",{level:1}),onClick:()=>u?.chain().focus().toggleHeading({level:1}).run(),children:e(C,{className:"h-3.5 w-3.5"})}),e(G,{title:"Tiêu đề 2",active:u?.isActive("heading",{level:2}),onClick:()=>u?.chain().focus().toggleHeading({level:2}).run(),children:e(k,{className:"h-3.5 w-3.5"})}),e(G,{title:"Tiêu đề 3",active:u?.isActive("heading",{level:3}),onClick:()=>u?.chain().focus().toggleHeading({level:3}).run(),children:e(A,{className:"h-3.5 w-3.5"})}),e(S,{}),e(G,{title:"In đậm",active:u?.isActive("bold"),onClick:()=>u?.chain().focus().toggleBold().run(),children:e(y,{className:"h-3.5 w-3.5"})}),e(G,{title:"In nghiêng",active:u?.isActive("italic"),onClick:()=>u?.chain().focus().toggleItalic().run(),children:e(w,{className:"h-3.5 w-3.5"})}),e(G,{title:"Gạch ngang",active:u?.isActive("strike"),onClick:()=>u?.chain().focus().toggleStrike().run(),children:e(_,{className:"h-3.5 w-3.5"})}),e(S,{}),e(G,{title:"Danh sách",active:u?.isActive("bulletList"),onClick:()=>u?.chain().focus().toggleBulletList().run(),children:e(T,{className:"h-3.5 w-3.5"})}),e(G,{title:"Danh sách số",active:u?.isActive("orderedList"),onClick:()=>u?.chain().focus().toggleOrderedList().run(),children:e(U,{className:"h-3.5 w-3.5"})}),e(S,{}),e(G,{title:"Căn trái",active:u?.isActive({textAlign:"left"}),onClick:()=>u?.chain().focus().setTextAlign("left").run(),children:e(H,{className:"h-3.5 w-3.5"})}),e(G,{title:"Căn giữa",active:u?.isActive({textAlign:"center"}),onClick:()=>u?.chain().focus().setTextAlign("center").run(),children:e(L,{className:"h-3.5 w-3.5"})}),e(G,{title:"Căn phải",active:u?.isActive({textAlign:"right"}),onClick:()=>u?.chain().focus().setTextAlign("right").run(),children:e(I,{className:"h-3.5 w-3.5"})}),e(S,{}),e(G,{title:"Đường kẻ ngang",onClick:()=>u?.chain().focus().setHorizontalRule().run(),children:e($,{className:"h-3.5 w-3.5"})})]}),d?e("div",{className:["min-h-[120px] max-h-[520px] overflow-y-auto p-4 text-sm text-gray-800 leading-relaxed bg-gray-50 cursor-not-allowed","prose prose-sm max-w-none","[&_h1]:text-xl [&_h1]:font-bold [&_h1]:mb-2","[&_h2]:text-lg [&_h2]:font-bold [&_h2]:mb-1.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:mb-1","[&_ul]:list-disc [&_ul]:ml-5 [&_ol]:list-decimal [&_ol]:ml-5","[&_li]:mb-0.5","[&_strong]:font-bold [&_em]:italic [&_s]:line-through","[&_hr]:border-gray-300 [&_hr]:my-3"].join(" "),dangerouslySetInnerHTML:{__html:(p=s||"",p.replace(/\{(\d+)\}/g,(e,t)=>`<span style="display:inline-block;min-width:120px;padding:1px 5px;margin:0 4px;background:#eef2ff;border-bottom:2px solid #6366f1;color:#4f46e5;font-weight:700;font-size:0.85em;text-align:center;vertical-align:baseline;letter-spacing:2px">———(${Number(t)+1})———</span>`))}}):e(l,{editor:u})]}):null;var p}export function DocumentGroupCard({groupNumber:n,title:i,subtitle:a="",content:l,imageUrl:o,onTitleChange:r,onSubtitleChange:y,onContentChange:w,onImageChange:_,onImagePresignedUrlChange:C,groupConfig:k,uploadIdPrefix:A="document-group",isReadOnly:T=!1}){const U=k&&k.length>0,H=!U||k.includes("title"),L=!U||k.includes("subtitle"),I=!U||k.includes("content"),$=!U||k.includes("imageUrl"),{previewUrl:j}=x(o),O=j||"";return t(h,{className:"overflow-hidden border-0 bg-white shadow-lg shadow-indigo-100/50",children:[e("div",{className:"h-1.5 bg-gradient-to-r from-indigo-500 via-violet-500 to-purple-500"}),e(g,{className:"pb-4",children:t("div",{className:"flex items-center gap-3",children:[e("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 shadow-md",children:e(b,{className:"h-5 w-5 text-white"})}),t("div",{className:"flex-1",children:[t("div",{className:"flex items-center gap-2",children:[e(u,{className:"text-lg font-bold text-gray-900",children:"Đoạn văn nhóm"}),t("span",{className:"inline-flex items-center rounded-full border border-indigo-300 bg-indigo-100 px-2.5 py-0.5 text-xs font-semibold text-indigo-700",children:["Nhóm ",n]})]}),t("p",{className:"text-sm text-gray-500",children:["Nội dung định dạng phong phú — dùng chung cho tất cả câu hỏi trong Nhóm ",n]})]})]})}),t(m,{className:"space-y-5",children:[H&&t("div",{className:"space-y-2",children:[t(d,{htmlFor:`${A}-title`,className:"flex items-center gap-2 text-sm font-semibold text-gray-800",children:[e(f,{className:"h-4 w-4 text-indigo-500"}),"Tiêu đề nhóm"," ",e("span",{className:"text-xs font-normal text-gray-500",children:"(Tùy chọn)"})]}),e(c,{id:`${A}-title`,value:i,onChange:e=>{T||r(e.target.value)},readOnly:T,placeholder:"Nhập tiêu đề nhóm câu hỏi…",className:"border-gray-200 bg-white transition-all focus:border-indigo-300 focus:ring-indigo-200 "+(T?"cursor-not-allowed border-transparent bg-gray-50 text-gray-500 focus:border-transparent focus:ring-0":"")})]}),L&&t("div",{className:"space-y-2",children:[t(d,{htmlFor:`${A}-subtitle`,className:"flex items-center gap-2 text-sm font-semibold text-gray-800",children:[e(v,{className:"h-4 w-4 text-indigo-500"}),"Phụ đề"," ",e("span",{className:"text-xs font-normal text-gray-500",children:"(Tùy chọn)"})]}),e(c,{id:`${A}-subtitle`,value:a,onChange:e=>{T||y?.(e.target.value)},readOnly:T,placeholder:"Nhập phụ đề hoặc mô tả ngắn…",className:"border-gray-200 bg-white transition-all focus:border-indigo-300 focus:ring-indigo-200 "+(T?"cursor-not-allowed border-transparent bg-gray-50 text-gray-500 focus:border-transparent focus:ring-0":"")})]}),I&&t("div",{className:"space-y-2",children:[t(d,{className:"flex items-center gap-2 text-sm font-semibold text-gray-800",children:[e(P,{className:"h-4 w-4 text-indigo-500"}),"Nội dung đoạn văn"," ",e("span",{className:"text-xs font-normal text-gray-500",children:"(Tùy chọn)"})]}),e(z,{value:l,onChange:w,isReadOnly:T,placeholder:"Nhập đoạn văn, email, thông báo, quảng cáo… dùng chung cho nhóm câu hỏi này",uploadIdPrefix:A}),!T&&t("div",{className:"flex items-start gap-2.5 rounded-lg border border-amber-200 bg-amber-50 px-3.5 py-2.5",children:[e(R,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-500"}),t("div",{className:"text-xs text-amber-800 leading-relaxed",children:[e("span",{className:"font-semibold",children:"Gợi ý (chỉ dành cho dạng điền từ):"})," ","Nếu đoạn văn có khoảng trống cần điền, hãy đánh dấu bằng"," ",e("code",{className:"rounded bg-amber-100 px-1 py-0.5 font-mono font-semibold text-amber-700",children:"{0}"}),","," ",e("code",{className:"rounded bg-amber-100 px-1 py-0.5 font-mono font-semibold text-amber-700",children:"{1}"}),","," ",e("code",{className:"rounded bg-amber-100 px-1 py-0.5 font-mono font-semibold text-amber-700",children:"{2}"}),"… — mỗi số tương ứng thứ tự câu hỏi trong nhóm. Với dạng bài đọc thông thường, bạn không cần dùng ký hiệu này."]})]})]}),$&&t("div",{className:"space-y-2",children:[t(d,{className:"flex items-center gap-2 text-sm font-semibold text-gray-800",children:[e(N,{className:"h-4 w-4 text-indigo-500"}),"Hình ảnh nhóm"," ",e("span",{className:"text-xs font-normal text-gray-500",children:"(Tùy chọn)"})]}),!T&&e(p,{id:`${A}-image`,label:"",accept:"image/*",value:o,onChange:e=>{T||_(e)},onPresignedUrlChange:C,maxSize:5,placeholder:"Upload ảnh hoặc paste URL",autoUpload:!0,prefix:"questions"}),O&&e(s,{src:O,alt:"Group image preview",className:"mt-2 h-48 w-full max-w-md rounded-lg border border-gray-200"})]})]})]})}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { useEditor, EditorContent } from '@tiptap/react';
|
|
5
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
6
|
+
import TextAlign from '@tiptap/extension-text-align';
|
|
7
|
+
import { ImagePreview } from '../../../components/ui/image-preview';
|
|
8
|
+
import { Input } from '../../../components/ui/input';
|
|
9
|
+
import { Label } from '../../../components/ui/label';
|
|
10
|
+
import { Card, CardContent, CardHeader, CardTitle } from '../../../components/ui/card';
|
|
11
|
+
import { FileUpload } from '../../../components/ui/file-upload';
|
|
12
|
+
import { usePresignedFileUrl } from '../../../shared/lib/hooks';
|
|
13
|
+
import { Layers, Type, Pilcrow, ImageIcon, Bold, Italic, Strikethrough, Heading1, Heading2, Heading3, List, ListOrdered, AlignLeft, AlignCenter, AlignRight, Minus, Undo2, Redo2, FileText, Info, } from 'lucide-react';
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Toolbar button
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
function ToolbarBtn({ onClick, active, disabled, title, children, }) {
|
|
18
|
+
return (_jsx("button", { type: "button", title: title, onClick: onClick, disabled: disabled, className: `flex h-7 w-7 items-center justify-center rounded-md text-sm transition-colors
|
|
19
|
+
${active
|
|
20
|
+
? 'bg-indigo-500 text-white shadow-sm'
|
|
21
|
+
: 'text-gray-600 hover:bg-gray-200 hover:text-gray-900'}
|
|
22
|
+
${disabled ? 'cursor-not-allowed opacity-40' : 'cursor-pointer'}
|
|
23
|
+
`, children: children }));
|
|
24
|
+
}
|
|
25
|
+
function ToolbarSep() {
|
|
26
|
+
return _jsx("div", { className: "mx-0.5 h-5 w-px shrink-0 bg-gray-300" });
|
|
27
|
+
}
|
|
28
|
+
/** Replace `{0}`, `{1}`, … placeholders with a visible blank underline */
|
|
29
|
+
function replacePlaceholdersWithBlanks(html) {
|
|
30
|
+
return html.replace(/\{(\d+)\}/g, (_match, num) => `<span style="display:inline-block;min-width:120px;padding:1px 5px;margin:0 4px;background:#eef2ff;border-bottom:2px solid #6366f1;color:#4f46e5;font-weight:700;font-size:0.85em;text-align:center;vertical-align:baseline;letter-spacing:2px">———(${Number(num) + 1})———</span>`);
|
|
31
|
+
}
|
|
32
|
+
function DocumentEditor({ value, onChange, isReadOnly = false, placeholder }) {
|
|
33
|
+
const [mounted, setMounted] = useState(false);
|
|
34
|
+
const editor = useEditor({
|
|
35
|
+
immediatelyRender: false,
|
|
36
|
+
editable: !isReadOnly,
|
|
37
|
+
extensions: [
|
|
38
|
+
StarterKit,
|
|
39
|
+
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
|
40
|
+
],
|
|
41
|
+
// Always use raw value — never inject replaced HTML into the editor
|
|
42
|
+
content: value || '',
|
|
43
|
+
onUpdate: ({ editor }) => {
|
|
44
|
+
onChange(editor.getHTML());
|
|
45
|
+
},
|
|
46
|
+
editorProps: {
|
|
47
|
+
attributes: {
|
|
48
|
+
class: [
|
|
49
|
+
'focus:outline-none min-h-[200px] max-h-[520px] overflow-y-auto p-4 text-sm text-gray-800 leading-relaxed',
|
|
50
|
+
'prose prose-sm max-w-none',
|
|
51
|
+
'[&_h1]:text-xl [&_h1]:font-bold [&_h1]:mb-2',
|
|
52
|
+
'[&_h2]:text-lg [&_h2]:font-bold [&_h2]:mb-1.5',
|
|
53
|
+
'[&_h3]:text-base [&_h3]:font-semibold [&_h3]:mb-1',
|
|
54
|
+
'[&_ul]:list-disc [&_ul]:ml-5 [&_ol]:list-decimal [&_ol]:ml-5',
|
|
55
|
+
'[&_li]:mb-0.5',
|
|
56
|
+
'[&_strong]:font-bold [&_em]:italic [&_s]:line-through',
|
|
57
|
+
'[&_hr]:border-gray-300 [&_hr]:my-3',
|
|
58
|
+
'bg-white',
|
|
59
|
+
].join(' '),
|
|
60
|
+
...(placeholder && !value ? { 'data-placeholder': placeholder } : {}),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
useEffect(() => { setMounted(true); }, []);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (editor && value !== undefined && value !== editor.getHTML()) {
|
|
67
|
+
// Always sync raw value — replacement is handled at render time for read-only display
|
|
68
|
+
setTimeout(() => editor.commands.setContent(value, { emitUpdate: false }), 0);
|
|
69
|
+
}
|
|
70
|
+
}, [value, editor]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
editor?.setEditable(!isReadOnly);
|
|
73
|
+
}, [isReadOnly, editor]);
|
|
74
|
+
if (!mounted)
|
|
75
|
+
return null;
|
|
76
|
+
return (_jsxs("div", { className: `overflow-hidden rounded-sm border-2 transition-all ${isReadOnly
|
|
77
|
+
? 'border-gray-200'
|
|
78
|
+
: 'border-gray-200 focus-within:border-indigo-400 focus-within:ring-2 focus-within:ring-indigo-100'}`, children: [!isReadOnly && (_jsxs("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-gray-200 bg-gray-50 px-2 py-1.5", children: [_jsx(ToolbarBtn, { title: "Ho\u00E0n t\u00E1c", onClick: () => editor?.chain().focus().undo().run(), disabled: !editor?.can().undo(), children: _jsx(Undo2, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "L\u00E0m l\u1EA1i", onClick: () => editor?.chain().focus().redo().run(), disabled: !editor?.can().redo(), children: _jsx(Redo2, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "Ti\u00EAu \u0111\u1EC1 1", active: editor?.isActive('heading', { level: 1 }), onClick: () => editor?.chain().focus().toggleHeading({ level: 1 }).run(), children: _jsx(Heading1, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "Ti\u00EAu \u0111\u1EC1 2", active: editor?.isActive('heading', { level: 2 }), onClick: () => editor?.chain().focus().toggleHeading({ level: 2 }).run(), children: _jsx(Heading2, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "Ti\u00EAu \u0111\u1EC1 3", active: editor?.isActive('heading', { level: 3 }), onClick: () => editor?.chain().focus().toggleHeading({ level: 3 }).run(), children: _jsx(Heading3, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "In \u0111\u1EADm", active: editor?.isActive('bold'), onClick: () => editor?.chain().focus().toggleBold().run(), children: _jsx(Bold, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "In nghi\u00EAng", active: editor?.isActive('italic'), onClick: () => editor?.chain().focus().toggleItalic().run(), children: _jsx(Italic, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "G\u1EA1ch ngang", active: editor?.isActive('strike'), onClick: () => editor?.chain().focus().toggleStrike().run(), children: _jsx(Strikethrough, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "Danh s\u00E1ch", active: editor?.isActive('bulletList'), onClick: () => editor?.chain().focus().toggleBulletList().run(), children: _jsx(List, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "Danh s\u00E1ch s\u1ED1", active: editor?.isActive('orderedList'), onClick: () => editor?.chain().focus().toggleOrderedList().run(), children: _jsx(ListOrdered, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "C\u0103n tr\u00E1i", active: editor?.isActive({ textAlign: 'left' }), onClick: () => editor?.chain().focus().setTextAlign('left').run(), children: _jsx(AlignLeft, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "C\u0103n gi\u1EEFa", active: editor?.isActive({ textAlign: 'center' }), onClick: () => editor?.chain().focus().setTextAlign('center').run(), children: _jsx(AlignCenter, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarBtn, { title: "C\u0103n ph\u1EA3i", active: editor?.isActive({ textAlign: 'right' }), onClick: () => editor?.chain().focus().setTextAlign('right').run(), children: _jsx(AlignRight, { className: "h-3.5 w-3.5" }) }), _jsx(ToolbarSep, {}), _jsx(ToolbarBtn, { title: "\u0110\u01B0\u1EDDng k\u1EBB ngang", onClick: () => editor?.chain().focus().setHorizontalRule().run(), children: _jsx(Minus, { className: "h-3.5 w-3.5" }) })] })), isReadOnly ? (
|
|
79
|
+
/* Read-only display: render replaced HTML but never push it into the editor */
|
|
80
|
+
_jsx("div", { className: [
|
|
81
|
+
'min-h-[120px] max-h-[520px] overflow-y-auto p-4 text-sm text-gray-800 leading-relaxed bg-gray-50 cursor-not-allowed',
|
|
82
|
+
'prose prose-sm max-w-none',
|
|
83
|
+
'[&_h1]:text-xl [&_h1]:font-bold [&_h1]:mb-2',
|
|
84
|
+
'[&_h2]:text-lg [&_h2]:font-bold [&_h2]:mb-1.5',
|
|
85
|
+
'[&_h3]:text-base [&_h3]:font-semibold [&_h3]:mb-1',
|
|
86
|
+
'[&_ul]:list-disc [&_ul]:ml-5 [&_ol]:list-decimal [&_ol]:ml-5',
|
|
87
|
+
'[&_li]:mb-0.5',
|
|
88
|
+
'[&_strong]:font-bold [&_em]:italic [&_s]:line-through',
|
|
89
|
+
'[&_hr]:border-gray-300 [&_hr]:my-3',
|
|
90
|
+
].join(' '), dangerouslySetInnerHTML: { __html: replacePlaceholdersWithBlanks(value || '') } })) : (_jsx(EditorContent, { editor: editor }))] }));
|
|
91
|
+
}
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
// Component
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
/**
|
|
96
|
+
* `DocumentGroupCard`
|
|
97
|
+
*
|
|
98
|
+
* Group header card that uses TipTap for structured rich-text content.
|
|
99
|
+
* Ideal for TOEIC Part 6 / Part 7 reading passages, emails, memos,
|
|
100
|
+
* advertisements and other formatted texts shared across a question group.
|
|
101
|
+
*/
|
|
102
|
+
export function DocumentGroupCard({ groupNumber, title, subtitle = '', content, imageUrl, onTitleChange, onSubtitleChange, onContentChange, onImageChange, onImagePresignedUrlChange, groupConfig, uploadIdPrefix = 'document-group', isReadOnly = false, }) {
|
|
103
|
+
const hasConfig = groupConfig && groupConfig.length > 0;
|
|
104
|
+
const showTitle = !hasConfig || groupConfig.includes('title');
|
|
105
|
+
const showSubtitle = !hasConfig || groupConfig.includes('subtitle');
|
|
106
|
+
const showContent = !hasConfig || groupConfig.includes('content');
|
|
107
|
+
const showImage = !hasConfig || groupConfig.includes('imageUrl');
|
|
108
|
+
const { previewUrl } = usePresignedFileUrl(imageUrl);
|
|
109
|
+
const displayPreviewUrl = previewUrl || '';
|
|
110
|
+
return (_jsxs(Card, { className: "overflow-hidden border-0 bg-white shadow-lg shadow-indigo-100/50", children: [_jsx("div", { className: "h-1.5 bg-gradient-to-r from-indigo-500 via-violet-500 to-purple-500" }), _jsx(CardHeader, { className: "pb-4", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 shadow-md", children: _jsx(Layers, { className: "h-5 w-5 text-white" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CardTitle, { className: "text-lg font-bold text-gray-900", children: "\u0110o\u1EA1n v\u0103n nh\u00F3m" }), _jsxs("span", { className: "inline-flex items-center rounded-full border border-indigo-300 bg-indigo-100 px-2.5 py-0.5 text-xs font-semibold text-indigo-700", children: ["Nh\u00F3m ", groupNumber] })] }), _jsxs("p", { className: "text-sm text-gray-500", children: ["N\u1ED9i dung \u0111\u1ECBnh d\u1EA1ng phong ph\u00FA \u2014 d\u00F9ng chung cho t\u1EA5t c\u1EA3 c\u00E2u h\u1ECFi trong Nh\u00F3m ", groupNumber] })] })] }) }), _jsxs(CardContent, { className: "space-y-5", children: [showTitle && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { htmlFor: `${uploadIdPrefix}-title`, className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(Type, { className: "h-4 w-4 text-indigo-500" }), "Ti\u00EAu \u0111\u1EC1 nh\u00F3m", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), _jsx(Input, { id: `${uploadIdPrefix}-title`, value: title, onChange: (e) => { if (!isReadOnly)
|
|
111
|
+
onTitleChange(e.target.value); }, readOnly: isReadOnly, placeholder: "Nh\u1EADp ti\u00EAu \u0111\u1EC1 nh\u00F3m c\u00E2u h\u1ECFi\u2026", className: `border-gray-200 bg-white transition-all focus:border-indigo-300 focus:ring-indigo-200 ${isReadOnly ? 'cursor-not-allowed border-transparent bg-gray-50 text-gray-500 focus:border-transparent focus:ring-0' : ''}` })] })), showSubtitle && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { htmlFor: `${uploadIdPrefix}-subtitle`, className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(Pilcrow, { className: "h-4 w-4 text-indigo-500" }), "Ph\u1EE5 \u0111\u1EC1", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), _jsx(Input, { id: `${uploadIdPrefix}-subtitle`, value: subtitle, onChange: (e) => { if (!isReadOnly)
|
|
112
|
+
onSubtitleChange?.(e.target.value); }, readOnly: isReadOnly, placeholder: "Nh\u1EADp ph\u1EE5 \u0111\u1EC1 ho\u1EB7c m\u00F4 t\u1EA3 ng\u1EAFn\u2026", className: `border-gray-200 bg-white transition-all focus:border-indigo-300 focus:ring-indigo-200 ${isReadOnly ? 'cursor-not-allowed border-transparent bg-gray-50 text-gray-500 focus:border-transparent focus:ring-0' : ''}` })] })), showContent && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(FileText, { className: "h-4 w-4 text-indigo-500" }), "N\u1ED9i dung \u0111o\u1EA1n v\u0103n", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), _jsx(DocumentEditor, { value: content, onChange: onContentChange, isReadOnly: isReadOnly, placeholder: "Nh\u1EADp \u0111o\u1EA1n v\u0103n, email, th\u00F4ng b\u00E1o, qu\u1EA3ng c\u00E1o\u2026 d\u00F9ng chung cho nh\u00F3m c\u00E2u h\u1ECFi n\u00E0y", uploadIdPrefix: uploadIdPrefix }), !isReadOnly && (_jsxs("div", { className: "flex items-start gap-2.5 rounded-lg border border-amber-200 bg-amber-50 px-3.5 py-2.5", children: [_jsx(Info, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-500" }), _jsxs("div", { className: "text-xs text-amber-800 leading-relaxed", children: [_jsx("span", { className: "font-semibold", children: "G\u1EE3i \u00FD (ch\u1EC9 d\u00E0nh cho d\u1EA1ng \u0111i\u1EC1n t\u1EEB):" }), ' ', "N\u1EBFu \u0111o\u1EA1n v\u0103n c\u00F3 kho\u1EA3ng tr\u1ED1ng c\u1EA7n \u0111i\u1EC1n, h\u00E3y \u0111\u00E1nh d\u1EA5u b\u1EB1ng", ' ', _jsx("code", { className: "rounded bg-amber-100 px-1 py-0.5 font-mono font-semibold text-amber-700", children: '{0}' }), ",", ' ', _jsx("code", { className: "rounded bg-amber-100 px-1 py-0.5 font-mono font-semibold text-amber-700", children: '{1}' }), ",", ' ', _jsx("code", { className: "rounded bg-amber-100 px-1 py-0.5 font-mono font-semibold text-amber-700", children: '{2}' }), "\u2026 \u2014 m\u1ED7i s\u1ED1 t\u01B0\u01A1ng \u1EE9ng th\u1EE9 t\u1EF1 c\u00E2u h\u1ECFi trong nh\u00F3m. V\u1EDBi d\u1EA1ng b\u00E0i \u0111\u1ECDc th\u00F4ng th\u01B0\u1EDDng, b\u1EA1n kh\u00F4ng c\u1EA7n d\u00F9ng k\u00FD hi\u1EC7u n\u00E0y."] })] }))] })), showImage && (_jsxs("div", { className: "space-y-2", children: [_jsxs(Label, { className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(ImageIcon, { className: "h-4 w-4 text-indigo-500" }), "H\u00ECnh \u1EA3nh nh\u00F3m", ' ', _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn)" })] }), !isReadOnly && (_jsx(FileUpload, { id: `${uploadIdPrefix}-image`, label: "", accept: "image/*", value: imageUrl, onChange: (url) => { if (!isReadOnly)
|
|
113
|
+
onImageChange(url); }, onPresignedUrlChange: onImagePresignedUrlChange, maxSize: 5, placeholder: "Upload \u1EA3nh ho\u1EB7c paste URL", autoUpload: true, prefix: "questions" })), displayPreviewUrl && (_jsx(ImagePreview, { src: displayPreviewUrl, alt: "Group image preview", className: "mt-2 h-48 w-full max-w-md rounded-lg border border-gray-200" }))] }))] })] }));
|
|
114
|
+
}
|
|
@@ -1 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { ImagePreview } from '../../../components/ui/image-preview';
|
|
5
|
+
import { Button } from '../../../components/ui/button';
|
|
6
|
+
import { Label } from '../../../components/ui/label';
|
|
7
|
+
import { Input } from '../../../components/ui/input';
|
|
8
|
+
import { Card, CardContent, CardHeader, CardTitle } from '../../../components/ui/card';
|
|
9
|
+
import { FileUpload } from '../../../components/ui/file-upload';
|
|
10
|
+
import { usePresignedFileUrl } from '../../../shared/lib/hooks';
|
|
11
|
+
import { ImageIcon, Layers, Plus, Type, X } from 'lucide-react';
|
|
12
|
+
function OptionRow({ option, index, canRemove, onUpdate, onRemove, groupConfig, }) {
|
|
13
|
+
const [localPreviewUrl, setLocalPreviewUrl] = useState('');
|
|
14
|
+
const { previewUrl: presignedUrl } = usePresignedFileUrl(option.imageUrl || '');
|
|
15
|
+
const displayUrl = localPreviewUrl || presignedUrl || '';
|
|
16
|
+
const showAnswer = !groupConfig || groupConfig.includes('answer');
|
|
17
|
+
const showContent = groupConfig?.includes('content') ?? false;
|
|
18
|
+
const showImageUrl = !groupConfig || groupConfig.includes('imageUrl');
|
|
19
|
+
return (_jsxs("div", { className: "flex items-start gap-3 rounded-xl border border-purple-100 bg-gradient-to-r from-purple-50/50 to-violet-50/50 p-4", children: [_jsx("div", { className: "flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-purple-500 to-violet-600 text-base font-bold text-white shadow-sm", children: index + 1 }), _jsxs("div", { className: "flex-1 space-y-3", children: [_jsxs("div", { className: "flex items-end gap-3", children: [showAnswer && (_jsx("div", { className: "flex-1", children: _jsx(Input, { value: option.answer, onChange: (e) => onUpdate(index, 'answer', e.target.value), placeholder: `Nhãn (ví dụ: ${String.fromCharCode(65 + index)} hoặc "a pineapple")`, className: "border-purple-200 bg-white focus:border-purple-400 focus:ring-purple-200" }) })), showContent && (_jsx("div", { className: "flex-1", children: _jsx(Input, { value: option.content || '', onChange: (e) => onUpdate(index, 'content', e.target.value), placeholder: "N\u1ED9i dung (m\u00F4 t\u1EA3 th\u00EAm cho \u0111\u00E1p \u00E1n)", className: "border-purple-200 bg-white focus:border-purple-400 focus:ring-purple-200" }) })), showImageUrl && (_jsx("div", { className: "flex-1", children: _jsx(FileUpload, { id: `option-image-${index}`, label: "", accept: "image/*", value: option.imageUrl || '', onChange: (url) => onUpdate(index, 'imageUrl', url), onPresignedUrlChange: setLocalPreviewUrl, maxSize: 5, placeholder: "Upload \u1EA3nh cho \u0111\u00E1p \u00E1n", autoUpload: true, prefix: "questions" }) }))] }), showImageUrl && displayUrl && (_jsx("div", { className: "relative h-32 w-32 overflow-hidden rounded-lg border border-purple-200 bg-white shadow-sm", children: _jsx("img", { src: displayUrl, alt: option.answer || `Option ${index + 1}`, className: "h-full w-full object-contain" }) }))] }), canRemove && (_jsx(Button, { variant: "ghost", size: "sm", onClick: () => onRemove(index), className: "flex-shrink-0 text-red-500 hover:bg-red-50 hover:text-red-700", children: _jsx(X, { className: "h-4 w-4" }) }))] }));
|
|
20
|
+
}
|
|
21
|
+
export function MatchAnswerGroupCard({ currentGroupNumber, groupTitle, groupImageUrl, groupImagePreviewUrl, options, groupConfig, showGroupTitle, showGroupImageUrl, onGroupTitleChange, onGroupImageChange, onGroupImagePreviewUrlChange, onUpdateOption, onRemoveOption, onAddOption, }) {
|
|
22
|
+
const { previewUrl: groupImagePresignedUrl } = usePresignedFileUrl(groupImageUrl || '');
|
|
23
|
+
const displayGroupImageUrl = groupImagePreviewUrl || groupImagePresignedUrl || '';
|
|
24
|
+
return (_jsxs(Card, { className: "overflow-hidden border-0 bg-white shadow-lg shadow-purple-100/50", children: [_jsx(CardHeader, { className: "pb-3", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-purple-500 to-violet-600 shadow-md", children: _jsx(Layers, { className: "h-5 w-5 text-white" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CardTitle, { className: "text-lg font-bold text-gray-900", children: "\u0110\u00E1p \u00E1n gh\u00E9p n\u1ED1i" }), _jsxs("span", { className: "inline-flex items-center rounded-full border border-purple-300 bg-purple-100 px-2.5 py-0.5 text-xs font-semibold text-purple-700", children: ["Nh\u00F3m ", currentGroupNumber] })] }), _jsx("p", { className: "text-sm text-gray-500", children: "C\u00E1c \u0111\u00E1p \u00E1n (h\u00ECnh \u1EA3nh + nh\u00E3n) d\u00F9ng \u0111\u1EC3 gh\u00E9p n\u1ED1i v\u1EDBi t\u1EEBng c\u00E2u h\u1ECFi trong nh\u00F3m" })] })] }) }), _jsxs(CardContent, { className: "space-y-4", children: [showGroupTitle && (_jsxs("div", { className: "space-y-2 rounded-xl border border-purple-100 bg-gradient-to-r from-purple-50/30 to-violet-50/30 p-4", children: [_jsxs(Label, { htmlFor: "group-title", className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(Type, { className: "h-4 w-4 text-purple-500" }), "Ti\u00EAu \u0111\u1EC1 nh\u00F3m", _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(d\u00F9ng chung cho c\u1EA3 nh\u00F3m)" })] }), _jsx(Input, { id: "group-title", value: groupTitle, onChange: (e) => onGroupTitleChange(e.target.value), placeholder: "Nh\u1EADp ti\u00EAu \u0111\u1EC1 nh\u00F3m...", className: "border-purple-200 bg-white focus:border-purple-400 focus:ring-purple-200" })] })), showGroupImageUrl && (_jsxs("div", { className: "space-y-2 rounded-xl border border-purple-100 bg-gradient-to-r from-purple-50/30 to-violet-50/30 p-4", children: [_jsxs(Label, { className: "flex items-center gap-2 text-sm font-semibold text-gray-800", children: [_jsx(ImageIcon, { className: "h-4 w-4 text-purple-500" }), "H\u00ECnh \u1EA3nh nh\u00F3m ", _jsx("span", { className: "text-xs font-normal text-gray-500", children: "(T\u00F9y ch\u1ECDn - d\u00F9ng chung cho c\u1EA3 nh\u00F3m)" })] }), _jsx(FileUpload, { id: "group-image", label: "", accept: "image/*", value: groupImageUrl || '', onChange: onGroupImageChange, onPresignedUrlChange: onGroupImagePreviewUrlChange, maxSize: 5, placeholder: "Upload \u1EA3nh nh\u00F3m ho\u1EB7c paste URL", autoUpload: true, prefix: "questions" }), displayGroupImageUrl && (_jsx(ImagePreview, { src: displayGroupImageUrl, alt: "Group image preview", className: "mt-2 h-48 w-full max-w-md rounded-lg border border-gray-200" }))] })), _jsx("div", { className: "space-y-4", children: options.map((option, index) => (_jsx(OptionRow, { option: option, index: index, canRemove: options.length > 2, onUpdate: onUpdateOption, onRemove: onRemoveOption, groupConfig: groupConfig }, index))) }), _jsxs(Button, { variant: "outline", size: "sm", onClick: onAddOption, className: "gap-2 border-purple-300 text-purple-600 hover:bg-purple-50 hover:text-purple-700", children: [_jsx(Plus, { className: "h-4 w-4" }), "Th\u00EAm \u0111\u00E1p \u00E1n (", options.length + 1, ")"] })] })] }));
|
|
25
|
+
}
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export*from
|
|
1
|
+
export * from './creator';
|
|
2
|
+
export * from './creator/dedicated-component-router';
|
|
3
|
+
export * from './creator/question-type-registry';
|
|
4
|
+
export * from './components';
|
|
5
|
+
export * from './groups/ArticlesGroupCard';
|
|
6
|
+
export * from './groups/BasicQuestionGroupCard';
|
|
7
|
+
export * from './groups/DocumentGroupCard';
|
|
8
|
+
export * from './groups/MatchAnswerGroupCard';
|
|
9
|
+
export * from './viewer';
|
|
10
|
+
export * from './_shared';
|
|
11
|
+
export * from './question-bank';
|