@tinyweb_dev/oe-exam-sdk 1.0.11 → 1.0.13

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.
Files changed (32) hide show
  1. package/dist/components/questions/_shared/components/compact/KidPassage.d.ts +4 -0
  2. package/dist/components/questions/_shared/components/compact/KidPassage.js +21 -0
  3. package/dist/components/questions/_shared/components/compact/KidQuestionCard.d.ts +5 -2
  4. package/dist/components/questions/_shared/components/compact/KidQuestionCard.js +4 -2
  5. package/dist/components/questions/_shared/components/compact/SpeakingReplyMic.d.ts +7 -0
  6. package/dist/components/questions/_shared/components/compact/SpeakingReplyMic.js +86 -0
  7. package/dist/components/questions/_shared/components/compact/index.d.ts +2 -0
  8. package/dist/components/questions/_shared/components/compact/index.js +2 -0
  9. package/dist/components/questions/types/answer-the-question-group/AnswerTheQuestionGroupClient.js +14 -5
  10. package/dist/components/questions/types/answer-the-question-group/map-answer-the-question-group-data.js +2 -2
  11. package/dist/components/questions/types/choose-then-answer-group/ChooseThenAnswerGroupClient.js +35 -55
  12. package/dist/components/questions/types/speaking-cue-card/SpeakingCueCardClient.d.ts +4 -1
  13. package/dist/components/questions/types/speaking-cue-card/SpeakingCueCardClient.js +4 -4
  14. package/dist/components/questions/types/spontaneous-qa-group/SpontaneousQaGroupClient.js +2 -75
  15. package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormClient.js +32 -35
  16. package/dist/components/questions/types/word-fill-structured-form/WordFillStructuredFormCreator.js +2 -8
  17. package/dist/components/questions/types/word-fill-structured-form/map-wfsf-question-data.js +4 -11
  18. package/dist/components/questions/types/word-fill-structured-form/transform.js +4 -9
  19. package/dist/components/questions/viewer/QuestionViewer.d.ts +3 -1
  20. package/dist/components/questions/viewer/QuestionViewer.js +36 -19
  21. package/dist/components/questions/viewer/SpontaneousQaGroupViewer.js +1 -1
  22. package/dist/shared/index.d.ts +2 -0
  23. package/dist/shared/index.js +1 -0
  24. package/dist/shared/lib/i18n/messages/en/common.d.ts +38 -0
  25. package/dist/shared/lib/i18n/messages/en/common.js +39 -0
  26. package/dist/shared/lib/i18n/messages/en.d.ts +38 -0
  27. package/dist/shared/lib/i18n/messages/vi/common.d.ts +38 -0
  28. package/dist/shared/lib/i18n/messages/vi/common.js +39 -0
  29. package/dist/shared/lib/i18n/messages/vi.d.ts +38 -0
  30. package/dist/shared/lib/utils/media-urls.d.ts +2 -0
  31. package/dist/shared/lib/utils/media-urls.js +23 -0
  32. package/package.json +1 -1
