@tinyweb_dev/oe-exam-sdk 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/exams/ExamCreator.js +1 -16
- package/dist/components/exams/take/ExamTakingPageContainer.js +0 -12
- package/dist/components/exams/take/components/QuestionRenderer.js +2 -15
- package/dist/components/exams/take/components/question-renderers/index.d.ts +0 -3
- package/dist/components/exams/take/components/question-renderers/index.js +0 -3
- package/dist/components/exams/take/components/speaking/renderers/SpeakingQuestionRenderer.js +0 -4
- package/dist/components/exams/take/types/speaking.types.d.ts +0 -31
- package/dist/components/exams/take/types.d.ts +0 -65
- package/dist/components/exams/take/utils/answer-transformers.js +6 -60
- package/dist/components/exams/take/utils/question-transformers.d.ts +2 -15
- package/dist/components/exams/take/utils/question-transformers.js +0 -143
- package/dist/components/questions/_shared/components/compact/CompactCreatorHeader.d.ts +23 -0
- package/dist/components/questions/_shared/components/compact/CompactCreatorHeader.js +9 -0
- package/dist/components/questions/_shared/components/compact/CompactExampleToggle.d.ts +6 -0
- package/dist/components/questions/_shared/components/compact/CompactExampleToggle.js +8 -0
- package/dist/components/questions/_shared/components/compact/CompactExplanationToggle.d.ts +7 -0
- package/dist/components/questions/_shared/components/compact/CompactExplanationToggle.js +14 -0
- package/dist/components/questions/_shared/components/compact/CompactFieldCard.d.ts +9 -0
- package/dist/components/questions/_shared/components/compact/CompactFieldCard.js +7 -0
- package/dist/components/questions/_shared/components/compact/CompactPreviewBanner.d.ts +7 -0
- package/dist/components/questions/_shared/components/compact/CompactPreviewBanner.js +7 -0
- package/dist/components/questions/_shared/components/compact/CompactPreviewButton.d.ts +6 -0
- package/dist/components/questions/_shared/components/compact/CompactPreviewButton.js +7 -0
- package/dist/components/questions/_shared/components/compact/index.d.ts +6 -0
- package/dist/components/questions/_shared/components/compact/index.js +6 -0
- package/dist/components/questions/_shared/config/question-types.config.js +0 -24
- package/dist/components/questions/_shared/hooks/useQuestionInitialization.js +0 -9
- package/dist/components/questions/_shared/types/choose-the-correct-answer-group.type.d.ts +2 -2
- package/dist/components/questions/_shared/types/choose-the-correct-answer-group.type.js +5 -1
- package/dist/components/questions/_shared/types/index.d.ts +0 -1
- package/dist/components/questions/_shared/types/index.js +0 -1
- package/dist/components/questions/_shared/types/look-and-choose-answer.type.d.ts +0 -13
- package/dist/components/questions/_shared/utils/answer-builder.js +0 -11
- package/dist/components/questions/components/ColorRegionCreator.js +66 -63
- package/dist/components/questions/components/QuestionSearchDropdown.js +0 -8
- package/dist/components/questions/components/QuestionTypeSelector.js +0 -2
- package/dist/components/questions/components/index.d.ts +1 -0
- package/dist/components/questions/components/index.js +1 -0
- package/dist/components/questions/creator/question-type-registry.js +0 -8
- package/dist/components/questions/groups/ArticlesGroupCard.js +2 -2
- package/dist/components/questions/groups/BasicQuestionGroupCard.js +1 -1
- package/dist/components/questions/groups/DocumentGroupCard.js +1 -1
- package/dist/components/questions/groups/ImageLabelGroupCard.js +1 -1
- package/dist/components/questions/groups/MatchAnswerGroupCard.js +2 -2
- package/dist/components/questions/question-bank/QuestionEditorRenderer.d.ts +0 -3
- package/dist/components/questions/question-bank/QuestionEditorRenderer.js +1 -10
- package/dist/components/questions/question-bank/editor-adapters/choice-adapters.d.ts +0 -2
- package/dist/components/questions/question-bank/editor-adapters/choice-adapters.js +0 -41
- package/dist/components/questions/question-bank/editor-adapters/index.d.ts +2 -2
- package/dist/components/questions/question-bank/editor-adapters/index.js +2 -2
- package/dist/components/questions/question-bank/editor-adapters/media-adapters.d.ts +0 -1
- package/dist/components/questions/question-bank/editor-adapters/media-adapters.js +0 -28
- package/dist/components/questions/question-bank/question-bank-picker.utils.js +0 -7
- package/dist/components/questions/types/answer-the-question/AnswerTheQuestionClient.js +16 -16
- package/dist/components/questions/types/answer-the-question/AnswerTheQuestionCreator.js +36 -30
- package/dist/components/questions/types/answer-the-question-group/AnswerTheQuestionGroupClient.js +1 -1
- package/dist/components/questions/types/answer-the-question-group/AnswerTheQuestionGroupCreator.js +7 -6
- package/dist/components/questions/types/arrange-letters-into-words/ArrangeLettersIntoWordsClient.js +2 -2
- package/dist/components/questions/types/arrange-letters-into-words/ArrangeLettersIntoWordsCreator.js +11 -7
- package/dist/components/questions/types/choose-correct-adjective/ChooseCorrectAdjectiveClient.js +1 -1
- package/dist/components/questions/types/choose-correct-adjective/ChooseCorrectAdjectiveCreator.js +11 -5
- package/dist/components/questions/types/choose-the-correct-answer/ChooseTheCorrectAnswerClient.js +5 -5
- package/dist/components/questions/types/choose-the-correct-answer/ChooseTheCorrectAnswerCreator.js +34 -28
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseAnswerGroupImageUpload.d.ts +7 -0
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseAnswerGroupImageUpload.js +5 -2
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseTheCorrectAnswerGroupClient.js +9 -5
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseTheCorrectAnswerGroupCreator.js +65 -62
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseTheCorrectAnswerGroupItemEditor.d.ts +6 -0
- package/dist/components/questions/types/choose-the-correct-answer-group/ChooseTheCorrectAnswerGroupItemEditor.js +145 -0
- package/dist/components/questions/types/choose-the-correct-answer-group/map-choose-the-correct-answer-group-data.js +6 -15
- package/dist/components/questions/types/choose-the-correct-answer-group/transform.js +5 -4
- package/dist/components/questions/types/choose-then-answer-group/ChooseThenAnswerGroupClient.js +7 -7
- package/dist/components/questions/types/choose-then-answer-group/ChooseThenAnswerGroupCreator.js +8 -5
- package/dist/components/questions/types/cross-out-word-group/CrossOutWordGroupClient.js +2 -2
- package/dist/components/questions/types/cross-out-word-group/CrossOutWordGroupCreator.js +20 -16
- package/dist/components/questions/types/crossword-puzzle/CrosswordPuzzleClient.js +1 -1
- package/dist/components/questions/types/crossword-puzzle/CrosswordPuzzleCreator.js +66 -29
- package/dist/components/questions/types/fill-in-blank/FillInBlankClient.js +5 -5
- package/dist/components/questions/types/fill-in-blank/FillInBlankCreator.js +45 -37
- package/dist/components/questions/types/fill-in-blank-group/FillInBlankGroupCreator.js +24 -20
- package/dist/components/questions/types/fill-missing-words-in-grid/FillMissingWordsInGridClient.js +2 -2
- package/dist/components/questions/types/fill-missing-words-in-grid/FillMissingWordsInGridCreator.js +68 -65
- package/dist/components/questions/types/find-words-in-matrix/FindWordsInMatrixClient.js +1 -1
- package/dist/components/questions/types/find-words-in-matrix/FindWordsInMatrixCreator.js +45 -5
- package/dist/components/questions/types/label-the-picture/LabelThePictureClient.js +2 -2
- package/dist/components/questions/types/label-the-picture/LabelThePictureCreator.js +18 -14
- package/dist/components/questions/types/listen-and-choose-from-answer-group/ListenAndChooseFromAnswerGroupClient.js +2 -2
- package/dist/components/questions/types/listen-and-choose-from-answer-group/ListenAndChooseFromAnswerGroupCreator.js +30 -30
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/ListenAndChooseObjectsInSceneClient.js +2 -2
- package/dist/components/questions/types/listen-and-choose-objects-in-scene/ListenAndChooseObjectsInSceneCreator.js +24 -31
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/ListenAndDragObjectsIntoSceneClient.js +2 -2
- package/dist/components/questions/types/listen-and-drag-objects-into-scene/ListenAndDragObjectsIntoSceneCreator.js +29 -32
- package/dist/components/questions/types/listen-and-speak-answer/ListenAndSpeakAnswerClient.js +1 -1
- package/dist/components/questions/types/listen-and-speak-answer/ListenAndSpeakAnswerCreator.js +27 -29
- package/dist/components/questions/types/listen-and-speak-compare-images/ListenAndSpeakCompareImagesClient.js +1 -1
- package/dist/components/questions/types/listen-and-speak-compare-images/ListenAndSpeakCompareImagesCreator.js +11 -15
- package/dist/components/questions/types/listen-and-speak-image-group/ListenAndSpeakImageGroupClient.js +1 -1
- package/dist/components/questions/types/listen-and-speak-image-group/ListenAndSpeakImageGroupCreator.js +22 -24
- package/dist/components/questions/types/listen-and-speak-info-exchange/ListenAndSpeakInfoExchangeClient.js +1 -1
- package/dist/components/questions/types/listen-and-speak-info-exchange/ListenAndSpeakInfoExchangeCreator.js +17 -24
- package/dist/components/questions/types/listen-and-speak-odd-one-out/ListenAndSpeakOddOneOutClient.js +1 -1
- package/dist/components/questions/types/listen-and-speak-odd-one-out/ListenAndSpeakOddOneOutCreator.js +31 -31
- package/dist/components/questions/types/listen-and-speak-question-list/ListenAndSpeakQuestionListClient.js +1 -1
- package/dist/components/questions/types/listen-and-speak-question-list/ListenAndSpeakQuestionListCreator.js +11 -15
- package/dist/components/questions/types/listen-and-speak-with-story-images/ListenAndSpeakWithStoryImagesClient.js +1 -1
- package/dist/components/questions/types/listen-and-speak-with-story-images/ListenAndSpeakWithStoryImagesCreator.js +14 -15
- package/dist/components/questions/types/match-by-writing-answer/MatchByWritingAnswerClient.js +2 -2
- package/dist/components/questions/types/match-by-writing-answer/MatchByWritingAnswerCreator.js +27 -25
- package/dist/components/questions/types/match-columns-to-make-sentences/MatchColumnsToMakeSentencesClient.js +12 -12
- package/dist/components/questions/types/match-columns-to-make-sentences/MatchColumnsToMakeSentencesCreator.js +8 -5
- package/dist/components/questions/types/match-word-to-picture/MatchWordToPictureClient.js +8 -8
- package/dist/components/questions/types/match-word-to-picture/MatchWordToPictureCreator.js +25 -20
- package/dist/components/questions/types/match-word-to-picture-group/MatchWordToPictureGroupClient.js +1 -1
- package/dist/components/questions/types/match-word-to-picture-group/MatchWordToPictureGroupCreator.js +13 -10
- package/dist/components/questions/types/matching-with-lines-group/MatchingWithLinesGroupCreator.js +8 -5
- package/dist/components/questions/types/read-displayed-content/ReadDisplayedContentCreator.js +7 -11
- package/dist/components/questions/types/read-passage-and-answer-questions/ReadPassageAndAnswerQuestionsClient.js +1 -1
- package/dist/components/questions/types/read-passage-and-answer-questions/ReadPassageAndAnswerQuestionsCreator.js +15 -12
- package/dist/components/questions/types/sort-words-into-categories/SortWordsIntoCategoriesClient.js +1 -1
- package/dist/components/questions/types/sort-words-into-categories/SortWordsIntoCategoriesCreator.js +5 -5
- package/dist/components/questions/types/speaking-conversation/SpeakingConversationCreator.js +35 -39
- package/dist/components/questions/types/speaking-conversation/SpeakingConversationPreviewClient.js +2 -2
- package/dist/components/questions/types/speaking-cue-card/SpeakingCueCardClient.js +1 -1
- package/dist/components/questions/types/speaking-cue-card/SpeakingCueCardCreator.js +7 -8
- package/dist/components/questions/types/speaking-describe-image/SpeakingDescribeImageClient.js +1 -1
- package/dist/components/questions/types/speaking-describe-image/SpeakingDescribeImageCreator.js +30 -23
- package/dist/components/questions/types/spontaneous-qa/SpontaneousQAClient.js +1 -1
- package/dist/components/questions/types/spontaneous-qa/SpontaneousQACreator.js +26 -19
- package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupClient.d.ts +1 -1
- package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupClient.js +79 -3
- package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupCreator.js +13 -11
- package/dist/components/questions/types/spontaneous-qa-group/index.d.ts +1 -0
- package/dist/components/questions/types/spontaneous-qa-group/index.js +1 -0
- package/dist/components/questions/types/spontaneous-qa-group/map-spontaneous-qa-group-data.d.ts +2 -0
- package/dist/components/questions/types/spontaneous-qa-group/map-spontaneous-qa-group-data.js +74 -0
- package/dist/components/questions/types/true-false/TrueFalseClient.js +2 -2
- package/dist/components/questions/types/true-false/TrueFalseCreator.js +35 -29
- package/dist/components/questions/types/true-false-correct-group/TrueFalseCorrectGroupClient.js +1 -1
- package/dist/components/questions/types/true-false-correct-group/TrueFalseCorrectGroupCreator.js +11 -7
- package/dist/components/questions/types/true-false-group/TrueFalseGroupClient.js +1 -1
- package/dist/components/questions/types/true-false-group/TrueFalseGroupCreator.js +11 -7
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphClient.js +2 -2
- package/dist/components/questions/types/word-fill-paragraph/WordFillParagraphCreator.js +21 -56
- package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormClient.js +1 -1
- package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormCreator.js +30 -24
- package/dist/components/questions/types/word-order-and-match-group/WordOrderAndMatchGroupClient.js +3 -3
- package/dist/components/questions/types/word-order-and-match-group/WordOrderAndMatchGroupCreator.js +12 -14
- package/dist/components/questions/types/word-ordering/WordOrderingClient.js +1 -1
- package/dist/components/questions/types/word-ordering/WordOrderingCreator.js +27 -18
- package/dist/components/questions/types/word-ordering-group/WordOrderingGroupClient.js +7 -7
- package/dist/components/questions/types/word-ordering-group/WordOrderingGroupCreator.js +16 -13
- package/dist/components/questions/types/write-a-short-letter/WriteAShortLetterClient.js +2 -2
- package/dist/components/questions/types/write-a-short-letter/WriteAShortLetterCreator.js +34 -28
- package/dist/components/questions/types/write-correct-verb-form/WriteCorrectVerbFormClient.js +2 -2
- package/dist/components/questions/types/write-correct-verb-form/WriteCorrectVerbFormCreator.js +22 -22
- package/dist/components/questions/types/write-sentences/WriteSentencesCreator.js +21 -18
- package/dist/components/questions/types/write-short-paragraph/WriteShortParagraphClient.js +1 -1
- package/dist/components/questions/types/write-short-paragraph/WriteShortParagraphCreator.js +7 -4
- package/dist/components/questions/viewer/QuestionViewer.js +0 -98
- package/dist/components/questions/viewer/SpontaneousQaGroupViewer.js +4 -79
- package/dist/components/results/renderers/review-question-body-movers.js +2 -26
- package/dist/components/results/review-data.js +0 -4
- package/dist/components/ui/points-input.d.ts +1 -0
- package/dist/components/ui/points-input.js +12 -2
- package/dist/shared/constants/question-skills.js +0 -11
- package/dist/shared/lib/i18n/messages/en/admin.d.ts +0 -3
- package/dist/shared/lib/i18n/messages/en/admin.js +0 -3
- package/dist/shared/lib/i18n/messages/en.d.ts +0 -3
- package/dist/shared/lib/i18n/messages/vi/admin.d.ts +0 -3
- package/dist/shared/lib/i18n/messages/vi/admin.js +0 -3
- package/dist/shared/lib/i18n/messages/vi.d.ts +0 -3
- package/dist/shared/lib/utils/question-reverse-transform.js +4 -23
- package/dist/shared/lib/utils/question-transform-types.d.ts +1 -23
- package/dist/shared/lib/utils/question-transform-validation.js +0 -40
- package/dist/shared/lib/utils/question-transform.js +0 -9
- package/dist/shared/types/common.types.d.ts +1 -1
- package/dist/shared/types/entities/question.types.d.ts +1 -11
- package/dist/shared/types/questions/choose-the-correct-answer-group.d.ts +1 -1
- package/dist/shared/types/questions/index.d.ts +0 -3
- package/dist/shared/types/questions/index.js +0 -6
- package/package.json +1 -1
- package/dist/components/exams/take/components/question-renderers/MoversFillWordHintRenderer.d.ts +0 -2
- package/dist/components/exams/take/components/question-renderers/MoversFillWordHintRenderer.js +0 -131
- package/dist/components/exams/take/components/question-renderers/MoversPictureChooseRenderer.d.ts +0 -2
- package/dist/components/exams/take/components/question-renderers/MoversPictureChooseRenderer.js +0 -76
- package/dist/components/exams/take/components/question-renderers/MoversPictureFillBlankChooseRenderer.d.ts +0 -2
- package/dist/components/exams/take/components/question-renderers/MoversPictureFillBlankChooseRenderer.js +0 -68
- package/dist/components/exams/take/components/speaking/renderers/SpeakingGNInterviewRenderer.d.ts +0 -16
- package/dist/components/exams/take/components/speaking/renderers/SpeakingGNInterviewRenderer.js +0 -212
- package/dist/components/questions/_shared/types/gn-speaking-interview.type.d.ts +0 -32
- package/dist/components/questions/_shared/types/gn-speaking-interview.type.js +0 -1
- package/dist/components/questions/_shared/types/look-picture-fill-word-hint.type.d.ts +0 -47
- package/dist/components/questions/_shared/types/look-picture-fill-word-hint.type.js +0 -1
- package/dist/components/questions/types/gn-speaking-interview/GNSpeakingInterviewCreator.d.ts +0 -2
- package/dist/components/questions/types/gn-speaking-interview/GNSpeakingInterviewCreator.js +0 -262
- package/dist/components/questions/types/gn-speaking-interview/register.d.ts +0 -2
- package/dist/components/questions/types/gn-speaking-interview/register.js +0 -121
- package/dist/components/questions/types/gn-speaking-interview/transform.d.ts +0 -2
- package/dist/components/questions/types/gn-speaking-interview/transform.js +0 -48
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerClient.d.ts +0 -20
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerClient.js +0 -72
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerCreator.d.ts +0 -15
- package/dist/components/questions/types/look-picture-choose-correct-answer/LookPictureChooseCorrectAnswerCreator.js +0 -230
- package/dist/components/questions/types/look-picture-choose-correct-answer/index.d.ts +0 -1
- package/dist/components/questions/types/look-picture-choose-correct-answer/index.js +0 -1
- package/dist/components/questions/types/look-picture-choose-correct-answer/register.d.ts +0 -2
- package/dist/components/questions/types/look-picture-choose-correct-answer/register.js +0 -66
- package/dist/components/questions/types/look-picture-choose-correct-answer/transform.d.ts +0 -2
- package/dist/components/questions/types/look-picture-choose-correct-answer/transform.js +0 -42
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerClient.d.ts +0 -6
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerClient.js +0 -96
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerCreator.d.ts +0 -15
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/LookPictureFillBlankChooseAnswerCreator.js +0 -238
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/index.d.ts +0 -2
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/index.js +0 -2
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/register.d.ts +0 -2
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/register.js +0 -76
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/transform.d.ts +0 -2
- package/dist/components/questions/types/look-picture-fill-blank-choose-answer/transform.js +0 -19
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintClient.d.ts +0 -7
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintClient.js +0 -134
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintCreator.d.ts +0 -3
- package/dist/components/questions/types/look-picture-fill-word-hint/LookPictureFillWordHintCreator.js +0 -617
- package/dist/components/questions/types/look-picture-fill-word-hint/index.d.ts +0 -2
- package/dist/components/questions/types/look-picture-fill-word-hint/index.js +0 -2
- package/dist/components/questions/types/look-picture-fill-word-hint/register.d.ts +0 -2
- package/dist/components/questions/types/look-picture-fill-word-hint/register.js +0 -82
- package/dist/components/questions/types/look-picture-fill-word-hint/transform.d.ts +0 -2
- package/dist/components/questions/types/look-picture-fill-word-hint/transform.js +0 -29
- package/dist/shared/lib/validation/look-picture-choose-correct-answer.validation.d.ts +0 -9
- package/dist/shared/lib/validation/look-picture-choose-correct-answer.validation.js +0 -12
- package/dist/shared/lib/validation/look-picture-fill-blank-choose-answer.validation.d.ts +0 -17
- package/dist/shared/lib/validation/look-picture-fill-blank-choose-answer.validation.js +0 -47
- package/dist/shared/types/questions/look-picture-choose-correct-answer.d.ts +0 -38
- package/dist/shared/types/questions/look-picture-choose-correct-answer.js +0 -5
- package/dist/shared/types/questions/look-picture-fill-blank-choose-answer.d.ts +0 -63
- package/dist/shared/types/questions/look-picture-fill-blank-choose-answer.js +0 -9
- package/dist/shared/types/questions/look-picture-fill-word-hint.d.ts +0 -57
- package/dist/shared/types/questions/look-picture-fill-word-hint.js +0 -7
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { LookPictureFillWordHint } from './LookPictureFillWordHintCreator';
|
|
2
|
-
export const lookPictureFillWordHintRegistration = {
|
|
3
|
-
component: LookPictureFillWordHint,
|
|
4
|
-
transformInitialData: (initialData) => {
|
|
5
|
-
const content = initialData?.content;
|
|
6
|
-
const answer = initialData?.answer;
|
|
7
|
-
// Get hintLetters from various sources
|
|
8
|
-
const hintLettersFromGroup = initialData?.questionGroup?.payload?.hintLetters;
|
|
9
|
-
const hintLettersFromAnswer = answer?.hintLetters;
|
|
10
|
-
const hintLettersFallback = content?.hintLetters;
|
|
11
|
-
const hintLetters = hintLettersFromGroup || hintLettersFromAnswer || hintLettersFallback || [];
|
|
12
|
-
const apiPoints = initialData?.total_points
|
|
13
|
-
? parseFloat(initialData.total_points)
|
|
14
|
-
: (initialData?.points || 1);
|
|
15
|
-
// PRIORITY 1: Store format - answer has subQuestions
|
|
16
|
-
if (answer?.subQuestions && answer.subQuestions.length > 0) {
|
|
17
|
-
return {
|
|
18
|
-
subQuestions: answer.subQuestions,
|
|
19
|
-
hintLetters: hintLetters.length > 0 ? hintLetters : answer.hintLetters || [],
|
|
20
|
-
caseSensitive: answer?.caseSensitive ?? false,
|
|
21
|
-
points: apiPoints,
|
|
22
|
-
explanation: answer?.explanation || initialData?.explanation || '',
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
// PRIORITY 2: API format - content has imageUrl/word
|
|
26
|
-
else if (content && (content.imageUrl !== undefined || content.word !== undefined)) {
|
|
27
|
-
return {
|
|
28
|
-
content: {
|
|
29
|
-
imageUrl: content.imageUrl || '',
|
|
30
|
-
word: content.word || '',
|
|
31
|
-
},
|
|
32
|
-
answer: {
|
|
33
|
-
correctAnswer: answer?.correctAnswer || '',
|
|
34
|
-
caseSensitive: answer?.caseSensitive ?? false,
|
|
35
|
-
hintLetters,
|
|
36
|
-
explanation: answer?.explanation || initialData?.explanation || '',
|
|
37
|
-
},
|
|
38
|
-
hintLetters,
|
|
39
|
-
caseSensitive: answer?.caseSensitive ?? false,
|
|
40
|
-
points: apiPoints,
|
|
41
|
-
explanation: answer?.explanation || initialData?.explanation || '',
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// PRIORITY 3: Fallback
|
|
45
|
-
else {
|
|
46
|
-
return {
|
|
47
|
-
...answer,
|
|
48
|
-
hintLetters,
|
|
49
|
-
caseSensitive: answer?.caseSensitive ?? false,
|
|
50
|
-
points: apiPoints,
|
|
51
|
-
explanation: answer?.explanation || initialData?.explanation || '',
|
|
52
|
-
};
|
|
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: ctx.state.content,
|
|
65
|
-
points: data?.points ?? ctx.state.points ?? 1,
|
|
66
|
-
level: ctx.state.level,
|
|
67
|
-
difficulty: ctx.state.difficulty,
|
|
68
|
-
skill: ctx.state.skill,
|
|
69
|
-
answer: data,
|
|
70
|
-
explanation: data?.explanation || '',
|
|
71
|
-
}),
|
|
72
|
-
wrapOnChange: (data, ctx) => ({
|
|
73
|
-
type: ctx.questionType,
|
|
74
|
-
content: ctx.state.content,
|
|
75
|
-
points: data?.points ?? ctx.state.points ?? 1,
|
|
76
|
-
level: ctx.state.level,
|
|
77
|
-
difficulty: ctx.state.difficulty,
|
|
78
|
-
skill: ctx.state.skill,
|
|
79
|
-
answer: data,
|
|
80
|
-
explanation: data?.explanation || '',
|
|
81
|
-
}),
|
|
82
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const transformLookPictureFillWordHint = (question) => {
|
|
2
|
-
const answerData = question.answer;
|
|
3
|
-
if (!answerData?.subQuestions || answerData.subQuestions.length === 0) {
|
|
4
|
-
return { apiContent: {}, apiCorrectAnswer: {} };
|
|
5
|
-
}
|
|
6
|
-
const sq = answerData.subQuestions[0];
|
|
7
|
-
const apiContent = {
|
|
8
|
-
imageUrl: sq.imageUrl,
|
|
9
|
-
word: sq.word,
|
|
10
|
-
};
|
|
11
|
-
const groupNumber = sq.groupNumber || 1;
|
|
12
|
-
const hintLettersByGroup = answerData.hintLettersByGroup;
|
|
13
|
-
let hintLetters = [];
|
|
14
|
-
if (hintLettersByGroup && hintLettersByGroup[groupNumber]) {
|
|
15
|
-
hintLetters = hintLettersByGroup[groupNumber];
|
|
16
|
-
}
|
|
17
|
-
else if (answerData.hintLetters) {
|
|
18
|
-
hintLetters = answerData.hintLetters;
|
|
19
|
-
}
|
|
20
|
-
return {
|
|
21
|
-
apiContent,
|
|
22
|
-
apiCorrectAnswer: {
|
|
23
|
-
correctAnswer: sq.correctAnswer || '',
|
|
24
|
-
caseSensitive: answerData.caseSensitive || false,
|
|
25
|
-
},
|
|
26
|
-
hintLetters,
|
|
27
|
-
groupNumber,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const lookPictureChooseCorrectAnswerFormSchema: z.ZodObject<{
|
|
3
|
-
imageUrl: z.ZodString;
|
|
4
|
-
options: z.ZodArray<z.ZodString>;
|
|
5
|
-
correctAnswer: z.ZodNumber;
|
|
6
|
-
explanation: z.ZodOptional<z.ZodString>;
|
|
7
|
-
points: z.ZodOptional<z.ZodNumber>;
|
|
8
|
-
}, z.core.$strip>;
|
|
9
|
-
export type LookPictureChooseCorrectAnswerFormData = z.infer<typeof lookPictureChooseCorrectAnswerFormSchema>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
// Main form validation schema - NEW flat structure
|
|
3
|
-
// Same as LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER but without question field
|
|
4
|
-
export const lookPictureChooseCorrectAnswerFormSchema = z.object({
|
|
5
|
-
imageUrl: z.string().min(1, 'Vui lòng upload hình ảnh!'),
|
|
6
|
-
options: z
|
|
7
|
-
.array(z.string().min(1, 'Vui lòng nhập nội dung đáp án!'))
|
|
8
|
-
.min(2, 'Phải có ít nhất 2 lựa chọn!'),
|
|
9
|
-
correctAnswer: z.number(),
|
|
10
|
-
explanation: z.string().optional(),
|
|
11
|
-
points: z.number().min(0.5).optional(),
|
|
12
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Validation schema for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER form
|
|
4
|
-
*
|
|
5
|
-
* Based on API payload structure:
|
|
6
|
-
* - content: { imageUrl, question, options: string[] }
|
|
7
|
-
* - correct_answer: { answer: number }
|
|
8
|
-
*/
|
|
9
|
-
export declare const lookPictureFillBlankChooseAnswerFormSchema: z.ZodObject<{
|
|
10
|
-
imageUrl: z.ZodString;
|
|
11
|
-
question: z.ZodString;
|
|
12
|
-
options: z.ZodArray<z.ZodString>;
|
|
13
|
-
correctAnswer: z.ZodNumber;
|
|
14
|
-
explanation: z.ZodOptional<z.ZodString>;
|
|
15
|
-
points: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
export type LookPictureFillBlankChooseAnswerFormData = z.infer<typeof lookPictureFillBlankChooseAnswerFormSchema>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Validation schema for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER form
|
|
4
|
-
*
|
|
5
|
-
* Based on API payload structure:
|
|
6
|
-
* - content: { imageUrl, question, options: string[] }
|
|
7
|
-
* - correct_answer: { answer: number }
|
|
8
|
-
*/
|
|
9
|
-
export const lookPictureFillBlankChooseAnswerFormSchema = z.object({
|
|
10
|
-
imageUrl: z.string().min(1, 'Vui lòng upload hình ảnh!'),
|
|
11
|
-
question: z
|
|
12
|
-
.string()
|
|
13
|
-
.min(1, 'Vui lòng nhập nội dung câu hỏi!')
|
|
14
|
-
.refine((val) => val.includes('{0}'), {
|
|
15
|
-
message: 'Câu hỏi phải chứa {0} để đánh dấu chỗ trống',
|
|
16
|
-
})
|
|
17
|
-
.refine((val) => (val.match(/\{0\}/g) || []).length <= 1, {
|
|
18
|
-
message: 'Chỉ được có một {0} trong câu hỏi',
|
|
19
|
-
}),
|
|
20
|
-
options: z
|
|
21
|
-
.array(z.string().min(1, 'Vui lòng nhập đáp án!'))
|
|
22
|
-
.min(2, 'Phải có ít nhất 2 đáp án!')
|
|
23
|
-
.refine((options) => options.filter((opt) => opt.trim() !== '').length >= 2, { message: 'Phải có ít nhất 2 đáp án được điền!' }),
|
|
24
|
-
correctAnswer: z.number().min(0, 'Vui lòng chọn đáp án đúng!'),
|
|
25
|
-
explanation: z.string().optional(),
|
|
26
|
-
points: z
|
|
27
|
-
.union([z.string(), z.number()])
|
|
28
|
-
.transform((val, ctx) => {
|
|
29
|
-
if (val === '' || val === undefined || val === null) {
|
|
30
|
-
ctx.addIssue({
|
|
31
|
-
code: z.ZodIssueCode.custom,
|
|
32
|
-
message: 'Vui lòng nhập điểm số!',
|
|
33
|
-
});
|
|
34
|
-
return z.NEVER;
|
|
35
|
-
}
|
|
36
|
-
const num = typeof val === 'string' ? parseInt(val, 10) : val;
|
|
37
|
-
if (isNaN(num)) {
|
|
38
|
-
ctx.addIssue({
|
|
39
|
-
code: z.ZodIssueCode.custom,
|
|
40
|
-
message: 'Vui lòng nhập điểm số hợp lệ!',
|
|
41
|
-
});
|
|
42
|
-
return z.NEVER;
|
|
43
|
-
}
|
|
44
|
-
return num;
|
|
45
|
-
})
|
|
46
|
-
.pipe(z.number().min(1, 'Điểm số phải >= 1')),
|
|
47
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Types for LOOK_PICTURE_CHOOSE_CORRECT_ANSWER question type
|
|
3
|
-
* Reference: .question_type/LookPictureChooseCorrectAnswer.json
|
|
4
|
-
*/
|
|
5
|
-
import { QuestionBankSettings } from './choose-the-correct-answer';
|
|
6
|
-
/**
|
|
7
|
-
* Content structure - fields in "content"
|
|
8
|
-
*/
|
|
9
|
-
export interface LookPictureChooseCorrectAnswerContent {
|
|
10
|
-
imageUrl: string;
|
|
11
|
-
options: string[];
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Correct answer structure - fields in "correctAnswer"
|
|
15
|
-
*/
|
|
16
|
-
export interface LookPictureChooseCorrectAnswerCorrectAnswer {
|
|
17
|
-
answer: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Full API payload for LOOK_PICTURE_CHOOSE_CORRECT_ANSWER
|
|
21
|
-
*/
|
|
22
|
-
export interface LookPictureChooseCorrectAnswerAPIPayload {
|
|
23
|
-
id?: string;
|
|
24
|
-
questionType: 'LOOK_PICTURE_CHOOSE_CORRECT_ANSWER';
|
|
25
|
-
content: LookPictureChooseCorrectAnswerContent;
|
|
26
|
-
correctAnswer: LookPictureChooseCorrectAnswerCorrectAnswer;
|
|
27
|
-
points: number;
|
|
28
|
-
explanation?: string;
|
|
29
|
-
questionNumber: number;
|
|
30
|
-
partId?: string;
|
|
31
|
-
partNo?: number;
|
|
32
|
-
addToQuestionBank?: boolean;
|
|
33
|
-
questionBank?: QuestionBankSettings;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* LocalStorage format (without addToQuestionBank and questionBank)
|
|
37
|
-
*/
|
|
38
|
-
export type LookPictureChooseCorrectAnswerLocalStorage = Omit<LookPictureChooseCorrectAnswerAPIPayload, 'addToQuestionBank' | 'questionBank'>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Payload interface for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER question type
|
|
3
|
-
*
|
|
4
|
-
* Used for:
|
|
5
|
-
* - API GET /manage/exams/{examId}/questions response
|
|
6
|
-
* - API POST /admin/questions/batch request/response
|
|
7
|
-
* - localStorage storage (without addToQuestionBank and questionBank)
|
|
8
|
-
*/
|
|
9
|
-
import { QuestionBankSettings } from './choose-the-correct-answer';
|
|
10
|
-
/**
|
|
11
|
-
* Content structure for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER
|
|
12
|
-
* The question contains a blank marked with {0} that students fill in
|
|
13
|
-
*/
|
|
14
|
-
export interface LookPictureFillBlankChooseAnswerContent {
|
|
15
|
-
imageUrl: string;
|
|
16
|
-
question: string;
|
|
17
|
-
options: string[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Correct answer structure for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER
|
|
21
|
-
*/
|
|
22
|
-
export interface LookPictureFillBlankChooseAnswerCorrectAnswer {
|
|
23
|
-
answer: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Full API payload for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```json
|
|
30
|
-
* {
|
|
31
|
-
* "question_type": "LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER",
|
|
32
|
-
* "content": {
|
|
33
|
-
* "imageUrl": "questions/images/cat.jpg",
|
|
34
|
-
* "question": "The cat is {0} the chair.",
|
|
35
|
-
* "options": ["A", "B", "C", "D"]
|
|
36
|
-
* },
|
|
37
|
-
* "correct_answer": { "answer": 1 },
|
|
38
|
-
* "points": 1,
|
|
39
|
-
* "explanation": "Giải thích",
|
|
40
|
-
* "question_number": 2,
|
|
41
|
-
* "addToQuestionBank": true,
|
|
42
|
-
* "questionBank": { "name": "Question Bank 3" }
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export interface LookPictureFillBlankChooseAnswerAPIPayload {
|
|
47
|
-
id?: string;
|
|
48
|
-
questionType: 'LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER';
|
|
49
|
-
content: LookPictureFillBlankChooseAnswerContent;
|
|
50
|
-
correctAnswer: LookPictureFillBlankChooseAnswerCorrectAnswer;
|
|
51
|
-
points: number;
|
|
52
|
-
explanation?: string;
|
|
53
|
-
questionNumber: number;
|
|
54
|
-
partId?: string;
|
|
55
|
-
partNo?: number;
|
|
56
|
-
addToQuestionBank?: boolean;
|
|
57
|
-
questionBank?: QuestionBankSettings;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* LocalStorage format for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER
|
|
61
|
-
* Same as API payload but without addToQuestionBank and questionBank
|
|
62
|
-
*/
|
|
63
|
-
export type LookPictureFillBlankChooseAnswerLocalStorage = Omit<LookPictureFillBlankChooseAnswerAPIPayload, 'addToQuestionBank' | 'questionBank'>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Payload interface for LOOK_PICTURE_FILL_BLANK_CHOOSE_ANSWER question type
|
|
3
|
-
*
|
|
4
|
-
* Used for:
|
|
5
|
-
* - API GET /manage/exams/{examId}/questions response
|
|
6
|
-
* - API POST /admin/questions/batch request/response
|
|
7
|
-
* - localStorage storage (without addToQuestionBank and questionBank)
|
|
8
|
-
*/
|
|
9
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* API Types for LOOK_PICTURE_FILL_WORD_HINT question type
|
|
3
|
-
* Reference: .question_type/LookPictureFillWordHint.json
|
|
4
|
-
*
|
|
5
|
-
* API uses camelCase format
|
|
6
|
-
*/
|
|
7
|
-
import { QuestionBankSettings } from './choose-the-correct-answer';
|
|
8
|
-
/**
|
|
9
|
-
* Content structure - fields in "content"
|
|
10
|
-
*/
|
|
11
|
-
export interface LookPictureFillWordHintContent {
|
|
12
|
-
imageUrl: string;
|
|
13
|
-
word: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Correct answer structure - fields in "correctAnswer"
|
|
17
|
-
*/
|
|
18
|
-
export interface LookPictureFillWordHintCorrectAnswer {
|
|
19
|
-
correctAnswer: string;
|
|
20
|
-
caseSensitive: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Question group payload - shared hint letters
|
|
24
|
-
*/
|
|
25
|
-
export interface LookPictureFillWordHintGroupPayload {
|
|
26
|
-
hintLetters: string[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Question group structure
|
|
30
|
-
*/
|
|
31
|
-
export interface LookPictureFillWordHintQuestionGroup {
|
|
32
|
-
payload: LookPictureFillWordHintGroupPayload;
|
|
33
|
-
groupNumber: number;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Full API payload for LOOK_PICTURE_FILL_WORD_HINT
|
|
37
|
-
* Uses camelCase format
|
|
38
|
-
*/
|
|
39
|
-
export interface LookPictureFillWordHintAPIPayload {
|
|
40
|
-
id?: string;
|
|
41
|
-
questionType: 'LOOK_PICTURE_FILL_WORD_HINT';
|
|
42
|
-
content: LookPictureFillWordHintContent;
|
|
43
|
-
correctAnswer: LookPictureFillWordHintCorrectAnswer;
|
|
44
|
-
isGroup: boolean;
|
|
45
|
-
questionGroup: LookPictureFillWordHintQuestionGroup;
|
|
46
|
-
points: number;
|
|
47
|
-
explanation?: string;
|
|
48
|
-
questionNumber: number;
|
|
49
|
-
partId?: string;
|
|
50
|
-
partNo?: number;
|
|
51
|
-
addToQuestionBank?: boolean;
|
|
52
|
-
questionBank?: QuestionBankSettings;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* LocalStorage format (without addToQuestionBank and questionBank)
|
|
56
|
-
*/
|
|
57
|
-
export type LookPictureFillWordHintLocalStorage = Omit<LookPictureFillWordHintAPIPayload, 'addToQuestionBank' | 'questionBank'>;
|