@tinyweb_dev/oe-exam-sdk 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/exam-create.js +1 -179
- package/dist/api/exam-create.types.js +1 -1
- package/dist/api/exam-questions.d.ts +1 -1
- package/dist/api/exam-questions.js +1 -98
- package/dist/api/exam-questions.types.d.ts +45 -1
- package/dist/api/exam-questions.types.js +1 -1
- package/dist/api/exam-taking.js +1 -73
- package/dist/api/exam-taking.types.js +1 -1
- package/dist/api/index.js +1 -6
- package/dist/api/result-review.js +1 -50
- package/dist/api/result-review.types.js +1 -1
- package/dist/components/CueCardEditor.js +1 -58
- package/dist/components/common/ResolvedImage.js +1 -15
- package/dist/components/exams/CompletionDialog.d.ts +8 -0
- package/dist/components/exams/CompletionDialog.js +1 -0
- package/dist/components/exams/CreateExamInfoForm.d.ts +4 -1
- package/dist/components/exams/CreateExamInfoForm.js +1 -35
- package/dist/components/exams/CreateExamPageContainer.d.ts +3 -0
- package/dist/components/exams/CreateExamPageContainer.js +1 -103
- package/dist/components/exams/ExamCreator.d.ts +9 -3
- package/dist/components/exams/ExamCreator.js +1 -89
- package/dist/components/exams/ExamPartTabs.d.ts +1 -1
- package/dist/components/exams/ExamPartTabs.js +1 -40
- package/dist/components/exams/ExamPreviewDialog.d.ts +20 -0
- package/dist/components/exams/ExamPreviewDialog.js +1 -0
- package/dist/components/exams/ExamQuestionGrid.d.ts +1 -1
- package/dist/components/exams/ExamQuestionGrid.js +1 -18
- package/dist/components/exams/ExamQuestionsPageContainer.d.ts +3 -0
- package/dist/components/exams/ExamQuestionsPageContainer.js +1 -90
- package/dist/components/exams/ExamViewDialog.d.ts +24 -0
- package/dist/components/exams/ExamViewDialog.js +1 -0
- package/dist/components/exams/PartAudioUploader.js +1 -9
- package/dist/components/exams/TemplateSelector.js +1 -66
- package/dist/components/exams/UnsavedChangesDialog.d.ts +8 -0
- package/dist/components/exams/UnsavedChangesDialog.js +1 -0
- package/dist/components/exams/api.d.ts +1 -1
- package/dist/components/exams/api.js +1 -3
- package/dist/components/exams/create-exam.texts.d.ts +58 -0
- package/dist/components/exams/create-exam.texts.js +1 -0
- package/dist/components/exams/create-exam.validation.js +1 -18
- package/dist/components/exams/exam-question-status.d.ts +9 -0
- package/dist/components/exams/exam-question-status.js +1 -0
- package/dist/components/exams/exam-template.utils.js +1 -18
- package/dist/components/exams/index.d.ts +11 -1
- package/dist/components/exams/index.js +1 -10
- package/dist/components/exams/take/ExamTakingPageContainer.js +1 -153
- package/dist/components/exams/take/GenericQuestionRenderer.js +1 -14
- package/dist/components/exams/take/exam-taking.utils.js +1 -88
- package/dist/components/exams/take/hooks/useSpeakingRecorder.js +1 -24
- package/dist/components/exams/take/index.js +1 -2
- package/dist/components/exams/take/types.js +1 -1
- package/dist/components/index.js +1 -42
- package/dist/components/questions/_shared/config/question-types.config.js +1 -333
- package/dist/components/questions/_shared/constants/color-palette.js +1 -21
- package/dist/components/questions/_shared/hooks/useAnswerGroupQuestionGroup.js +1 -105
- package/dist/components/questions/_shared/hooks/useBasicQuestionGroup.js +1 -222
- package/dist/components/questions/_shared/hooks/useCompareImagesGroup.js +1 -140
- package/dist/components/questions/_shared/hooks/useImageQuestionGroup.js +1 -123
- package/dist/components/questions/_shared/hooks/useInfoExchangeGroup.js +1 -50
- package/dist/components/questions/_shared/hooks/useQuestionFormState.js +1 -54
- package/dist/components/questions/_shared/hooks/useQuestionInitialization.js +1 -123
- package/dist/components/questions/_shared/hooks/useQuestionListGroup.js +1 -121
- package/dist/components/questions/_shared/hooks/useQuestionOnChange.js +1 -70
- package/dist/components/questions/_shared/hooks/useSceneQuestionGroup.js +1 -194
- package/dist/components/questions/_shared/index.js +1 -7
- 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 +1 -3
- package/dist/components/questions/_shared/types/color-region.config.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.js +1 -12
- 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 +1 -3
- 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 +1 -3
- 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.js +1 -1
- package/dist/components/questions/_shared/types/question-group.type.js +1 -11
- 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.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.js +1 -1
- 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 +1 -3
- 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 +1 -79
- package/dist/components/questions/_shared/utils/createColorRegionRegistration.js +1 -39
- package/dist/components/questions/_shared/utils/id-generator.js +1 -3
- package/dist/components/questions/_shared/utils/question-validation.js +1 -21
- package/dist/components/questions/components/ColorNode.js +1 -85
- package/dist/components/questions/components/ColorRegionClient.js +1 -545
- package/dist/components/questions/components/ColorRegionCreator.js +1 -420
- package/dist/components/questions/components/ColorRegionNode.js +1 -59
- package/dist/components/questions/components/CreatorGuide.js +1 -103
- package/dist/components/questions/components/NameNode.js +1 -26
- package/dist/components/questions/components/QuestionBankOption.js +1 -46
- package/dist/components/questions/components/QuestionBasicInfoForm.js +1 -9
- package/dist/components/questions/components/QuestionCommonFields.js +1 -33
- package/dist/components/questions/components/QuestionSearchDropdown.js +1 -258
- package/dist/components/questions/components/QuestionTypeSelector.js +1 -32
- package/dist/components/questions/components/QuestionTypeSpecificForms.js +1 -6
- package/dist/components/questions/components/RegionNode.js +1 -94
- package/dist/components/questions/components/index.js +1 -14
- package/dist/components/questions/creator/QuestionCreator.js +1 -90
- package/dist/components/questions/creator/QuestionGroupCreator.js +1 -119
- package/dist/components/questions/creator/dedicated-component-router.js +1 -79
- package/dist/components/questions/creator/index.js +1 -3
- package/dist/components/questions/creator/question-type-registry.js +1 -80
- package/dist/components/questions/groups/ArticlesGroupCard.js +1 -121
- package/dist/components/questions/groups/BasicQuestionGroupCard.js +1 -50
- package/dist/components/questions/groups/DocumentGroupCard.js +1 -114
- package/dist/components/questions/groups/MatchAnswerGroupCard.js +1 -25
- package/dist/components/questions/index.js +1 -10
- package/dist/components/questions/types/answer-the-question/AnswerTheQuestionClient.js +1 -37
- package/dist/components/questions/types/answer-the-question/AnswerTheQuestionCreator.js +1 -351
- package/dist/components/questions/types/answer-the-question/register.js +1 -67
- package/dist/components/questions/types/answer-the-question/transform.js +1 -36
- package/dist/components/questions/types/arrange-letters-into-words/ArrangeLettersIntoWordsClient.js +1 -141
- package/dist/components/questions/types/arrange-letters-into-words/ArrangeLettersIntoWordsCreator.js +1 -118
- package/dist/components/questions/types/arrange-letters-into-words/index.js +1 -2
- package/dist/components/questions/types/arrange-letters-into-words/register.js +1 -4
- package/dist/components/questions/types/arrange-letters-into-words/transform.js +1 -24
- package/dist/components/questions/types/choose-correct-adjective/ChooseCorrectAdjectiveClient.js +1 -64
- package/dist/components/questions/types/choose-correct-adjective/ChooseCorrectAdjectiveCreator.js +1 -169
- package/dist/components/questions/types/choose-correct-adjective/index.js +1 -2
- package/dist/components/questions/types/choose-correct-adjective/register.js +1 -55
- package/dist/components/questions/types/choose-correct-adjective/transform.js +1 -16
- package/dist/components/questions/types/choose-the-correct-answer/ChooseTheCorrectAnswerClient.js +1 -131
- package/dist/components/questions/types/choose-the-correct-answer/ChooseTheCorrectAnswerCreator.js +1 -581
- package/dist/components/questions/types/choose-the-correct-answer/index.js +1 -2
- package/dist/components/questions/types/choose-the-correct-answer/register.js +1 -101
- package/dist/components/questions/types/choose-the-correct-answer/transform.js +1 -43
- package/dist/components/questions/types/fill-in-blank/FillInBlankClient.js +1 -275
- package/dist/components/questions/types/fill-in-blank/FillInBlankCreator.js +1 -448
- package/dist/components/questions/types/fill-in-blank/index.js +1 -2
- package/dist/components/questions/types/fill-in-blank/register.js +1 -138
- package/dist/components/questions/types/fill-in-blank/transform.js +1 -59
- package/dist/components/questions/types/fill-missing-words-in-grid/FillMissingWordsInGridClient.js +1 -117
- package/dist/components/questions/types/fill-missing-words-in-grid/FillMissingWordsInGridCreator.js +1 -671
- package/dist/components/questions/types/fill-missing-words-in-grid/index.js +1 -2
- package/dist/components/questions/types/fill-missing-words-in-grid/register.js +1 -37
- package/dist/components/questions/types/fill-missing-words-in-grid/transform.js +1 -15
- package/dist/components/questions/types/gn-speaking-interview/GNSpeakingInterviewCreator.js +1 -262
- package/dist/components/questions/types/gn-speaking-interview/register.js +1 -121
- package/dist/components/questions/types/gn-speaking-interview/transform.js +1 -48
- package/dist/components/questions/types/image-object-matching/ImageObjectMatchingClient.js +1 -16
- package/dist/components/questions/types/image-object-matching/ImageObjectMatchingCreator.js +1 -27
- package/dist/components/questions/types/image-object-matching/index.js +1 -2
- package/dist/components/questions/types/image-object-matching/register.js +1 -3
- package/dist/components/questions/types/image-object-matching/transform.js +1 -2
- package/dist/components/questions/types/label-the-picture/LabelThePictureClient.js +1 -102
- package/dist/components/questions/types/label-the-picture/LabelThePictureCreator.js +1 -344
- package/dist/components/questions/types/label-the-picture/index.js +1 -2
- package/dist/components/questions/types/label-the-picture/register.js +1 -54
- package/dist/components/questions/types/label-the-picture/transform.js +1 -28
- package/dist/components/questions/types/listen-and-choose-from-answer-group/ListenAndChooseFromAnswerGroupClient.js +1 -78
- package/dist/components/questions/types/listen-and-choose-from-answer-group/ListenAndChooseFromAnswerGroupCreator.js +1 -232
- package/dist/components/questions/types/listen-and-choose-from-answer-group/index.js +1 -2
- package/dist/components/questions/types/listen-and-choose-from-answer-group/register.js +1 -82
- package/dist/components/questions/types/listen-and-choose-from-answer-group/transform.js +1 -27
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/ListenAndChooseObjectsInSceneClient.js +1 -70
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/ListenAndChooseObjectsInSceneCreator.js +1 -386
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/index.js +1 -2
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/register.js +1 -100
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/transform.js +1 -33
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/ListenAndDragObjectsIntoSceneClient.js +1 -106
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/ListenAndDragObjectsIntoSceneCreator.js +1 -457
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/index.js +1 -2
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/register.js +1 -110
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/transform.js +1 -35
- package/dist/components/questions/types/listen-and-speak-answer/ArrowIndicator.js +1 -8
- package/dist/components/questions/types/listen-and-speak-answer/ListenAndSpeakAnswerClient.js +1 -22
- package/dist/components/questions/types/listen-and-speak-answer/ListenAndSpeakAnswerCreator.js +1 -291
- package/dist/components/questions/types/listen-and-speak-answer/index.js +1 -2
- package/dist/components/questions/types/listen-and-speak-answer/register.js +1 -84
- package/dist/components/questions/types/listen-and-speak-answer/transform.js +1 -27
- package/dist/components/questions/types/listen-and-speak-compare-images/ListenAndSpeakCompareImagesClient.js +1 -32
- package/dist/components/questions/types/listen-and-speak-compare-images/ListenAndSpeakCompareImagesCreator.js +1 -295
- package/dist/components/questions/types/listen-and-speak-compare-images/register.js +1 -79
- package/dist/components/questions/types/listen-and-speak-compare-images/transform.js +1 -27
- package/dist/components/questions/types/listen-and-speak-image-group/ListenAndSpeakImageGroupClient.js +1 -34
- package/dist/components/questions/types/listen-and-speak-image-group/ListenAndSpeakImageGroupCreator.js +1 -285
- package/dist/components/questions/types/listen-and-speak-image-group/register.js +1 -81
- package/dist/components/questions/types/listen-and-speak-image-group/transform.js +1 -26
- package/dist/components/questions/types/listen-and-speak-info-exchange/ListenAndSpeakInfoExchangeClient.js +1 -38
- package/dist/components/questions/types/listen-and-speak-info-exchange/ListenAndSpeakInfoExchangeCreator.js +1 -385
- package/dist/components/questions/types/listen-and-speak-info-exchange/register.js +1 -87
- package/dist/components/questions/types/listen-and-speak-info-exchange/transform.js +1 -32
- package/dist/components/questions/types/listen-and-speak-odd-one-out/ListenAndSpeakOddOneOutClient.js +1 -26
- package/dist/components/questions/types/listen-and-speak-odd-one-out/ListenAndSpeakOddOneOutCreator.js +1 -247
- package/dist/components/questions/types/listen-and-speak-odd-one-out/register.js +1 -59
- package/dist/components/questions/types/listen-and-speak-odd-one-out/transform.js +1 -18
- package/dist/components/questions/types/listen-and-speak-question-list/ListenAndSpeakQuestionListClient.js +1 -26
- package/dist/components/questions/types/listen-and-speak-question-list/ListenAndSpeakQuestionListCreator.js +1 -256
- package/dist/components/questions/types/listen-and-speak-question-list/register.js +1 -81
- package/dist/components/questions/types/listen-and-speak-question-list/transform.js +1 -26
- package/dist/components/questions/types/listen-and-speak-with-story-images/ListenAndSpeakWithStoryImagesClient.js +1 -26
- package/dist/components/questions/types/listen-and-speak-with-story-images/ListenAndSpeakWithStoryImagesCreator.js +1 -230
- package/dist/components/questions/types/listen-and-speak-with-story-images/register.js +1 -56
- package/dist/components/questions/types/listen-and-speak-with-story-images/transform.js +1 -16
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerClient.js +1 -72
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerCreator.js +1 -230
- 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 +1 -66
- package/dist/components/questions/types/look-picture-choose-correct-answer/transform.js +1 -42
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerClient.js +1 -96
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerCreator.js +1 -238
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/index.js +1 -2
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/register.js +1 -76
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/transform.js +1 -19
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintClient.js +1 -134
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintCreator.js +1 -617
- package/dist/components/questions/types/look-picture-fill-word-hint/index.js +1 -2
- package/dist/components/questions/types/look-picture-fill-word-hint/register.js +1 -82
- package/dist/components/questions/types/look-picture-fill-word-hint/transform.js +1 -29
- package/dist/components/questions/types/match-by-writing-answer/MatchByWritingAnswerClient.js +1 -38
- package/dist/components/questions/types/match-by-writing-answer/MatchByWritingAnswerCreator.js +1 -359
- package/dist/components/questions/types/match-by-writing-answer/index.js +1 -3
- package/dist/components/questions/types/match-by-writing-answer/register.js +1 -58
- package/dist/components/questions/types/match-by-writing-answer/transform.js +1 -61
- package/dist/components/questions/types/read-and-color-objects/ReadAndColorObjectsClient.js +1 -16
- package/dist/components/questions/types/read-and-color-objects/ReadAndColorObjectsCreator.js +1 -23
- package/dist/components/questions/types/read-and-color-objects/index.js +1 -2
- package/dist/components/questions/types/read-and-color-objects/register.js +1 -3
- package/dist/components/questions/types/read-and-color-objects/transform.js +1 -36
- package/dist/components/questions/types/read-displayed-content/ReadDisplayedContentCreator.js +1 -125
- package/dist/components/questions/types/read-displayed-content/register.js +1 -64
- package/dist/components/questions/types/read-displayed-content/transform.js +1 -12
- package/dist/components/questions/types/read-passage-and-answer-questions/ReadPassageAndAnswerQuestionsClient.js +1 -64
- package/dist/components/questions/types/read-passage-and-answer-questions/ReadPassageAndAnswerQuestionsCreator.js +1 -511
- package/dist/components/questions/types/read-passage-and-answer-questions/index.js +1 -2
- package/dist/components/questions/types/read-passage-and-answer-questions/register.js +1 -58
- package/dist/components/questions/types/read-passage-and-answer-questions/transform.js +1 -28
- package/dist/components/questions/types/speaking-conversation/SpeakingConversationCreator.js +1 -373
- package/dist/components/questions/types/speaking-conversation/SpeakingConversationPreviewClient.js +1 -41
- package/dist/components/questions/types/speaking-conversation/register.js +1 -110
- package/dist/components/questions/types/speaking-conversation/transform.js +1 -34
- package/dist/components/questions/types/speaking-cue-card/SpeakingCueCardCreator.js +1 -74
- package/dist/components/questions/types/speaking-cue-card/register.js +1 -52
- package/dist/components/questions/types/speaking-cue-card/transform.js +1 -12
- package/dist/components/questions/types/speaking-describe-image/SpeakingDescribeImageClient.js +1 -10
- package/dist/components/questions/types/speaking-describe-image/SpeakingDescribeImageCreator.js +1 -161
- package/dist/components/questions/types/speaking-describe-image/index.js +1 -2
- package/dist/components/questions/types/speaking-describe-image/register.js +1 -69
- package/dist/components/questions/types/speaking-describe-image/transform.js +1 -16
- package/dist/components/questions/types/spontaneous-qa/SpontaneousQACreator.js +1 -234
- package/dist/components/questions/types/spontaneous-qa/register.js +1 -93
- package/dist/components/questions/types/spontaneous-qa/transform.js +1 -34
- package/dist/components/questions/types/true-false/TrueFalseClient.js +1 -75
- package/dist/components/questions/types/true-false/TrueFalseCreator.js +1 -244
- package/dist/components/questions/types/true-false/index.js +1 -2
- package/dist/components/questions/types/true-false/register.js +1 -77
- package/dist/components/questions/types/true-false/transform.js +1 -32
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphClient.js +1 -233
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphCreator.js +1 -631
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphWrapper.js +1 -28
- package/dist/components/questions/types/word-fill-paragraph/index.js +1 -2
- package/dist/components/questions/types/word-fill-paragraph/register.js +1 -136
- package/dist/components/questions/types/word-fill-paragraph/transform.js +1 -56
- package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormClient.js +1 -138
- package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormCreator.js +1 -261
- package/dist/components/questions/types/word-fill-structured-form/index.js +1 -2
- package/dist/components/questions/types/word-fill-structured-form/register.js +1 -67
- package/dist/components/questions/types/word-fill-structured-form/transform.js +1 -40
- package/dist/components/questions/types/word-ordering/WordOrderingClient.js +1 -84
- package/dist/components/questions/types/word-ordering/WordOrderingCreator.js +1 -192
- package/dist/components/questions/types/word-ordering/index.js +1 -2
- package/dist/components/questions/types/word-ordering/register.js +1 -46
- package/dist/components/questions/types/word-ordering/transform.js +1 -24
- package/dist/components/questions/types/write-a-short-letter/WriteAShortLetterClient.js +1 -98
- package/dist/components/questions/types/write-a-short-letter/WriteAShortLetterCreator.js +1 -320
- package/dist/components/questions/types/write-a-short-letter/index.js +1 -2
- package/dist/components/questions/types/write-a-short-letter/register.js +1 -68
- package/dist/components/questions/types/write-a-short-letter/transform.js +1 -25
- package/dist/components/questions/types/write-correct-verb-form/WriteCorrectVerbFormClient.js +1 -61
- package/dist/components/questions/types/write-correct-verb-form/WriteCorrectVerbFormCreator.js +1 -196
- package/dist/components/questions/types/write-correct-verb-form/index.js +1 -2
- package/dist/components/questions/types/write-correct-verb-form/register.js +1 -62
- package/dist/components/questions/types/write-correct-verb-form/transform.js +1 -17
- package/dist/components/questions/types/write-sentences/WriteSentencesClient.js +1 -22
- package/dist/components/questions/types/write-sentences/WriteSentencesCreator.js +1 -174
- package/dist/components/questions/types/write-sentences/index.js +1 -2
- package/dist/components/questions/types/write-sentences/register.js +1 -58
- package/dist/components/questions/types/write-sentences/transform.js +1 -28
- package/dist/components/questions/types/write-short-paragraph/WriteShortParagraphClient.js +1 -96
- package/dist/components/questions/types/write-short-paragraph/WriteShortParagraphCreator.js +1 -161
- package/dist/components/questions/types/write-short-paragraph/index.js +1 -2
- package/dist/components/questions/types/write-short-paragraph/register.js +1 -4
- package/dist/components/questions/types/write-short-paragraph/transform.js +1 -21
- package/dist/components/questions/viewer/QuestionGroupViewer.js +1 -36
- package/dist/components/questions/viewer/QuestionViewer.js +1 -446
- package/dist/components/questions/viewer/index.js +1 -2
- package/dist/components/results/ResultReviewPageContainer.js +1 -98
- package/dist/components/results/ReviewQuestionRenderer.js +1 -72
- package/dist/components/results/index.js +1 -2
- package/dist/components/results/result-review.utils.js +1 -6
- package/dist/components/results/review-data.js +1 -150
- package/dist/components/results/review-renderer.utils.js +1 -97
- package/dist/components/results/review-types.js +1 -1
- package/dist/components/themes/cambridge-yle/CambridgeYleAudioPlayer.js +1 -138
- package/dist/components/themes/cambridge-yle/CambridgeYleBottomNav.js +1 -12
- package/dist/components/themes/cambridge-yle/CambridgeYleExamLayout.js +1 -18
- package/dist/components/themes/cambridge-yle/CambridgeYleExampleText.js +1 -11
- package/dist/components/themes/cambridge-yle/CambridgeYleHeader.js +1 -11
- package/dist/components/themes/cambridge-yle/CambridgeYleInstructionBanner.js +1 -9
- package/dist/components/themes/cambridge-yle/CambridgeYleNavButton.js +1 -13
- package/dist/components/themes/cambridge-yle/CambridgeYlePartBanner.js +1 -8
- package/dist/components/themes/cambridge-yle/CambridgeYleProgressBar.js +1 -6
- package/dist/components/themes/cambridge-yle/CambridgeYleQuestionCard.js +1 -5
- package/dist/components/themes/cambridge-yle/CambridgeYleQuestionCardFullWidth.js +1 -9
- package/dist/components/themes/cambridge-yle/CambridgeYleSidebar.js +1 -41
- package/dist/components/themes/cambridge-yle/CambridgeYleTimer.js +1 -25
- package/dist/components/themes/cambridge-yle/index.js +1 -13
- package/dist/components/themes/english-certification/EcAnswerTheQuestion.js +1 -24
- package/dist/components/themes/english-certification/EcMatchByWritingAnswer.js +1 -88
- package/dist/components/themes/english-certification/EcWordFillParagraph.js +1 -55
- package/dist/components/themes/english-certification/EcWordFillStructuredForm.js +1 -156
- package/dist/components/themes/english-certification/EcWritingTask.js +1 -34
- package/dist/components/themes/english-certification/EnglishCertificationAudioPlayer.js +1 -114
- package/dist/components/themes/english-certification/EnglishCertificationBrand.js +1 -11
- package/dist/components/themes/english-certification/EnglishCertificationExamLayout.js +1 -21
- package/dist/components/themes/english-certification/EnglishCertificationFlagButton.js +1 -15
- package/dist/components/themes/english-certification/EnglishCertificationFooterBar.js +1 -19
- package/dist/components/themes/english-certification/EnglishCertificationGroupedQuestion.js +1 -148
- package/dist/components/themes/english-certification/EnglishCertificationHeader.js +1 -31
- package/dist/components/themes/english-certification/EnglishCertificationNavigationPanel.js +1 -71
- package/dist/components/themes/english-certification/EnglishCertificationOptionSelector.js +1 -33
- package/dist/components/themes/english-certification/EnglishCertificationPassagePanel.js +1 -16
- package/dist/components/themes/english-certification/EnglishCertificationQuestionCard.js +1 -22
- package/dist/components/themes/english-certification/EnglishCertificationQuestionItem.js +1 -37
- package/dist/components/themes/english-certification/EnglishCertificationQuestionRenderer.js +1 -72
- package/dist/components/themes/english-certification/EnglishCertificationReadingSection.js +1 -90
- package/dist/components/themes/english-certification/EnglishCertificationSingleQuestion.js +1 -18
- package/dist/components/themes/english-certification/EnglishCertificationSingleQuestionList.js +1 -29
- package/dist/components/themes/english-certification/english-certification-theme.js +1 -58
- package/dist/components/themes/english-certification/grouped-question-utils.js +1 -218
- package/dist/components/themes/english-certification/index.js +1 -21
- package/dist/components/themes/index.js +1 -6
- package/dist/components/themes/summer-sky/SummerSkyAudioPlayer.js +1 -170
- package/dist/components/themes/summer-sky/SummerSkyLayout.js +1 -221
- package/dist/components/themes/summer-sky/SummerSkySubmitModal.js +1 -18
- package/dist/components/themes/summer-sky/SummerSkyWaitingRoom.js +1 -194
- package/dist/components/themes/types.js +1 -1
- package/dist/components/ui/alert-dialog.js +1 -26
- package/dist/components/ui/alert.js +1 -22
- package/dist/components/ui/avatar.js +1 -12
- package/dist/components/ui/badge.js +1 -38
- package/dist/components/ui/button.js +1 -35
- package/dist/components/ui/calendar.js +1 -76
- package/dist/components/ui/card.js +1 -16
- package/dist/components/ui/carousel.js +1 -91
- package/dist/components/ui/checkbox.js +1 -9
- package/dist/components/ui/collapsible.js +1 -13
- package/dist/components/ui/command.js +1 -34
- package/dist/components/ui/confirm-dialog.js +1 -49
- package/dist/components/ui/dialog.js +1 -23
- package/dist/components/ui/drawer.js +1 -35
- package/dist/components/ui/dropdown-menu.js +1 -33
- package/dist/components/ui/file-upload.js +1 -155
- package/dist/components/ui/form.js +1 -62
- package/dist/components/ui/hover-card.js +1 -10
- package/dist/components/ui/image-preview.js +1 -29
- package/dist/components/ui/input.js +1 -8
- package/dist/components/ui/label.js +1 -9
- package/dist/components/ui/language-switcher.js +1 -15
- package/dist/components/ui/multi-select.js +1 -90
- package/dist/components/ui/points-input.js +1 -33
- package/dist/components/ui/popover.js +1 -26
- package/dist/components/ui/progress.js +1 -16
- package/dist/components/ui/radio-group.js +1 -12
- package/dist/components/ui/scroll-area.js +1 -11
- package/dist/components/ui/select.js +1 -38
- package/dist/components/ui/separator.js +1 -8
- package/dist/components/ui/sheet.js +1 -40
- package/dist/components/ui/single-select.js +1 -76
- package/dist/components/ui/skeleton.js +1 -6
- package/dist/components/ui/switch.js +1 -8
- package/dist/components/ui/table.js +1 -20
- package/dist/components/ui/tabs.js +1 -17
- package/dist/components/ui/textarea.js +1 -8
- package/dist/components/ui/tooltip.js +1 -11
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -19
- package/dist/mcp/config.js +1 -32
- package/dist/mcp/http-client.js +1 -48
- package/dist/mcp/index.js +1 -29
- package/dist/mcp/tools/_helpers.js +1 -25
- package/dist/mcp/tools/exams.js +1 -439
- package/dist/mcp/tools/index.js +1 -6
- package/dist/mcp/tools/results.js +1 -19
- package/dist/shared/constants/ApiConstant.js +1 -276
- package/dist/shared/constants/QueryKeyConstant.js +1 -112
- package/dist/shared/constants/exam-level.enum.js +1 -41
- package/dist/shared/constants/landings/placement-test.constants.js +1 -431
- package/dist/shared/constants/question-skills.js +1 -267
- package/dist/shared/constants/routes.js +1 -81
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +1 -7
- package/dist/shared/lib/hooks/index.js +1 -10
- package/dist/shared/lib/hooks/useAlertDialog.js +1 -57
- package/dist/shared/lib/hooks/useAudioPlayCounter.js +1 -30
- package/dist/shared/lib/hooks/useAudioPreview.js +1 -81
- package/dist/shared/lib/hooks/useAudioUpload.js +1 -24
- package/dist/shared/lib/hooks/useConfirmDialog.js +1 -89
- package/dist/shared/lib/hooks/useDebouncedCallback.js +1 -32
- package/dist/shared/lib/hooks/useDelayedAutoPlay.js +1 -12
- package/dist/shared/lib/hooks/useFileUpload.js +1 -24
- package/dist/shared/lib/hooks/useImageUrl.js +1 -5
- package/dist/shared/lib/hooks/usePresignedFileUrl.js +1 -10
- package/dist/shared/lib/hooks/useReactHookForm.js +1 -31
- package/dist/shared/lib/hooks/useToast.js +1 -62
- package/dist/shared/lib/i18n/index.js +1 -54
- package/dist/shared/lib/i18n/messages/en/admin.js +1 -2104
- package/dist/shared/lib/i18n/messages/en/auth.js +1 -86
- package/dist/shared/lib/i18n/messages/en/common.js +1 -140
- package/dist/shared/lib/i18n/messages/en/file-upload.js +1 -18
- package/dist/shared/lib/i18n/messages/en/student.js +1 -133
- package/dist/shared/lib/i18n/messages/en/terms.js +1 -37
- package/dist/shared/lib/i18n/messages/en.js +1 -15
- package/dist/shared/lib/i18n/messages/vi/admin.js +1 -2104
- package/dist/shared/lib/i18n/messages/vi/auth.js +1 -86
- package/dist/shared/lib/i18n/messages/vi/common.js +1 -140
- package/dist/shared/lib/i18n/messages/vi/file-upload.js +1 -18
- package/dist/shared/lib/i18n/messages/vi/student.js +1 -133
- package/dist/shared/lib/i18n/messages/vi/terms.js +1 -37
- package/dist/shared/lib/i18n/messages/vi.js +1 -15
- package/dist/shared/lib/i18n/types.js +1 -1
- package/dist/shared/lib/stores/examQuestionStore.js +1 -212
- package/dist/shared/lib/stores/localeStore.js +1 -10
- package/dist/shared/lib/utils/public-page.js +1 -44
- package/dist/shared/lib/utils/question-reverse-transform.d.ts +6 -0
- package/dist/shared/lib/utils/question-reverse-transform.js +1 -0
- package/dist/shared/lib/utils/question-transform-types.js +1 -1
- package/dist/shared/lib/utils/question-transform-validation.d.ts +6 -0
- package/dist/shared/lib/utils/question-transform-validation.js +1 -0
- package/dist/shared/lib/utils/question-transform.d.ts +6 -2
- package/dist/shared/lib/utils/question-transform.js +1 -174
- package/dist/shared/lib/utils.js +1 -168
- package/dist/shared/lib/validation/choose-correct-answer.validation.js +1 -111
- package/dist/shared/lib/validation/label-the-picture.validation.js +1 -19
- package/dist/shared/lib/validation/listen-and-choose-from-answer-group.validation.js +1 -46
- package/dist/shared/lib/validation/listen-and-choose-objects-in-scene.validation.js +1 -21
- package/dist/shared/lib/validation/listen-and-drag-objects-into-scene.validation.js +1 -34
- package/dist/shared/lib/validation/listen-and-speak-answer.validation.js +1 -40
- package/dist/shared/lib/validation/listen-and-speak-compare-images.validation.js +1 -45
- package/dist/shared/lib/validation/listen-and-speak-image-group.validation.js +1 -19
- package/dist/shared/lib/validation/listen-and-speak-info-exchange.validation.js +1 -39
- package/dist/shared/lib/validation/listen-and-speak-odd-one-out.validation.js +1 -32
- package/dist/shared/lib/validation/listen-and-speak-question-list.validation.js +1 -19
- package/dist/shared/lib/validation/listen-and-speak-with-story-images.validation.js +1 -28
- package/dist/shared/lib/validation/look-picture-choose-correct-answer.validation.js +1 -12
- package/dist/shared/lib/validation/look-picture-fill-blank-choose-answer.validation.js +1 -47
- package/dist/shared/lib/validation/read-and-color-objects.validation.js +1 -29
- package/dist/shared/lib/validation/read-displayed-content.validation.js +1 -28
- package/dist/shared/lib/validation/speaking-conversation.validation.js +1 -75
- package/dist/shared/lib/validation/speaking-describe-image.validation.js +1 -31
- package/dist/shared/lib/validation/spontaneous-qa.validation.js +1 -48
- package/dist/shared/lib/validation/word-fill-paragraph-default.validation.js +1 -38
- package/dist/shared/lib/validation/word-fill-paragraph-with-options.validation.js +1 -39
- package/dist/shared/lib/validation/word-fill-paragraph.validation.js +1 -43
- package/dist/shared/lib/validation/word-ordering.validation.js +1 -33
- package/dist/shared/types/branch.types.js +1 -6
- package/dist/shared/types/common.types.js +1 -50
- package/dist/shared/types/entities/exam-schedule.types.js +1 -5
- package/dist/shared/types/entities/exam.types.js +1 -1
- package/dist/shared/types/entities/question.types.js +1 -4
- package/dist/shared/types/entities/result.types.js +1 -4
- package/dist/shared/types/entities/user.types.js +1 -4
- package/dist/shared/types/exam-taking.types.js +1 -2
- package/dist/shared/types/history.types.js +1 -34
- package/dist/shared/types/index.js +1 -1
- package/dist/shared/types/questions/choose-correct-adjective.js +1 -4
- package/dist/shared/types/questions/choose-the-correct-answer.js +1 -9
- package/dist/shared/types/questions/fill-missing-words-in-grid.js +1 -11
- package/dist/shared/types/questions/index.js +1 -40
- 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 +1 -3
- package/dist/shared/types/questions/listen-and-speak-odd-one-out.js +1 -3
- 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 +1 -3
- package/dist/shared/types/questions/look-picture-choose-correct-answer.js +1 -5
- package/dist/shared/types/questions/look-picture-fill-blank-choose-answer.js +1 -9
- package/dist/shared/types/questions/look-picture-fill-word-hint.js +1 -7
- package/dist/shared/types/questions/read-displayed-content.js +1 -1
- package/dist/shared/types/questions/speaking-conversation.js +1 -7
- 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/write-correct-verb-form.js +1 -12
- package/dist/shared/types/role.types.js +1 -1
- package/dist/shared/types/structure-management.js +1 -28
- package/dist/shared/types/student.types.js +1 -54
- package/dist/shared/types/teacher-dashboard-rooms.js +1 -2
- package/package.json +12 -3
|
@@ -1,100 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const listenAndChooseObjectsInSceneRegistration = {
|
|
3
|
-
component: ListenAndChooseObjectsInSceneCreator,
|
|
4
|
-
transformInitialData: (initialData) => {
|
|
5
|
-
if (!initialData)
|
|
6
|
-
return undefined;
|
|
7
|
-
const d = initialData;
|
|
8
|
-
// Group scene data
|
|
9
|
-
// Use data from questionGroup.payload first (API format), fallback to answer (reverse-transformed)
|
|
10
|
-
const backgroundImageUrl = d?.questionGroup?.payload?.backgroundImageUrl ||
|
|
11
|
-
d?.answer?.backgroundImageUrl ||
|
|
12
|
-
d?.content?.backgroundImageUrl ||
|
|
13
|
-
d?.backgroundImageUrl || '';
|
|
14
|
-
const objectNodes = (d?.questionGroup?.payload?.objectNodes?.length > 0 && d?.questionGroup?.payload?.objectNodes) ||
|
|
15
|
-
(d?.answer?.objectNodes?.length > 0 && d?.answer?.objectNodes) ||
|
|
16
|
-
(d?.content?.objectNodes?.length > 0 && d?.content?.objectNodes) ||
|
|
17
|
-
d?.objectNodes || [];
|
|
18
|
-
// Question specific data - prioritize content (API) then answer (reverse-transformed)
|
|
19
|
-
const audioUrl = d?.content?.audioUrl || d?.answer?.audioUrl || d?.audioUrl || '';
|
|
20
|
-
// Correct object ID from multiple possible locations
|
|
21
|
-
// After reverse transform: answer.correctObjectId has the value
|
|
22
|
-
// From API directly: correctAnswer.objectId has the value
|
|
23
|
-
const correctObjectId = d?.answer?.correctObjectId ||
|
|
24
|
-
d?.correctAnswer?.objectId ||
|
|
25
|
-
d?.answer?.objectId ||
|
|
26
|
-
d?.content?.correctObjectId ||
|
|
27
|
-
d?.correctObjectId || '';
|
|
28
|
-
// Points and explanation - top-level fields take priority (set by transformApiQuestionToFrontend)
|
|
29
|
-
const points = d?.points || d?.answer?.points || 1;
|
|
30
|
-
const explanation = d?.explanation || d?.answer?.explanation || d?.content?.explanation || '';
|
|
31
|
-
const isBackup = d?.content?.isBackup || d?.isBackup || false;
|
|
32
|
-
console.log('[LISTEN_AND_CHOOSE_OBJECTS_IN_SCENE register] transformInitialData:', {
|
|
33
|
-
correctObjectId,
|
|
34
|
-
audioUrl: audioUrl ? '✓' : '✗',
|
|
35
|
-
backgroundImageUrl: backgroundImageUrl ? '✓' : '✗',
|
|
36
|
-
objectNodesCount: objectNodes?.length || 0,
|
|
37
|
-
sources: {
|
|
38
|
-
'answer.correctObjectId': d?.answer?.correctObjectId,
|
|
39
|
-
'correctAnswer.objectId': d?.correctAnswer?.objectId,
|
|
40
|
-
'answer.objectId': d?.answer?.objectId,
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
// Create a lean, flat, structure for the Creator component
|
|
44
|
-
return {
|
|
45
|
-
audioUrl,
|
|
46
|
-
backgroundImageUrl,
|
|
47
|
-
objectNodes,
|
|
48
|
-
correctObjectId,
|
|
49
|
-
points,
|
|
50
|
-
explanation,
|
|
51
|
-
isBackup,
|
|
52
|
-
isCompleted: d?.isCompleted
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
getExtraProps: (ctx) => ({
|
|
56
|
-
groups: ctx.groups,
|
|
57
|
-
questionIndexInPart: ctx.questionIndexInPart,
|
|
58
|
-
partId: ctx.partId,
|
|
59
|
-
onUnsavedChangesChange: ctx.onUnsavedChangesChange,
|
|
60
|
-
validationRef: ctx.validationRef,
|
|
61
|
-
}),
|
|
62
|
-
wrapOnSave: (data, ctx) => ({
|
|
63
|
-
type: ctx.questionType,
|
|
64
|
-
content: {
|
|
65
|
-
...(typeof ctx.state.content === 'object' && ctx.state.content !== null ? ctx.state.content : {}),
|
|
66
|
-
isBackup: data.isBackup || false,
|
|
67
|
-
},
|
|
68
|
-
answer: {
|
|
69
|
-
audioUrl: data.audioUrl,
|
|
70
|
-
backgroundImageUrl: data.backgroundImageUrl,
|
|
71
|
-
objectNodes: data.objectNodes,
|
|
72
|
-
correctObjectId: data.correctObjectId,
|
|
73
|
-
groupNumber: data.groupNumber,
|
|
74
|
-
},
|
|
75
|
-
points: data?.points ?? ctx.state.points ?? 1,
|
|
76
|
-
level: ctx.state.level,
|
|
77
|
-
difficulty: ctx.state.difficulty,
|
|
78
|
-
skill: ctx.state.skill,
|
|
79
|
-
explanation: data?.explanation || '',
|
|
80
|
-
}),
|
|
81
|
-
wrapOnChange: (data, ctx) => ({
|
|
82
|
-
type: ctx.questionType,
|
|
83
|
-
content: {
|
|
84
|
-
...(typeof ctx.state.content === 'object' && ctx.state.content !== null ? ctx.state.content : {}),
|
|
85
|
-
isBackup: data.isBackup || false,
|
|
86
|
-
},
|
|
87
|
-
answer: {
|
|
88
|
-
audioUrl: data.audioUrl,
|
|
89
|
-
backgroundImageUrl: data.backgroundImageUrl,
|
|
90
|
-
objectNodes: data.objectNodes,
|
|
91
|
-
correctObjectId: data.correctObjectId,
|
|
92
|
-
groupNumber: data.groupNumber,
|
|
93
|
-
},
|
|
94
|
-
points: data?.points ?? ctx.state.points ?? 1,
|
|
95
|
-
level: ctx.state.level,
|
|
96
|
-
difficulty: ctx.state.difficulty,
|
|
97
|
-
skill: ctx.state.skill,
|
|
98
|
-
explanation: data?.explanation || '',
|
|
99
|
-
}),
|
|
100
|
-
};
|
|
1
|
+
import{ListenAndChooseObjectsInSceneCreator as e}from"./ListenAndChooseObjectsInSceneCreator";export const listenAndChooseObjectsInSceneRegistration={component:e,transformInitialData:e=>{if(!e)return;const t=e,o=t?.questionGroup?.payload?.backgroundImageUrl||t?.answer?.backgroundImageUrl||t?.content?.backgroundImageUrl||t?.backgroundImageUrl||"",n=t?.questionGroup?.payload?.objectNodes?.length>0&&t?.questionGroup?.payload?.objectNodes||t?.answer?.objectNodes?.length>0&&t?.answer?.objectNodes||t?.content?.objectNodes?.length>0&&t?.content?.objectNodes||t?.objectNodes||[],a=t?.content?.audioUrl||t?.answer?.audioUrl||t?.audioUrl||"",r=t?.answer?.correctObjectId||t?.correctAnswer?.objectId||t?.answer?.objectId||t?.content?.correctObjectId||t?.correctObjectId||"",c=t?.points||t?.answer?.points||1,s=t?.explanation||t?.answer?.explanation||t?.content?.explanation||"",i=t?.content?.isBackup||t?.isBackup||!1;return console.log("[LISTEN_AND_CHOOSE_OBJECTS_IN_SCENE register] transformInitialData:",{correctObjectId:r,audioUrl:a?"✓":"✗",backgroundImageUrl:o?"✓":"✗",objectNodesCount:n?.length||0,sources:{"answer.correctObjectId":t?.answer?.correctObjectId,"correctAnswer.objectId":t?.correctAnswer?.objectId,"answer.objectId":t?.answer?.objectId}}),{audioUrl:a,backgroundImageUrl:o,objectNodes:n,correctObjectId:r,points:c,explanation:s,isBackup:i,isCompleted:t?.isCompleted}},getExtraProps:e=>({groups:e.groups,questionIndexInPart:e.questionIndexInPart,partId:e.partId,onUnsavedChangesChange:e.onUnsavedChangesChange,validationRef:e.validationRef}),wrapOnSave:(e,t)=>({type:t.questionType,content:{..."object"==typeof t.state.content&&null!==t.state.content?t.state.content:{},isBackup:e.isBackup||!1},answer:{audioUrl:e.audioUrl,backgroundImageUrl:e.backgroundImageUrl,objectNodes:e.objectNodes,correctObjectId:e.correctObjectId,groupNumber:e.groupNumber},points:e?.points??t.state.points??1,level:t.state.level,difficulty:t.state.difficulty,skill:t.state.skill,explanation:e?.explanation||""}),wrapOnChange:(e,t)=>({type:t.questionType,content:{..."object"==typeof t.state.content&&null!==t.state.content?t.state.content:{},isBackup:e.isBackup||!1},answer:{audioUrl:e.audioUrl,backgroundImageUrl:e.backgroundImageUrl,objectNodes:e.objectNodes,correctObjectId:e.correctObjectId,groupNumber:e.groupNumber},points:e?.points??t.state.points??1,level:t.state.level,difficulty:t.state.difficulty,skill:t.state.skill,explanation:e?.explanation||""})};
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
export const transformListenAndChooseObjectsInScene = (
|
|
2
|
-
const answerData = question.answer;
|
|
3
|
-
const apiContent = {};
|
|
4
|
-
if (answerData?.audioUrl) {
|
|
5
|
-
apiContent.audioUrl = answerData.audioUrl;
|
|
6
|
-
}
|
|
7
|
-
if (answerData.isBackup !== undefined) {
|
|
8
|
-
apiContent.isBackup = answerData.isBackup;
|
|
9
|
-
}
|
|
10
|
-
const sceneData = {
|
|
11
|
-
backgroundImageUrl: answerData.backgroundImageUrl,
|
|
12
|
-
objectNodes: (answerData.objectNodes || []).map((node) => ({
|
|
13
|
-
id: node.id,
|
|
14
|
-
imageUrl: node.imageUrl,
|
|
15
|
-
label: node.label,
|
|
16
|
-
x: node.x,
|
|
17
|
-
y: node.y,
|
|
18
|
-
width: node.width,
|
|
19
|
-
height: node.height,
|
|
20
|
-
})),
|
|
21
|
-
};
|
|
22
|
-
const apiCorrectAnswer = {
|
|
23
|
-
objectId: answerData.correctObjectId || '',
|
|
24
|
-
};
|
|
25
|
-
// Get group number directly from the component payload
|
|
26
|
-
const groupNumber = answerData.groupNumber || 1;
|
|
27
|
-
return {
|
|
28
|
-
apiContent,
|
|
29
|
-
apiCorrectAnswer,
|
|
30
|
-
sceneData,
|
|
31
|
-
groupNumber,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
1
|
+
export const transformListenAndChooseObjectsInScene=e=>{const r=e.answer,o={};r?.audioUrl&&(o.audioUrl=r.audioUrl),void 0!==r.isBackup&&(o.isBackup=r.isBackup);const a={backgroundImageUrl:r.backgroundImageUrl,objectNodes:(r.objectNodes||[]).map(e=>({id:e.id,imageUrl:e.imageUrl,label:e.label,x:e.x,y:e.y,width:e.width,height:e.height}))};return{apiContent:o,apiCorrectAnswer:{objectId:r.correctObjectId||""},sceneData:a,groupNumber:r.groupNumber||1}};
|
|
@@ -1,106 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
|
-
import { Check, X, CircleHelp, Volume2, Target } from 'lucide-react';
|
|
5
|
-
import { usePresignedFileUrl } from '../../../../shared/lib/hooks';
|
|
6
|
-
import { cn } from '../../../../shared/lib/utils';
|
|
7
|
-
/**
|
|
8
|
-
* PresignedImage helper
|
|
9
|
-
*/
|
|
10
|
-
function PresignedImage({ url, alt }) {
|
|
11
|
-
const { previewUrl } = usePresignedFileUrl(url);
|
|
12
|
-
if (!previewUrl)
|
|
13
|
-
return _jsx("div", { className: "flex h-full w-full items-center justify-center text-xs text-gray-400", children: alt });
|
|
14
|
-
return (_jsx("img", { src: previewUrl, alt: alt, className: "h-full w-full object-contain pointer-events-none", draggable: false }));
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* ListenAndDragObjectsIntoSceneClient
|
|
18
|
-
*
|
|
19
|
-
* Student/preview view for the "Listen and Drag Objects into Scene" question type.
|
|
20
|
-
* Displays a background scene with drop zones overlay, and sidebar with draggable objects.
|
|
21
|
-
* Student listens to audio and drags the correct object to the correct drop zone.
|
|
22
|
-
*/
|
|
23
|
-
export function ListenAndDragObjectsIntoSceneClient({ questionData, onSubmit, isReviewMode = false, userAnswer, correctAnswer, explanation, }) {
|
|
24
|
-
// State
|
|
25
|
-
const [selectedObjectId, setSelectedObjectId] = useState(userAnswer?.objectId || '');
|
|
26
|
-
const [selectedDropZoneId, setSelectedDropZoneId] = useState(userAnswer?.dropZoneId || '');
|
|
27
|
-
const [draggedObjectId, setDraggedObjectId] = useState(null);
|
|
28
|
-
// Presigned URLs
|
|
29
|
-
const { previewUrl: backgroundUrl, isLoading: bgLoading } = usePresignedFileUrl(questionData.backgroundImageUrl || '');
|
|
30
|
-
const { previewUrl: audioUrl } = usePresignedFileUrl(questionData.audioUrl || '');
|
|
31
|
-
// Sync userAnswer
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (userAnswer?.objectId) {
|
|
34
|
-
setSelectedObjectId(userAnswer.objectId);
|
|
35
|
-
}
|
|
36
|
-
if (userAnswer?.dropZoneId) {
|
|
37
|
-
setSelectedDropZoneId(userAnswer.dropZoneId);
|
|
38
|
-
}
|
|
39
|
-
}, [userAnswer]);
|
|
40
|
-
// Drag handlers
|
|
41
|
-
const handleDragStart = (objectId) => {
|
|
42
|
-
if (isReviewMode)
|
|
43
|
-
return;
|
|
44
|
-
setDraggedObjectId(objectId);
|
|
45
|
-
};
|
|
46
|
-
const handleDragOver = (e) => {
|
|
47
|
-
e.preventDefault();
|
|
48
|
-
};
|
|
49
|
-
const handleDrop = (dropZoneId) => {
|
|
50
|
-
if (isReviewMode || !draggedObjectId)
|
|
51
|
-
return;
|
|
52
|
-
setSelectedObjectId(draggedObjectId);
|
|
53
|
-
setSelectedDropZoneId(dropZoneId);
|
|
54
|
-
onSubmit?.({ objectId: draggedObjectId, dropZoneId });
|
|
55
|
-
setDraggedObjectId(null);
|
|
56
|
-
};
|
|
57
|
-
const handleDragEnd = () => {
|
|
58
|
-
setDraggedObjectId(null);
|
|
59
|
-
};
|
|
60
|
-
// Click-based fallback for selecting
|
|
61
|
-
const handleObjectClick = (objectId) => {
|
|
62
|
-
if (isReviewMode)
|
|
63
|
-
return;
|
|
64
|
-
setSelectedObjectId(objectId);
|
|
65
|
-
};
|
|
66
|
-
const handleDropZoneClick = (dropZoneId) => {
|
|
67
|
-
if (isReviewMode || !selectedObjectId)
|
|
68
|
-
return;
|
|
69
|
-
setSelectedDropZoneId(dropZoneId);
|
|
70
|
-
onSubmit?.({ objectId: selectedObjectId, dropZoneId });
|
|
71
|
-
};
|
|
72
|
-
const hasAnswered = selectedObjectId !== '' && selectedDropZoneId !== '';
|
|
73
|
-
const isAnswerCorrect = isReviewMode &&
|
|
74
|
-
correctAnswer &&
|
|
75
|
-
selectedObjectId === correctAnswer.objectId &&
|
|
76
|
-
selectedDropZoneId === correctAnswer.dropZoneId;
|
|
77
|
-
const selectedObject = questionData.objectNodes.find((n) => n.id === selectedObjectId);
|
|
78
|
-
const selectedDropZone = questionData.dropZones.find((z) => z.id === selectedDropZoneId);
|
|
79
|
-
return (_jsxs("div", { className: "space-y-4", children: [questionData.isBackup && (_jsxs("div", { className: "inline-flex self-center items-center gap-1.5 px-3 py-1.5 rounded-md bg-amber-50 text-amber-700 border border-amber-200 text-xs font-bold shadow-sm", children: [_jsx("span", { children: "\uD83D\uDD04" }), " C\u00E2u h\u1ECFi d\u1EF1 ph\u00F2ng"] })), _jsxs("div", { className: "overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white px-5 py-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-lg bg-gradient-to-br from-orange-500 to-amber-600 text-white shadow-sm", children: _jsx(CircleHelp, { className: "h-4 w-4" }) }), _jsx("span", { className: "text-sm font-medium text-gray-700", children: "Nghe v\u00E0 k\u00E9o th\u1EA3 \u0111\u1ED1i t\u01B0\u1EE3ng v\u00E0o c\u1EA3nh" })] }), isReviewMode && hasAnswered && (_jsxs("div", { className: cn('flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-semibold', isAnswerCorrect
|
|
80
|
-
? 'bg-green-100 text-green-700'
|
|
81
|
-
: 'bg-red-100 text-red-700'), children: [isAnswerCorrect ? (_jsx(Check, { className: "h-3.5 w-3.5" })) : (_jsx(X, { className: "h-3.5 w-3.5" })), isAnswerCorrect ? 'Đúng' : 'Sai'] }))] }), _jsxs("div", { className: "space-y-5 p-5", children: [audioUrl && (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-orange-100 bg-gradient-to-r from-orange-50 to-amber-50 p-3", children: [_jsx("div", { className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-orange-500 text-white", children: _jsx(Volume2, { className: "h-4 w-4" }) }), _jsx("audio", { controls: true, className: "h-8 w-full", src: audioUrl, children: "Tr\u00ECnh duy\u1EC7t kh\u00F4ng h\u1ED7 tr\u1EE3 audio." })] })), _jsxs("div", { className: "flex gap-4", children: [_jsx("div", { className: "flex w-24 flex-shrink-0 flex-col gap-2", children: questionData.objectNodes.slice(0, Math.ceil(questionData.objectNodes.length / 2)).map((node) => {
|
|
82
|
-
const isSelected = selectedObjectId === node.id;
|
|
83
|
-
const isDragging = draggedObjectId === node.id;
|
|
84
|
-
const isCorrectObj = isReviewMode && correctAnswer?.objectId === node.id;
|
|
85
|
-
return (_jsx("div", { draggable: !isReviewMode, onDragStart: () => handleDragStart(node.id), onDragEnd: handleDragEnd, onClick: () => handleObjectClick(node.id), className: cn('flex h-20 w-full cursor-grab items-center justify-center rounded-lg border-2 bg-white p-1 transition-all', isDragging && 'opacity-50 scale-95', isSelected && !isReviewMode && 'border-orange-500 ring-2 ring-orange-200 shadow-md', isCorrectObj && 'border-green-500 ring-2 ring-green-200', !isSelected && !isCorrectObj && 'border-gray-200 hover:border-orange-300', isReviewMode && 'cursor-default'), title: node.label, children: _jsx(PresignedImage, { url: node.imageUrl, alt: node.label }) }, node.id));
|
|
86
|
-
}) }), _jsxs("div", { className: "flex-1 overflow-hidden rounded-lg border border-gray-200 bg-gradient-to-br from-slate-50 to-gray-100", children: [_jsx("div", { className: "border-b border-gray-100 px-3 py-1.5", children: _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("div", { className: "h-2 w-2 rounded-full bg-red-400" }), _jsx("div", { className: "h-2 w-2 rounded-full bg-yellow-400" }), _jsx("div", { className: "h-2 w-2 rounded-full bg-green-400" }), _jsx("span", { className: "ml-2 text-xs font-medium text-gray-500", children: "Scene" })] }) }), _jsx("div", { className: "relative p-2", children: bgLoading ? (_jsx("div", { className: "flex h-64 items-center justify-center", children: _jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-gray-200 border-t-orange-500" }) })) : backgroundUrl ? (_jsxs("div", { className: "relative w-full", children: [_jsx("img", { src: backgroundUrl, alt: "Scene background", className: "w-full rounded-md object-contain", draggable: false }), questionData.dropZones.map((zone) => {
|
|
87
|
-
const isDropTarget = selectedDropZoneId === zone.id;
|
|
88
|
-
const isCorrectZone = isReviewMode && correctAnswer?.dropZoneId === zone.id;
|
|
89
|
-
const isWrongZone = isReviewMode && isDropTarget && correctAnswer?.dropZoneId !== zone.id;
|
|
90
|
-
return (_jsxs("div", { onDragOver: handleDragOver, onDrop: () => handleDrop(zone.id), onClick: () => handleDropZoneClick(zone.id), className: cn('absolute rounded-lg border-2 border-dashed transition-all', !isReviewMode && !isDropTarget && 'border-blue-300/60 bg-blue-100/20 hover:border-blue-400 hover:bg-blue-200/30 cursor-pointer', !isReviewMode && isDropTarget && 'border-orange-500 bg-orange-100/40 ring-2 ring-orange-200', isCorrectZone && 'border-green-500 bg-green-100/40 ring-2 ring-green-200', isWrongZone && 'border-red-500 bg-red-100/40 ring-2 ring-red-200', isReviewMode && !isCorrectZone && !isWrongZone && 'border-blue-300/40 bg-blue-50/10'), style: {
|
|
91
|
-
left: `${zone.x}%`,
|
|
92
|
-
top: `${zone.y}%`,
|
|
93
|
-
width: `${zone.width}%`,
|
|
94
|
-
height: `${zone.height}%`,
|
|
95
|
-
}, title: zone.label, children: [_jsx("div", { className: "flex h-full w-full items-center justify-center", children: isDropTarget && selectedObject ? (_jsx("div", { className: "h-full w-full p-1", children: _jsx(PresignedImage, { url: selectedObject.imageUrl, alt: selectedObject.label }) })) : (_jsx(Target, { className: "h-4 w-4 text-blue-400/50" })) }), isReviewMode && (isCorrectZone || isWrongZone) && (_jsx("div", { className: cn('absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full shadow-md z-20', isCorrectZone ? 'bg-green-500' : 'bg-red-500'), children: isCorrectZone ? (_jsx(Check, { className: "h-3 w-3 text-white" })) : (_jsx(X, { className: "h-3 w-3 text-white" })) }))] }, zone.id));
|
|
96
|
-
})] })) : (_jsx("div", { className: "flex h-64 items-center justify-center text-sm text-gray-400", children: "Ch\u01B0a c\u00F3 \u1EA3nh n\u1EC1n" })) })] }), _jsx("div", { className: "flex w-24 flex-shrink-0 flex-col gap-2", children: questionData.objectNodes.slice(Math.ceil(questionData.objectNodes.length / 2)).map((node) => {
|
|
97
|
-
const isSelected = selectedObjectId === node.id;
|
|
98
|
-
const isDragging = draggedObjectId === node.id;
|
|
99
|
-
const isCorrectObj = isReviewMode && correctAnswer?.objectId === node.id;
|
|
100
|
-
return (_jsx("div", { draggable: !isReviewMode, onDragStart: () => handleDragStart(node.id), onDragEnd: handleDragEnd, onClick: () => handleObjectClick(node.id), className: cn('flex h-20 w-full cursor-grab items-center justify-center rounded-lg border-2 bg-white p-1 transition-all', isDragging && 'opacity-50 scale-95', isSelected && !isReviewMode && 'border-orange-500 ring-2 ring-orange-200 shadow-md', isCorrectObj && 'border-green-500 ring-2 ring-green-200', !isSelected && !isCorrectObj && 'border-gray-200 hover:border-orange-300', isReviewMode && 'cursor-default'), title: node.label, children: _jsx(PresignedImage, { url: node.imageUrl, alt: node.label }) }, node.id));
|
|
101
|
-
}) })] }), hasAnswered && selectedObject && selectedDropZone && (_jsxs("div", { className: cn('flex items-center gap-2 rounded-lg border p-3', isReviewMode
|
|
102
|
-
? isAnswerCorrect
|
|
103
|
-
? 'border-green-200 bg-green-50'
|
|
104
|
-
: 'border-red-200 bg-red-50'
|
|
105
|
-
: 'border-orange-200 bg-orange-50'), children: [_jsxs("span", { className: "text-sm font-medium text-gray-700", children: ["\u0110\u00E3 \u0111\u1EB7t: ", _jsx("strong", { children: selectedObject.label }), " \u2192 ", _jsx("strong", { children: selectedDropZone.label })] }), isReviewMode && (_jsx("span", { className: cn('text-xs font-semibold', isAnswerCorrect ? 'text-green-600' : 'text-red-600'), children: isAnswerCorrect ? '✓ Chính xác' : '✗ Không chính xác' }))] })), !isReviewMode && !hasAnswered && (_jsxs("div", { className: "flex items-center gap-2 rounded-lg border border-amber-200 bg-gradient-to-r from-amber-50 to-yellow-50 p-3", children: [_jsx("div", { className: "flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-amber-400 text-white", children: _jsx("span", { className: "text-xs font-bold", children: "!" }) }), _jsx("span", { className: "text-sm text-amber-800", children: "Nghe audio v\u00E0 k\u00E9o \u0111\u1ED1i t\u01B0\u1EE3ng ph\u00F9 h\u1EE3p v\u00E0o v\u00F9ng th\u1EA3 tr\u00EAn c\u1EA3nh" })] })), isReviewMode && explanation && (_jsxs("div", { className: "rounded-lg border border-indigo-200 bg-indigo-50 p-4", children: [_jsx("p", { className: "text-sm font-semibold text-indigo-800", children: "Gi\u1EA3i th\u00EDch:" }), _jsx("p", { className: "mt-1 text-sm text-indigo-700", children: explanation })] }))] })] })] }));
|
|
106
|
-
}
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useState as d,useEffect as l}from"react";import{Check as n,X as t,CircleHelp as a,Volume2 as i,Target as o}from"lucide-react";import{usePresignedFileUrl as s}from"../../../../shared/lib/hooks";import{cn as c}from"../../../../shared/lib/utils";function g({url:r,alt:d}){const{previewUrl:l}=s(r);return l?e("img",{src:l,alt:d,className:"h-full w-full object-contain pointer-events-none",draggable:!1}):e("div",{className:"flex h-full w-full items-center justify-center text-xs text-gray-400",children:d})}export function ListenAndDragObjectsIntoSceneClient({questionData:b,onSubmit:m,isReviewMode:h=!1,userAnswer:u,correctAnswer:f,explanation:x}){const[p,v]=d(u?.objectId||""),[N,w]=d(u?.dropZoneId||""),[y,j]=d(null),{previewUrl:I,isLoading:k}=s(b.backgroundImageUrl||""),{previewUrl:Z}=s(b.audioUrl||"");l(()=>{u?.objectId&&v(u.objectId),u?.dropZoneId&&w(u.dropZoneId)},[u]);const D=e=>{h||j(e)},U=e=>{e.preventDefault()},C=()=>{j(null)},S=e=>{h||v(e)},$=""!==p&&""!==N,A=h&&f&&p===f.objectId&&N===f.dropZoneId,M=b.objectNodes.find(e=>e.id===p),E=b.dropZones.find(e=>e.id===N);return r("div",{className:"space-y-4",children:[b.isBackup&&r("div",{className:"inline-flex self-center items-center gap-1.5 px-3 py-1.5 rounded-md bg-amber-50 text-amber-700 border border-amber-200 text-xs font-bold shadow-sm",children:[e("span",{children:"🔄"})," Câu hỏi dự phòng"]}),r("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",children:[r("div",{className:"flex items-center justify-between border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white px-5 py-3",children:[r("div",{className:"flex items-center gap-3",children:[e("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-gradient-to-br from-orange-500 to-amber-600 text-white shadow-sm",children:e(a,{className:"h-4 w-4"})}),e("span",{className:"text-sm font-medium text-gray-700",children:"Nghe và kéo thả đối tượng vào cảnh"})]}),h&&$&&r("div",{className:c("flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-semibold",A?"bg-green-100 text-green-700":"bg-red-100 text-red-700"),children:[e(A?n:t,{className:"h-3.5 w-3.5"}),A?"Đúng":"Sai"]})]}),r("div",{className:"space-y-5 p-5",children:[Z&&r("div",{className:"flex items-center gap-3 rounded-lg border border-orange-100 bg-gradient-to-r from-orange-50 to-amber-50 p-3",children:[e("div",{className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-orange-500 text-white",children:e(i,{className:"h-4 w-4"})}),e("audio",{controls:!0,className:"h-8 w-full",src:Z,children:"Trình duyệt không hỗ trợ audio."})]}),r("div",{className:"flex gap-4",children:[e("div",{className:"flex w-24 flex-shrink-0 flex-col gap-2",children:b.objectNodes.slice(0,Math.ceil(b.objectNodes.length/2)).map(r=>{const d=p===r.id,l=y===r.id,n=h&&f?.objectId===r.id;return e("div",{draggable:!h,onDragStart:()=>D(r.id),onDragEnd:C,onClick:()=>S(r.id),className:c("flex h-20 w-full cursor-grab items-center justify-center rounded-lg border-2 bg-white p-1 transition-all",l&&"opacity-50 scale-95",d&&!h&&"border-orange-500 ring-2 ring-orange-200 shadow-md",n&&"border-green-500 ring-2 ring-green-200",!d&&!n&&"border-gray-200 hover:border-orange-300",h&&"cursor-default"),title:r.label,children:e(g,{url:r.imageUrl,alt:r.label})},r.id)})}),r("div",{className:"flex-1 overflow-hidden rounded-lg border border-gray-200 bg-gradient-to-br from-slate-50 to-gray-100",children:[e("div",{className:"border-b border-gray-100 px-3 py-1.5",children:r("div",{className:"flex items-center gap-1.5",children:[e("div",{className:"h-2 w-2 rounded-full bg-red-400"}),e("div",{className:"h-2 w-2 rounded-full bg-yellow-400"}),e("div",{className:"h-2 w-2 rounded-full bg-green-400"}),e("span",{className:"ml-2 text-xs font-medium text-gray-500",children:"Scene"})]})}),e("div",{className:"relative p-2",children:k?e("div",{className:"flex h-64 items-center justify-center",children:e("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-gray-200 border-t-orange-500"})}):I?r("div",{className:"relative w-full",children:[e("img",{src:I,alt:"Scene background",className:"w-full rounded-md object-contain",draggable:!1}),b.dropZones.map(d=>{const l=N===d.id,a=h&&f?.dropZoneId===d.id,i=h&&l&&f?.dropZoneId!==d.id;return r("div",{onDragOver:U,onDrop:()=>{return e=d.id,void(!h&&y&&(v(y),w(e),m?.({objectId:y,dropZoneId:e}),j(null)));var e},onClick:()=>{return e=d.id,void(!h&&p&&(w(e),m?.({objectId:p,dropZoneId:e})));var e},className:c("absolute rounded-lg border-2 border-dashed transition-all",!h&&!l&&"border-blue-300/60 bg-blue-100/20 hover:border-blue-400 hover:bg-blue-200/30 cursor-pointer",!h&&l&&"border-orange-500 bg-orange-100/40 ring-2 ring-orange-200",a&&"border-green-500 bg-green-100/40 ring-2 ring-green-200",i&&"border-red-500 bg-red-100/40 ring-2 ring-red-200",h&&!a&&!i&&"border-blue-300/40 bg-blue-50/10"),style:{left:`${d.x}%`,top:`${d.y}%`,width:`${d.width}%`,height:`${d.height}%`},title:d.label,children:[e("div",{className:"flex h-full w-full items-center justify-center",children:l&&M?e("div",{className:"h-full w-full p-1",children:e(g,{url:M.imageUrl,alt:M.label})}):e(o,{className:"h-4 w-4 text-blue-400/50"})}),h&&(a||i)&&e("div",{className:c("absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full shadow-md z-20",a?"bg-green-500":"bg-red-500"),children:e(a?n:t,{className:"h-3 w-3 text-white"})})]},d.id)})]}):e("div",{className:"flex h-64 items-center justify-center text-sm text-gray-400",children:"Chưa có ảnh nền"})})]}),e("div",{className:"flex w-24 flex-shrink-0 flex-col gap-2",children:b.objectNodes.slice(Math.ceil(b.objectNodes.length/2)).map(r=>{const d=p===r.id,l=y===r.id,n=h&&f?.objectId===r.id;return e("div",{draggable:!h,onDragStart:()=>D(r.id),onDragEnd:C,onClick:()=>S(r.id),className:c("flex h-20 w-full cursor-grab items-center justify-center rounded-lg border-2 bg-white p-1 transition-all",l&&"opacity-50 scale-95",d&&!h&&"border-orange-500 ring-2 ring-orange-200 shadow-md",n&&"border-green-500 ring-2 ring-green-200",!d&&!n&&"border-gray-200 hover:border-orange-300",h&&"cursor-default"),title:r.label,children:e(g,{url:r.imageUrl,alt:r.label})},r.id)})})]}),$&&M&&E&&r("div",{className:c("flex items-center gap-2 rounded-lg border p-3",h?A?"border-green-200 bg-green-50":"border-red-200 bg-red-50":"border-orange-200 bg-orange-50"),children:[r("span",{className:"text-sm font-medium text-gray-700",children:["Đã đặt: ",e("strong",{children:M.label})," → ",e("strong",{children:E.label})]}),h&&e("span",{className:c("text-xs font-semibold",A?"text-green-600":"text-red-600"),children:A?"✓ Chính xác":"✗ Không chính xác"})]}),!h&&!$&&r("div",{className:"flex items-center gap-2 rounded-lg border border-amber-200 bg-gradient-to-r from-amber-50 to-yellow-50 p-3",children:[e("div",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-amber-400 text-white",children:e("span",{className:"text-xs font-bold",children:"!"})}),e("span",{className:"text-sm text-amber-800",children:"Nghe audio và kéo đối tượng phù hợp vào vùng thả trên cảnh"})]}),h&&x&&r("div",{className:"rounded-lg border border-indigo-200 bg-indigo-50 p-4",children:[e("p",{className:"text-sm font-semibold text-indigo-800",children:"Giải thích:"}),e("p",{className:"mt-1 text-sm text-indigo-700",children:x})]})]})]})]})}
|