@@ -2297,5 +2297,43 @@ declare const vi: {
2297
2297
  readonly 'common.badge.source.createdByAdmin': "Admin tạo";
2298
2298
  readonly 'common.badge.source.createdByTeacher': "Giáo viên tạo";
2299
2299
  readonly 'common.badge.source.createdFromEBM': "Đồng bộ EBM";
2300
+ readonly 'question.viewer.fallbackTitle': "Câu hỏi";
2301
+ readonly 'question.viewer.points': "{count} điểm";
2302
+ readonly 'question.viewer.questionN': "Câu {n}";
2303
+ readonly 'question.viewer.partN': "Bài {n}";
2304
+ readonly 'question.viewer.example': "Câu ví dụ";
2305
+ readonly 'question.viewer.correct': "Đúng";
2306
+ readonly 'question.viewer.wrong': "Sai";
2307
+ readonly 'question.viewer.readingPassage': "Bài đọc";
2308
+ readonly 'question.viewer.placeholder': "Nhập câu trả lời...";
2309
+ readonly 'question.viewer.yourAnswer': "Câu trả lời của bạn";
2310
+ readonly 'question.viewer.writePlaceholder': "Viết câu trả lời tại đây...";
2311
+ readonly 'question.viewer.answerKey': "Đáp án";
2312
+ readonly 'question.viewer.noAnswer': "Chưa có đáp án";
2313
+ readonly 'question.viewer.notWritten': "Chưa viết";
2314
+ readonly 'question.viewer.sample': "Mẫu";
2315
+ readonly 'question.viewer.chooseScore': "Chọn {score}";
2316
+ readonly 'question.viewer.writeScore': "Viết {score}";
2317
+ readonly 'question.viewer.expandPassage': "Xem thêm";
2318
+ readonly 'question.viewer.collapsePassage': "Thu gọn";
2319
+ readonly 'question.viewer.unsupported': "Loại câu hỏi không được hỗ trợ: {type}";
2320
+ readonly 'question.viewer.missingPrompt': "Câu hỏi chưa được nhập";
2321
+ readonly 'question.viewer.imageAlt': "Hình ảnh ({n})";
2322
+ readonly 'question.viewer.itemImageAlt': "Hình ảnh câu {n} ({m})";
2323
+ readonly 'question.viewer.atqgDefaultInstruction': "Đọc đoạn văn và trả lời câu hỏi.";
2324
+ readonly 'question.viewer.wfsfDefaultTitle': "Điền từ vào biểu mẫu có cấu trúc";
2325
+ readonly 'question.type.ANSWER_THE_QUESTION_GROUP': "Trả lời câu hỏi";
2326
+ readonly 'question.type.CHOOSE_THEN_ANSWER_GROUP': "Chọn rồi trả lời";
2327
+ readonly 'question.type.FILL_IN_BLANK': "Điền từ";
2328
+ readonly 'question.type.FILL_IN_BLANK_GROUP': "Điền từ";
2329
+ readonly 'question.type.WORD_FILL_STRUCTURED_FORM': "Điền từ vào biểu mẫu";
2330
+ readonly 'question.type.WORD_FILL_PARAGRAPH': "Điền từ vào đoạn";
2331
+ readonly 'question.type.MATCHING_WITH_LINES_GROUP': "Nối cột";
2332
+ readonly 'question.type.MATCH_WORD_TO_PICTURE': "Nối từ với tranh";
2333
+ readonly 'question.type.MATCH_WORD_TO_PICTURE_GROUP': "Nối từ với tranh";
2334
+ readonly 'question.type.CROSSWORD_PUZZLE': "Ô chữ";
2335
+ readonly 'question.type.FIND_WORDS_IN_MATRIX': "Tìm từ";
2336
+ readonly 'question.type.CHOOSE_THE_CORRECT_ANSWER': "Chọn đáp án đúng";
2337
+ readonly 'question.type.CHOOSE_THE_CORRECT_ANSWER_GROUP': "Chọn đáp án đúng";
2300
2338
  };
2301
2339
  export default vi;
@@ -0,0 +1,2 @@
1
+ /** Normalize creator / bank `imageUrl` that may be a string, string[], or Array#toString join. */
2
+ export declare function toMediaUrlList(value: unknown): string[];
@@ -0,0 +1,23 @@
1
+ /** Normalize creator / bank `imageUrl` that may be a string, string[], or Array#toString join. */
2
+ export function toMediaUrlList(value) {
3
+ if (Array.isArray(value)) {
4
+ return value.flatMap((item) => toMediaUrlList(item));
5
+ }
6
+ if (typeof value !== 'string') {
7
+ return [];
8
+ }
9
+ const trimmed = value.trim();
10
+ if (!trimmed) {
11
+ return [];
12
+ }
13
+ if (trimmed.includes(',') && /https?:\/\//i.test(trimmed)) {
14
+ const parts = trimmed
15
+ .split(',')
16
+ .map((part) => part.trim())
17
+ .filter(Boolean);
18
+ if (parts.length > 1 && parts.every((part) => /^https?:\/\//i.test(part) || !part.includes(' '))) {
19
+ return parts;
20
+ }
21
+ }
22
+ return [trimmed];
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinyweb_dev/oe-exam-sdk",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Reusable OceanEdu question components.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",