@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,218 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Pure helpers for the English Certification grouped-question renderer.
|
|
3
|
-
*
|
|
4
|
-
* Extracted from EnglishCertificationGroupedQuestion.tsx to keep the component
|
|
5
|
-
* file under the 500-line limit. These functions strip the shared part
|
|
6
|
-
* instruction that the API prepends to every document's passage so it renders
|
|
7
|
-
* only once at the top of the part.
|
|
8
|
-
*/
|
|
9
|
-
/** Detects whether passage content carries HTML markup (Part 6) vs plain text (Part 7). */
|
|
10
|
-
export function isHtmlContent(value) {
|
|
11
|
-
return /<[a-z][\s\S]*>/i.test(value);
|
|
12
|
-
}
|
|
13
|
-
/** Collapses whitespace and strips tags so two instruction strings can be compared. */
|
|
14
|
-
export function normalizeText(value) {
|
|
15
|
-
return value
|
|
16
|
-
.replace(/<[^>]*>/g, ' ')
|
|
17
|
-
.replace(/ /g, ' ')
|
|
18
|
-
.replace(/\s+/g, ' ')
|
|
19
|
-
.trim()
|
|
20
|
-
.toLowerCase();
|
|
21
|
-
}
|
|
22
|
-
/** Matches a single leading top-level block element of HTML passage content. */
|
|
23
|
-
const LEADING_BLOCK_REGEX = /^\s*<(p|div|h[1-6]|span|section|header)\b[^>]*>[\s\S]*?<\/\1>\s*/i;
|
|
24
|
-
/**
|
|
25
|
-
* Removes the shared part instruction that the API prepends to every document's
|
|
26
|
-
* passage so it is only rendered once at the top of the part.
|
|
27
|
-
*
|
|
28
|
-
* Strategy:
|
|
29
|
-
* - HTML passages: first tries the block-peeling approach (fast), then falls
|
|
30
|
-
* back to a character-walk HTML parser (handles any HTML structure).
|
|
31
|
-
* - Plain text passages: drops leading lines covered by the instruction.
|
|
32
|
-
* Returns the original passage when nothing matches so genuine content is safe.
|
|
33
|
-
*/
|
|
34
|
-
export function stripInstruction(passage, instruction) {
|
|
35
|
-
if (!passage || !instruction) {
|
|
36
|
-
return passage;
|
|
37
|
-
}
|
|
38
|
-
const normalizedInstruction = normalizeText(instruction);
|
|
39
|
-
if (!normalizedInstruction) {
|
|
40
|
-
return passage;
|
|
41
|
-
}
|
|
42
|
-
if (isHtmlContent(passage)) {
|
|
43
|
-
let rest = passage;
|
|
44
|
-
let removedAny = false;
|
|
45
|
-
let consumed = '';
|
|
46
|
-
// Peel leading blocks while they remain covered by the instruction.
|
|
47
|
-
while (true) {
|
|
48
|
-
const match = LEADING_BLOCK_REGEX.exec(rest);
|
|
49
|
-
if (!match) {
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
const block = match[0];
|
|
53
|
-
const blockText = normalizeText(block);
|
|
54
|
-
if (!blockText) {
|
|
55
|
-
// Empty/whitespace-only leading block — drop and keep scanning.
|
|
56
|
-
rest = rest.slice(block.length);
|
|
57
|
-
removedAny = true;
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
const candidate = normalizeText(consumed + ' ' + block).trim();
|
|
61
|
-
const isCovered = normalizedInstruction === candidate ||
|
|
62
|
-
normalizedInstruction.startsWith(candidate) ||
|
|
63
|
-
candidate.startsWith(normalizedInstruction) ||
|
|
64
|
-
normalizedInstruction.startsWith(blockText) ||
|
|
65
|
-
blockText.startsWith(normalizedInstruction);
|
|
66
|
-
if (!isCovered) {
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
consumed = candidate;
|
|
70
|
-
rest = rest.slice(block.length);
|
|
71
|
-
removedAny = true;
|
|
72
|
-
// Once we have matched the whole instruction, stop peeling.
|
|
73
|
-
if (consumed === normalizedInstruction || consumed.startsWith(normalizedInstruction)) {
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (removedAny)
|
|
78
|
-
return rest.trimStart();
|
|
79
|
-
// ── Fallback: character-walk HTML parser ──────────────────────────────
|
|
80
|
-
// The block-regex above only handles top-level block elements. If the
|
|
81
|
-
// instruction is wrapped in inline elements (<strong>, <b>), a <table>,
|
|
82
|
-
// or any other structure, we fall back to walking the HTML char by char:
|
|
83
|
-
// skip tags, decode entities, accumulate visible text, and cut the HTML
|
|
84
|
-
// exactly where the instruction text ends.
|
|
85
|
-
return stripInstructionByTextWalk(passage, normalizedInstruction);
|
|
86
|
-
}
|
|
87
|
-
// Plain text (Part 7): drop leading lines covered by the instruction.
|
|
88
|
-
const lines = passage.split('\n');
|
|
89
|
-
let removed = 0;
|
|
90
|
-
let consumed = '';
|
|
91
|
-
for (const line of lines) {
|
|
92
|
-
const lineText = normalizeText(line);
|
|
93
|
-
if (!lineText) {
|
|
94
|
-
removed += 1;
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
const candidate = normalizeText(consumed + ' ' + line).trim();
|
|
98
|
-
const isCovered = normalizedInstruction === candidate ||
|
|
99
|
-
normalizedInstruction.startsWith(candidate) ||
|
|
100
|
-
normalizedInstruction.startsWith(lineText) ||
|
|
101
|
-
lineText.startsWith(normalizedInstruction);
|
|
102
|
-
if (!isCovered) {
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
consumed = candidate;
|
|
106
|
-
removed += 1;
|
|
107
|
-
if (consumed === normalizedInstruction || consumed.startsWith(normalizedInstruction)) {
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return removed > 0 ? lines.slice(removed).join('\n').trimStart() : passage;
|
|
112
|
-
}
|
|
113
|
-
/** Decode a common HTML entity to its plain-text equivalent. */
|
|
114
|
-
function decodeHtmlEntity(entity) {
|
|
115
|
-
const map = new Map([
|
|
116
|
-
['nbsp', ' '],
|
|
117
|
-
['amp', '\u0026'],
|
|
118
|
-
['lt', '\u003c'],
|
|
119
|
-
['gt', '\u003e'],
|
|
120
|
-
['quot', '\u0022'],
|
|
121
|
-
['#39', '\u0027'],
|
|
122
|
-
['apos', '\u0027'],
|
|
123
|
-
['ldquo', '\u201c'],
|
|
124
|
-
['rdquo', '\u201d'],
|
|
125
|
-
['lsquo', '\u2018'],
|
|
126
|
-
['rsquo', '\u2019'],
|
|
127
|
-
['hellip', '\u2026'],
|
|
128
|
-
['mdash', '\u2014'],
|
|
129
|
-
['ndash', '\u2013'],
|
|
130
|
-
['copy', '\u00a9'],
|
|
131
|
-
['reg', '\u00ae'],
|
|
132
|
-
['trade', '\u2122'],
|
|
133
|
-
]);
|
|
134
|
-
// Strip the leading & and trailing ; then look up the bare entity name.
|
|
135
|
-
const name = entity.replace(/^&/, '').replace(/;$/, '').toLowerCase();
|
|
136
|
-
return map.get(name) ?? ' ';
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Robust HTML-aware instruction stripper.
|
|
140
|
-
*
|
|
141
|
-
* Walks the HTML one token at a time:
|
|
142
|
-
* - Opening/closing/self-closing tags → skipped (not added to text)
|
|
143
|
-
* - Named/numeric HTML entities → decoded to plain-text equivalent
|
|
144
|
-
* - Literal characters → appended to running text buffer
|
|
145
|
-
*
|
|
146
|
-
* As soon as the accumulated (normalized) text covers the instruction, the
|
|
147
|
-
* function records the current HTML position as the cut point. It then skips
|
|
148
|
-
* any orphaned closing tags (`</p>`, `</strong>`, …) before returning the
|
|
149
|
-
* remainder of the HTML — avoiding dangling close-tags in the rendered output.
|
|
150
|
-
*
|
|
151
|
-
* Returns the original passage unchanged when the instruction is not found at
|
|
152
|
-
* the start, so genuine content is never accidentally removed.
|
|
153
|
-
*/
|
|
154
|
-
function stripInstructionByTextWalk(html, normalizedInstruction) {
|
|
155
|
-
let i = 0;
|
|
156
|
-
let textAccum = '';
|
|
157
|
-
let cutHtmlIdx = -1; // HTML position right after the instruction text ends
|
|
158
|
-
while (i < html.length) {
|
|
159
|
-
// ── Evaluate after adding each token ──────────────────────────────────
|
|
160
|
-
const norm = textAccum.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
161
|
-
if (cutHtmlIdx === -1) {
|
|
162
|
-
// Success: we have consumed at least the instruction.
|
|
163
|
-
if (norm.length >= normalizedInstruction.length && norm.startsWith(normalizedInstruction)) {
|
|
164
|
-
cutHtmlIdx = i;
|
|
165
|
-
// Don't break yet — skip orphaned closing tags below.
|
|
166
|
-
}
|
|
167
|
-
// Early bail: text has diverged from the instruction prefix.
|
|
168
|
-
if (norm.length > 0 &&
|
|
169
|
-
!normalizedInstruction.startsWith(norm) &&
|
|
170
|
-
!norm.startsWith(normalizedInstruction)) {
|
|
171
|
-
return html; // Not a match — return original unchanged.
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
// ── Process the next HTML token ───────────────────────────────────────
|
|
175
|
-
if (html[i] === '<') {
|
|
176
|
-
const end = html.indexOf('>', i);
|
|
177
|
-
if (end === -1)
|
|
178
|
-
return cutHtmlIdx >= 0 ? html.slice(cutHtmlIdx).trimStart() : html;
|
|
179
|
-
const tag = html.slice(i, end + 1);
|
|
180
|
-
i = end + 1;
|
|
181
|
-
if (cutHtmlIdx >= 0) {
|
|
182
|
-
// We are past the instruction. If the next token is a closing tag,
|
|
183
|
-
// skip it (it belongs to the block that contained the instruction).
|
|
184
|
-
// Otherwise we've reached real content — return from here.
|
|
185
|
-
if (!tag.startsWith('</')) {
|
|
186
|
-
// Opening or self-closing tag → real content starts here.
|
|
187
|
-
return html.slice(i - tag.length).trimStart();
|
|
188
|
-
}
|
|
189
|
-
// Closing tag → skip and keep scanning for the next real token.
|
|
190
|
-
}
|
|
191
|
-
// While building up text: tags are invisible — just advance i.
|
|
192
|
-
}
|
|
193
|
-
else if (html[i] === '&') {
|
|
194
|
-
if (cutHtmlIdx >= 0) {
|
|
195
|
-
// Hit real content (entity) after the instruction → return here.
|
|
196
|
-
return html.slice(i).trimStart();
|
|
197
|
-
}
|
|
198
|
-
// Decode entity and add to text buffer.
|
|
199
|
-
const sc = html.indexOf(';', i);
|
|
200
|
-
if (sc !== -1 && sc - i <= 10) {
|
|
201
|
-
textAccum += decodeHtmlEntity(html.slice(i, sc + 1));
|
|
202
|
-
i = sc + 1;
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
textAccum += html[i++];
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
if (cutHtmlIdx >= 0) {
|
|
210
|
-
// Hit real text content after the instruction → return here.
|
|
211
|
-
return html.slice(i).trimStart();
|
|
212
|
-
}
|
|
213
|
-
textAccum += html[i++];
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
// Exhausted the HTML — return whatever is left after the cut point (or original).
|
|
217
|
-
return cutHtmlIdx >= 0 ? html.slice(cutHtmlIdx).trimStart() : html;
|
|
218
|
-
}
|
|
1
|
+
export function isHtmlContent(t){return/<[a-z][\s\S]*>/i.test(t)}export function normalizeText(t){return t.replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/\s+/g," ").trim().toLowerCase()}const t=/^\s*<(p|div|h[1-6]|span|section|header)\b[^>]*>[\s\S]*?<\/\1>\s*/i;export function stripInstruction(r,i){if(!r||!i)return r;const s=normalizeText(i);if(!s)return r;if(isHtmlContent(r)){let i=r,n=!1,o="";for(;;){const e=t.exec(i);if(!e)break;const r=e[0],a=normalizeText(r);if(!a){i=i.slice(r.length),n=!0;continue}const l=normalizeText(o+" "+r).trim();if(!(s===l||s.startsWith(l)||l.startsWith(s)||s.startsWith(a)||a.startsWith(s)))break;if(o=l,i=i.slice(r.length),n=!0,o===s||o.startsWith(s))break}return n?i.trimStart():function(t,r){let i=0,s="",n=-1;for(;i<t.length;){const o=s.replace(/\s+/g," ").trim().toLowerCase();if(-1===n&&(o.length>=r.length&&o.startsWith(r)&&(n=i),o.length>0&&!r.startsWith(o)&&!o.startsWith(r)))return t;if("<"===t[i]){const e=t.indexOf(">",i);if(-1===e)return n>=0?t.slice(n).trimStart():t;const r=t.slice(i,e+1);if(i=e+1,n>=0&&!r.startsWith("</"))return t.slice(i-r.length).trimStart()}else if("&"===t[i]){if(n>=0)return t.slice(i).trimStart();const r=t.indexOf(";",i);-1!==r&&r-i<=10?(s+=e(t.slice(i,r+1)),i=r+1):s+=t[i++]}else{if(n>=0)return t.slice(i).trimStart();s+=t[i++]}}return n>=0?t.slice(n).trimStart():t}(r,s)}const n=r.split("\n");let o=0,a="";for(const t of n){const e=normalizeText(t);if(!e){o+=1;continue}const r=normalizeText(a+" "+t).trim();if(!(s===r||s.startsWith(r)||s.startsWith(e)||e.startsWith(s)))break;if(a=r,o+=1,a===s||a.startsWith(s))break}return o>0?n.slice(o).join("\n").trimStart():r}function e(t){const e=new Map([["nbsp"," "],["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["#39","'"],["apos","'"],["ldquo","“"],["rdquo","”"],["lsquo","‘"],["rsquo","’"],["hellip","…"],["mdash","—"],["ndash","–"],["copy","©"],["reg","®"],["trade","™"]]),r=t.replace(/^&/,"").replace(/;$/,"").toLowerCase();return e.get(r)??" "}
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// standardized English exams (TOEIC, IELTS, …).
|
|
3
|
-
export { EnglishCertificationExamLayout } from './EnglishCertificationExamLayout';
|
|
4
|
-
export { EnglishCertificationQuestionRenderer } from './EnglishCertificationQuestionRenderer';
|
|
5
|
-
export { EnglishCertificationHeader } from './EnglishCertificationHeader';
|
|
6
|
-
export { EnglishCertificationNavigationPanel } from './EnglishCertificationNavigationPanel';
|
|
7
|
-
export { EnglishCertificationFooterBar } from './EnglishCertificationFooterBar';
|
|
8
|
-
export { EnglishCertificationOptionSelector } from './EnglishCertificationOptionSelector';
|
|
9
|
-
export { EnglishCertificationAudioPlayer } from './EnglishCertificationAudioPlayer';
|
|
10
|
-
export { EnglishCertificationSingleQuestion } from './EnglishCertificationSingleQuestion';
|
|
11
|
-
export { EnglishCertificationSingleQuestionList, englishCertQuestionDomId, } from './EnglishCertificationSingleQuestionList';
|
|
12
|
-
export { EnglishCertificationGroupedQuestion } from './EnglishCertificationGroupedQuestion';
|
|
13
|
-
export { EnglishCertificationReadingSection } from './EnglishCertificationReadingSection';
|
|
14
|
-
export { EnglishCertificationFlagButton } from './EnglishCertificationFlagButton';
|
|
15
|
-
export { EnglishCertificationBrand } from './EnglishCertificationBrand';
|
|
16
|
-
// Dedicated branded IELTS question renderers.
|
|
17
|
-
export { EcWordFillStructuredForm } from './EcWordFillStructuredForm';
|
|
18
|
-
export { EcMatchByWritingAnswer } from './EcMatchByWritingAnswer';
|
|
19
|
-
export { EcAnswerTheQuestion } from './EcAnswerTheQuestion';
|
|
20
|
-
export { EcWordFillParagraph } from './EcWordFillParagraph';
|
|
21
|
-
export { EcWritingTask } from './EcWritingTask';
|
|
1
|
+
export{EnglishCertificationExamLayout}from"./EnglishCertificationExamLayout";export{EnglishCertificationQuestionRenderer}from"./EnglishCertificationQuestionRenderer";export{EnglishCertificationHeader}from"./EnglishCertificationHeader";export{EnglishCertificationNavigationPanel}from"./EnglishCertificationNavigationPanel";export{EnglishCertificationFooterBar}from"./EnglishCertificationFooterBar";export{EnglishCertificationOptionSelector}from"./EnglishCertificationOptionSelector";export{EnglishCertificationAudioPlayer}from"./EnglishCertificationAudioPlayer";export{EnglishCertificationSingleQuestion}from"./EnglishCertificationSingleQuestion";export{EnglishCertificationSingleQuestionList,englishCertQuestionDomId}from"./EnglishCertificationSingleQuestionList";export{EnglishCertificationGroupedQuestion}from"./EnglishCertificationGroupedQuestion";export{EnglishCertificationReadingSection}from"./EnglishCertificationReadingSection";export{EnglishCertificationFlagButton}from"./EnglishCertificationFlagButton";export{EnglishCertificationBrand}from"./EnglishCertificationBrand";export{EcWordFillStructuredForm}from"./EcWordFillStructuredForm";export{EcMatchByWritingAnswer}from"./EcMatchByWritingAnswer";export{EcAnswerTheQuestion}from"./EcAnswerTheQuestion";export{EcWordFillParagraph}from"./EcWordFillParagraph";export{EcWritingTask}from"./EcWritingTask";
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './english-certification';
|
|
3
|
-
export * from './summer-sky/SummerSkyAudioPlayer';
|
|
4
|
-
export * from './summer-sky/SummerSkyLayout';
|
|
5
|
-
export * from './summer-sky/SummerSkySubmitModal';
|
|
6
|
-
export * from './summer-sky/SummerSkyWaitingRoom';
|
|
1
|
+
export*from"./cambridge-yle";export*from"./english-certification";export*from"./summer-sky/SummerSkyAudioPlayer";export*from"./summer-sky/SummerSkyLayout";export*from"./summer-sky/SummerSkySubmitModal";export*from"./summer-sky/SummerSkyWaitingRoom";
|
|
@@ -1,170 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useRef, useEffect, useState, useCallback } from 'react';
|
|
4
|
-
import { usePresignedFileUrl } from '../../../shared/lib/hooks/usePresignedFileUrl';
|
|
5
|
-
import { useDelayedAutoPlay } from '../../../shared/lib/hooks/useDelayedAutoPlay';
|
|
6
|
-
import layoutStyles from './assets/styles/SummerSkyLayout.module.css';
|
|
7
|
-
import Image from 'next/image';
|
|
8
|
-
import backgroundTitleImg from './assets/images/background_title.png';
|
|
9
|
-
import titleTableImg from './assets/images/title_table.png';
|
|
10
|
-
import { Play, Pause } from 'lucide-react';
|
|
11
|
-
export function SummerSkyAudioPlayer({ audioUrl, partName = 'PART 1', onEnded, hideAudio, onPlayingChange }) {
|
|
12
|
-
const audioRef = useRef(null);
|
|
13
|
-
const { previewUrl: resolvedAudioUrl } = usePresignedFileUrl(audioUrl || undefined);
|
|
14
|
-
const [isPlaying, setIsPlaying] = useState(false);
|
|
15
|
-
const [currentTime, setCurrentTime] = useState(0);
|
|
16
|
-
const [duration, setDuration] = useState(0);
|
|
17
|
-
const formatTime = useCallback((sec) => {
|
|
18
|
-
if (!isFinite(sec) || isNaN(sec))
|
|
19
|
-
return '00:00';
|
|
20
|
-
const m = Math.floor(sec / 60);
|
|
21
|
-
const s = Math.floor(sec % 60);
|
|
22
|
-
return `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;
|
|
23
|
-
}, []);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const audio = audioRef.current;
|
|
26
|
-
if (!audio)
|
|
27
|
-
return;
|
|
28
|
-
const handleEnded = () => {
|
|
29
|
-
setIsPlaying(false);
|
|
30
|
-
onPlayingChange?.(false);
|
|
31
|
-
onEnded?.();
|
|
32
|
-
};
|
|
33
|
-
const handlePlay = () => { setIsPlaying(true); onPlayingChange?.(true); };
|
|
34
|
-
const handlePause = () => { setIsPlaying(false); onPlayingChange?.(false); };
|
|
35
|
-
const handleTimeUpdate = () => {
|
|
36
|
-
setCurrentTime(audio.currentTime);
|
|
37
|
-
if (audio.duration && isFinite(audio.duration)) {
|
|
38
|
-
setDuration(audio.duration);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const handleLoaded = () => {
|
|
42
|
-
if (audio.duration && isFinite(audio.duration)) {
|
|
43
|
-
setDuration(audio.duration);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
audio.addEventListener('ended', handleEnded);
|
|
47
|
-
audio.addEventListener('play', handlePlay);
|
|
48
|
-
audio.addEventListener('pause', handlePause);
|
|
49
|
-
audio.addEventListener('timeupdate', handleTimeUpdate);
|
|
50
|
-
audio.addEventListener('loadedmetadata', handleLoaded);
|
|
51
|
-
audio.addEventListener('durationchange', handleLoaded);
|
|
52
|
-
return () => {
|
|
53
|
-
audio.removeEventListener('ended', handleEnded);
|
|
54
|
-
audio.removeEventListener('play', handlePlay);
|
|
55
|
-
audio.removeEventListener('pause', handlePause);
|
|
56
|
-
audio.removeEventListener('timeupdate', handleTimeUpdate);
|
|
57
|
-
audio.removeEventListener('loadedmetadata', handleLoaded);
|
|
58
|
-
audio.removeEventListener('durationchange', handleLoaded);
|
|
59
|
-
};
|
|
60
|
-
}, [resolvedAudioUrl, onEnded]);
|
|
61
|
-
// Auto-play with a brief prep delay when a new question audio URL is loaded.
|
|
62
|
-
// Delay duration and retry-on-interaction behavior live in the shared hook.
|
|
63
|
-
useDelayedAutoPlay({ audioRef, audioUrl: resolvedAudioUrl });
|
|
64
|
-
const handlePlayPause = () => {
|
|
65
|
-
const audio = audioRef.current;
|
|
66
|
-
if (!audio)
|
|
67
|
-
return;
|
|
68
|
-
if (isPlaying) {
|
|
69
|
-
audio.pause();
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
audio.play().catch(() => { });
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const handleSeek = (e) => {
|
|
76
|
-
const audio = audioRef.current;
|
|
77
|
-
if (!audio)
|
|
78
|
-
return;
|
|
79
|
-
const val = parseFloat(e.target.value);
|
|
80
|
-
audio.currentTime = val;
|
|
81
|
-
setCurrentTime(val);
|
|
82
|
-
};
|
|
83
|
-
const progressPercent = duration > 0 ? (currentTime / duration) * 100 : 0;
|
|
84
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: layoutStyles.examAudioContainer, children: [!hideAudio && (_jsx("audio", { ref: audioRef, ...(resolvedAudioUrl ? { src: resolvedAudioUrl } : {}), preload: "metadata" })), _jsxs("div", { style: {
|
|
85
|
-
position: 'relative',
|
|
86
|
-
display: 'inline-block',
|
|
87
|
-
transform: 'translateY(15px)',
|
|
88
|
-
}, children: [_jsx(Image, { src: titleTableImg, alt: "title decoration", style: { width: '550px', height: 'auto', display: 'block', transform: 'translateY(-45px)' }, priority: true }), _jsx("div", { style: {
|
|
89
|
-
position: 'absolute',
|
|
90
|
-
top: '50%',
|
|
91
|
-
left: '50%',
|
|
92
|
-
transform: 'translate(-50%, -55%)',
|
|
93
|
-
zIndex: 1,
|
|
94
|
-
display: 'inline-block',
|
|
95
|
-
color: '#FFE341',
|
|
96
|
-
fontSize: '32px',
|
|
97
|
-
fontWeight: 900,
|
|
98
|
-
fontFamily: '"Nunito", "Open Sans", system-ui, sans-serif',
|
|
99
|
-
textShadow: '2px 4px 0px rgba(11, 76, 142, 0.8)',
|
|
100
|
-
textTransform: 'uppercase',
|
|
101
|
-
letterSpacing: '1.5px',
|
|
102
|
-
padding: '15px 80px 30px',
|
|
103
|
-
whiteSpace: 'nowrap',
|
|
104
|
-
lineHeight: 1.25,
|
|
105
|
-
backgroundImage: `url(${backgroundTitleImg.src})`,
|
|
106
|
-
backgroundSize: '100% 100%',
|
|
107
|
-
backgroundRepeat: 'no-repeat',
|
|
108
|
-
backgroundPosition: 'center center',
|
|
109
|
-
}, children: partName })] })] }), !hideAudio && resolvedAudioUrl && (_jsxs("div", { style: {
|
|
110
|
-
position: 'absolute',
|
|
111
|
-
top: '50px',
|
|
112
|
-
left: '50%',
|
|
113
|
-
transform: 'translateX(-50%)',
|
|
114
|
-
display: 'flex',
|
|
115
|
-
alignItems: 'center',
|
|
116
|
-
gap: '10px',
|
|
117
|
-
padding: '8px 24px',
|
|
118
|
-
background: 'rgba(255, 255, 255, 0.95)',
|
|
119
|
-
backdropFilter: 'blur(6px)',
|
|
120
|
-
borderRadius: '40px',
|
|
121
|
-
zIndex: 50,
|
|
122
|
-
minWidth: '450px',
|
|
123
|
-
border: '2px solid #E2E8F0',
|
|
124
|
-
}, children: [_jsx("button", { type: "button", onClick: handlePlayPause, style: {
|
|
125
|
-
width: '32px',
|
|
126
|
-
height: '32px',
|
|
127
|
-
border: 'none',
|
|
128
|
-
background: 'transparent',
|
|
129
|
-
display: 'flex',
|
|
130
|
-
alignItems: 'center',
|
|
131
|
-
justifyContent: 'center',
|
|
132
|
-
cursor: 'pointer',
|
|
133
|
-
flexShrink: 0,
|
|
134
|
-
padding: 0,
|
|
135
|
-
transition: 'transform 0.15s ease',
|
|
136
|
-
}, className: "hover:scale-110 active:scale-95", children: isPlaying ? (_jsx(Pause, { fill: "#FF6B6B", stroke: "#FF6B6B", size: 26, style: { transform: 'translateX(0px)' } })) : (_jsx(Play, { fill: "#4A90D9", stroke: "#4A90D9", size: 26, style: { transform: 'translateX(2px)' } })) }), _jsxs("div", { style: { flex: 1, position: 'relative', height: '8px' }, children: [_jsx("div", { style: {
|
|
137
|
-
position: 'absolute',
|
|
138
|
-
top: 0,
|
|
139
|
-
left: 0,
|
|
140
|
-
right: 0,
|
|
141
|
-
height: '8px',
|
|
142
|
-
borderRadius: '0px',
|
|
143
|
-
background: '#E0E6ED',
|
|
144
|
-
} }), _jsx("div", { style: {
|
|
145
|
-
position: 'absolute',
|
|
146
|
-
top: 0,
|
|
147
|
-
left: 0,
|
|
148
|
-
height: '8px',
|
|
149
|
-
borderRadius: '0px',
|
|
150
|
-
width: `${progressPercent}%`,
|
|
151
|
-
background: 'linear-gradient(90deg, #4A90D9, #357ABD)',
|
|
152
|
-
transition: 'width 0.1s linear',
|
|
153
|
-
} }), _jsx("input", { type: "range", min: 0, max: duration || 0, step: 0.1, value: currentTime, onChange: handleSeek, style: {
|
|
154
|
-
position: 'absolute',
|
|
155
|
-
top: '-6px',
|
|
156
|
-
left: 0,
|
|
157
|
-
width: '100%',
|
|
158
|
-
height: '20px',
|
|
159
|
-
opacity: 0,
|
|
160
|
-
cursor: 'pointer',
|
|
161
|
-
margin: 0,
|
|
162
|
-
} })] }), _jsxs("span", { style: {
|
|
163
|
-
fontSize: '14px',
|
|
164
|
-
fontWeight: 700,
|
|
165
|
-
fontFamily: '"Quicksand", sans-serif',
|
|
166
|
-
color: '#8B95A5',
|
|
167
|
-
minWidth: '85px',
|
|
168
|
-
textAlign: 'right',
|
|
169
|
-
}, children: [_jsx("span", { style: { color: '#343C55' }, children: formatTime(currentTime) }), ' / ', formatTime(duration)] })] }))] }));
|
|
170
|
-
}
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useRef as i,useEffect as n,useState as a,useCallback as o}from"react";import{usePresignedFileUrl as s}from"../../../shared/lib/hooks/usePresignedFileUrl";import{useDelayedAutoPlay as d}from"../../../shared/lib/hooks/useDelayedAutoPlay";import l from"./assets/styles/SummerSkyLayout.module.css";import p from"next/image";import u from"./assets/images/background_title.png";import c from"./assets/images/title_table.png";import{Play as m,Pause as g}from"lucide-react";export function SummerSkyAudioPlayer({audioUrl:h,partName:x="PART 1",onEnded:f,hideAudio:y,onPlayingChange:v}){const b=i(null),{previewUrl:k}=s(h||void 0),[E,F]=a(!1),[S,L]=a(0),[A,w]=a(0),z=o(e=>{if(!isFinite(e)||isNaN(e))return"00:00";const t=Math.floor(e/60),r=Math.floor(e%60);return`${t.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`},[]);n(()=>{const e=b.current;if(!e)return;const t=()=>{F(!1),v?.(!1),f?.()},r=()=>{F(!0),v?.(!0)},i=()=>{F(!1),v?.(!1)},n=()=>{L(e.currentTime),e.duration&&isFinite(e.duration)&&w(e.duration)},a=()=>{e.duration&&isFinite(e.duration)&&w(e.duration)};return e.addEventListener("ended",t),e.addEventListener("play",r),e.addEventListener("pause",i),e.addEventListener("timeupdate",n),e.addEventListener("loadedmetadata",a),e.addEventListener("durationchange",a),()=>{e.removeEventListener("ended",t),e.removeEventListener("play",r),e.removeEventListener("pause",i),e.removeEventListener("timeupdate",n),e.removeEventListener("loadedmetadata",a),e.removeEventListener("durationchange",a)}},[k,f]),d({audioRef:b,audioUrl:k});const B=A>0?S/A*100:0;return t(r,{children:[t("div",{className:l.examAudioContainer,children:[!y&&e("audio",{ref:b,...k?{src:k}:{},preload:"metadata"}),t("div",{style:{position:"relative",display:"inline-block",transform:"translateY(15px)"},children:[e(p,{src:c,alt:"title decoration",style:{width:"550px",height:"auto",display:"block",transform:"translateY(-45px)"},priority:!0}),e("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -55%)",zIndex:1,display:"inline-block",color:"#FFE341",fontSize:"32px",fontWeight:900,fontFamily:'"Nunito", "Open Sans", system-ui, sans-serif',textShadow:"2px 4px 0px rgba(11, 76, 142, 0.8)",textTransform:"uppercase",letterSpacing:"1.5px",padding:"15px 80px 30px",whiteSpace:"nowrap",lineHeight:1.25,backgroundImage:`url(${u.src})`,backgroundSize:"100% 100%",backgroundRepeat:"no-repeat",backgroundPosition:"center center"},children:x})]})]}),!y&&k&&t("div",{style:{position:"absolute",top:"50px",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:"10px",padding:"8px 24px",background:"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(6px)",borderRadius:"40px",zIndex:50,minWidth:"450px",border:"2px solid #E2E8F0"},children:[e("button",{type:"button",onClick:()=>{const e=b.current;e&&(E?e.pause():e.play().catch(()=>{}))},style:{width:"32px",height:"32px",border:"none",background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,padding:0,transition:"transform 0.15s ease"},className:"hover:scale-110 active:scale-95",children:E?e(g,{fill:"#FF6B6B",stroke:"#FF6B6B",size:26,style:{transform:"translateX(0px)"}}):e(m,{fill:"#4A90D9",stroke:"#4A90D9",size:26,style:{transform:"translateX(2px)"}})}),t("div",{style:{flex:1,position:"relative",height:"8px"},children:[e("div",{style:{position:"absolute",top:0,left:0,right:0,height:"8px",borderRadius:"0px",background:"#E0E6ED"}}),e("div",{style:{position:"absolute",top:0,left:0,height:"8px",borderRadius:"0px",width:`${B}%`,background:"linear-gradient(90deg, #4A90D9, #357ABD)",transition:"width 0.1s linear"}}),e("input",{type:"range",min:0,max:A||0,step:.1,value:S,onChange:e=>{const t=b.current;if(!t)return;const r=parseFloat(e.target.value);t.currentTime=r,L(r)},style:{position:"absolute",top:"-6px",left:0,width:"100%",height:"20px",opacity:0,cursor:"pointer",margin:0}})]}),t("span",{style:{fontSize:"14px",fontWeight:700,fontFamily:'"Quicksand", sans-serif',color:"#8B95A5",minWidth:"85px",textAlign:"right"},children:[e("span",{style:{color:"#343C55"},children:z(S)})," / ",z(A)]})]})]})}
|