@elice/material-quiz 1.240802.0-quiz.0 → 1.240802.0
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/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +0 -2
- package/cjs/components/material-quiz/MaterialQuizSelectOne.js +0 -2
- package/cjs/components/material-quiz/MaterialQuizText.js +0 -2
- package/cjs/components/material-quiz/locales/en.json.js +1 -1
- package/cjs/components/material-quiz/locales/ja.json.js +1 -1
- package/cjs/components/material-quiz/locales/ko.json.js +1 -1
- package/cjs/components/material-quiz/locales/th.json.js +1 -1
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +2 -1
- package/cjs/components/shared/QuestionBox.d.ts +0 -2
- package/cjs/components/shared/QuestionBox.js +2 -28
- package/cjs/helpers/index.d.ts +2 -0
- package/cjs/helpers/index.js +10 -0
- package/es/components/material-quiz/MaterialQuizSelectMultiple.js +1 -3
- package/es/components/material-quiz/MaterialQuizSelectOne.js +1 -3
- package/es/components/material-quiz/MaterialQuizText.js +1 -3
- package/es/components/material-quiz/locales/en.json.js +1 -1
- package/es/components/material-quiz/locales/ja.json.js +1 -1
- package/es/components/material-quiz/locales/ko.json.js +1 -1
- package/es/components/material-quiz/locales/th.json.js +1 -1
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +2 -1
- package/es/components/shared/QuestionBox.d.ts +0 -2
- package/es/components/shared/QuestionBox.js +2 -28
- package/es/helpers/index.d.ts +2 -0
- package/es/helpers/index.js +10 -1
- package/package.json +3 -3
|
@@ -73,7 +73,6 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
|
|
|
73
73
|
setHasSubmitted = _React$useState10[1];
|
|
74
74
|
var isNextActive = hasSubmitted && typeof onNext === 'function';
|
|
75
75
|
var isDisabled = selectedAnswer.length === 0 || index.checkUserLectureTestEnded(lecture) || !!userId;
|
|
76
|
-
var questionStatus = hasSubmitted ? index.getQuizResultStatus(materialQuizResponse) : undefined;
|
|
77
76
|
// answer select handler
|
|
78
77
|
var handleAnswerSelect = function handleAnswerSelect(index$1) {
|
|
79
78
|
if (index.checkUserLectureTestEnded(lecture) || !!userId) {
|
|
@@ -225,7 +224,6 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
|
|
|
225
224
|
color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? designTokens.base.color.gray3 : theme.palette.primary.contrastText
|
|
226
225
|
}
|
|
227
226
|
}],
|
|
228
|
-
questionStatus: questionStatus,
|
|
229
227
|
children: jsxRuntime.jsxs(material.Stack, {
|
|
230
228
|
height: "100%",
|
|
231
229
|
gap: "1rem",
|
|
@@ -73,7 +73,6 @@ var MaterialQuizSelectOne = function MaterialQuizSelectOne(_ref) {
|
|
|
73
73
|
setHasSubmitted = _React$useState10[1];
|
|
74
74
|
var isNextActive = hasSubmitted && typeof onNext === 'function';
|
|
75
75
|
var isDisabled = selectedAnswer === undefined || index.checkUserLectureTestEnded(lecture) || !!userId;
|
|
76
|
-
var questionStatus = hasSubmitted ? index.getQuizResultStatus(materialQuizResponse) : undefined;
|
|
77
76
|
// answer select handler
|
|
78
77
|
var handleAnswerSelect = function handleAnswerSelect(index$1) {
|
|
79
78
|
if (index.checkUserLectureTestEnded(lecture) || !!userId) {
|
|
@@ -214,7 +213,6 @@ var MaterialQuizSelectOne = function MaterialQuizSelectOne(_ref) {
|
|
|
214
213
|
color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? designTokens.base.color.gray3 : theme.palette.primary.contrastText
|
|
215
214
|
}
|
|
216
215
|
}],
|
|
217
|
-
questionStatus: questionStatus,
|
|
218
216
|
children: jsxRuntime.jsxs(material.Stack, {
|
|
219
217
|
height: "100%",
|
|
220
218
|
gap: "1rem",
|
|
@@ -71,7 +71,6 @@ var MaterialQuizText = function MaterialQuizText(_ref2) {
|
|
|
71
71
|
setHasSubmitted = _React$useState8[1];
|
|
72
72
|
var isNextActive = hasSubmitted && typeof onNext === 'function';
|
|
73
73
|
var isDisabled = answer.length === 0 || index.checkUserLectureTestEnded(lecture) || !!userId;
|
|
74
|
-
var questionStatus = hasSubmitted ? index.getQuizResultStatus(materialQuizResponse) : undefined;
|
|
75
74
|
// quiz response fetcher
|
|
76
75
|
React__default.default.useEffect(function () {
|
|
77
76
|
if (!userId && (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.lastQuizResponseId)) {
|
|
@@ -213,7 +212,6 @@ var MaterialQuizText = function MaterialQuizText(_ref2) {
|
|
|
213
212
|
color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? designTokens.base.color.gray3 : theme.palette.primary.contrastText
|
|
214
213
|
}
|
|
215
214
|
}],
|
|
216
|
-
questionStatus: questionStatus,
|
|
217
215
|
children: jsxRuntime.jsxs(material.Stack, {
|
|
218
216
|
height: "100%",
|
|
219
217
|
gap: "1rem",
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var messageEn = {"materialQuiz.anchorLabel.question":"Passage","materialQuiz.anchorLabel.answer":"Answer","materialQuiz.error":"Failed to fetch quiz","materialQuiz.submit":"Submit","materialQuiz.resubmit":"Resubmit","materialQuiz.submittedAnswer":"Submitted Answer","materialQuiz.answer":"Answer","materialQuiz.next":"Next question >","materialQuiz.selectOne.answer.title":"Choose from the views below.","materialQuiz.selectMultiple.answer.title":"Choose from the views below. (Redundant selections available)","materialQuiz.selectMultipleOrder.answer.title":"Drag and drop your answers.","materialQuiz.text.answer.title":"Please fill out the answer.","materialQuiz.empty.title":"Quiz is now preparing.","materialQuiz.empty.description":"Please check again after quiz posting!","materialQuiz.survey.empty.title":"Survey is now preparing.","materialQuiz.survey.empty.description":"Please check again after survey posting!","materialQuiz.submitStatus.success":"Submitted","materialQuiz.submitStatus.failure":"Failed to submit","materialQuiz.resultStatus.correct":"Correct","materialQuiz.resultStatus.wrong":"Wrong","materialQuiz.resultStatus.submitted":"Submitted","materialQuiz.explanation.close":"close quiz explanations","materialQuiz.explanation.show":"show quiz explanations","materialQuiz.explanation.empty":"no explanations","materialQuiz.text.placeholder":"please fill the answer","materialQuiz.text.correct":"that's correct!","materialQuiz.text.wrong":"that's wrong. try it again!","materialQuiz.order.answerEmpty":"You could move the options back here","materialQuiz.bottomSheet.title":"Options","materialQuiz.bottomSheet.optionEmpty":"All views have been placed in the group.","materialQuiz.dropzone.desktop.answerEmpty":"Drag the view into the area.","materialQuiz.dropzone.mobile.answerEmpty":"Click here to add a view.","materialQuiz.dropzone.optionEmpty":"Option","materialQuiz.dropzone.optionReset":"Answer Reset"
|
|
5
|
+
var messageEn = {"materialQuiz.anchorLabel.question":"Passage","materialQuiz.anchorLabel.answer":"Answer","materialQuiz.error":"Failed to fetch quiz","materialQuiz.submit":"Submit","materialQuiz.resubmit":"Resubmit","materialQuiz.submittedAnswer":"Submitted Answer","materialQuiz.answer":"Answer","materialQuiz.next":"Next question >","materialQuiz.selectOne.answer.title":"Choose from the views below.","materialQuiz.selectMultiple.answer.title":"Choose from the views below. (Redundant selections available)","materialQuiz.selectMultipleOrder.answer.title":"Drag and drop your answers.","materialQuiz.text.answer.title":"Please fill out the answer.","materialQuiz.empty.title":"Quiz is now preparing.","materialQuiz.empty.description":"Please check again after quiz posting!","materialQuiz.survey.empty.title":"Survey is now preparing.","materialQuiz.survey.empty.description":"Please check again after survey posting!","materialQuiz.submitStatus.success":"Submitted","materialQuiz.submitStatus.failure":"Failed to submit","materialQuiz.resultStatus.correct":"Correct","materialQuiz.resultStatus.wrong":"Wrong","materialQuiz.resultStatus.submitted":"Submitted","materialQuiz.explanation.close":"close quiz explanations","materialQuiz.explanation.show":"show quiz explanations","materialQuiz.explanation.empty":"no explanations","materialQuiz.text.placeholder":"please fill the answer","materialQuiz.text.correct":"that's correct!","materialQuiz.text.wrong":"that's wrong. try it again!","materialQuiz.order.answerEmpty":"You could move the options back here","materialQuiz.bottomSheet.title":"Options","materialQuiz.bottomSheet.optionEmpty":"All views have been placed in the group.","materialQuiz.dropzone.desktop.answerEmpty":"Drag the view into the area.","materialQuiz.dropzone.mobile.answerEmpty":"Click here to add a view.","materialQuiz.dropzone.optionEmpty":"Option","materialQuiz.dropzone.optionReset":"Answer Reset"};
|
|
6
6
|
|
|
7
7
|
exports.default = messageEn;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ja = {"materialQuiz.anchorLabel.question":"文章","materialQuiz.anchorLabel.answer":"回答","materialQuiz.error":"クイズの取得に失敗しました。","materialQuiz.submit":"提出","materialQuiz.resubmit":"再送信","materialQuiz.submittedAnswer":"提出された回答","materialQuiz.answer":"回答","materialQuiz.next":"次の質問 >","materialQuiz.selectOne.answer.title":"以下から選択してください。","materialQuiz.selectMultiple.answer.title":"以下から選択してください。 (冗長な選択肢も利用可能)","materialQuiz.selectMultipleOrder.answer.title":"ドラッグして回答をドロップしてください。","materialQuiz.text.answer.title":"回答を記入してください。","materialQuiz.empty.title":"クイズは今準備中です。","materialQuiz.empty.description":"クイズの投稿後にもう一度確認してください!","materialQuiz.survey.empty.title":"調査は現在準備中です。","materialQuiz.survey.empty.description":"調査投稿後にもう一度ご確認ください!","materialQuiz.submitStatus.success":"提出済","materialQuiz.submitStatus.failure":"提出に失敗しました。","materialQuiz.resultStatus.correct":"正しい","materialQuiz.resultStatus.wrong":"間違った","materialQuiz.resultStatus.submitted":"提出済","materialQuiz.explanation.close":"クイズの説明を閉じる","materialQuiz.explanation.show":"クイズの説明を表示します","materialQuiz.explanation.empty":"いいです。","materialQuiz.text.placeholder":"回答を入力してください","materialQuiz.text.correct":"その通りです!","materialQuiz.text.wrong":"それは間違っています。もう一度やってみてください!","materialQuiz.order.answerEmpty":"オプションをここに戻すことができます。","materialQuiz.bottomSheet.title":"オプション","materialQuiz.bottomSheet.optionEmpty":"すべてのビューがグループに配置されました。","materialQuiz.dropzone.desktop.answerEmpty":"ビューをエリアにドラッグしてください。","materialQuiz.dropzone.mobile.answerEmpty":"ここをクリックしてビューを追加してください。","materialQuiz.dropzone.optionEmpty":"オプション","materialQuiz.dropzone.optionReset":"回答をリセットします"
|
|
5
|
+
var ja = {"materialQuiz.anchorLabel.question":"文章","materialQuiz.anchorLabel.answer":"回答","materialQuiz.error":"クイズの取得に失敗しました。","materialQuiz.submit":"提出","materialQuiz.resubmit":"再送信","materialQuiz.submittedAnswer":"提出された回答","materialQuiz.answer":"回答","materialQuiz.next":"次の質問 >","materialQuiz.selectOne.answer.title":"以下から選択してください。","materialQuiz.selectMultiple.answer.title":"以下から選択してください。 (冗長な選択肢も利用可能)","materialQuiz.selectMultipleOrder.answer.title":"ドラッグして回答をドロップしてください。","materialQuiz.text.answer.title":"回答を記入してください。","materialQuiz.empty.title":"クイズは今準備中です。","materialQuiz.empty.description":"クイズの投稿後にもう一度確認してください!","materialQuiz.survey.empty.title":"調査は現在準備中です。","materialQuiz.survey.empty.description":"調査投稿後にもう一度ご確認ください!","materialQuiz.submitStatus.success":"提出済","materialQuiz.submitStatus.failure":"提出に失敗しました。","materialQuiz.resultStatus.correct":"正しい","materialQuiz.resultStatus.wrong":"間違った","materialQuiz.resultStatus.submitted":"提出済","materialQuiz.explanation.close":"クイズの説明を閉じる","materialQuiz.explanation.show":"クイズの説明を表示します","materialQuiz.explanation.empty":"いいです。","materialQuiz.text.placeholder":"回答を入力してください","materialQuiz.text.correct":"その通りです!","materialQuiz.text.wrong":"それは間違っています。もう一度やってみてください!","materialQuiz.order.answerEmpty":"オプションをここに戻すことができます。","materialQuiz.bottomSheet.title":"オプション","materialQuiz.bottomSheet.optionEmpty":"すべてのビューがグループに配置されました。","materialQuiz.dropzone.desktop.answerEmpty":"ビューをエリアにドラッグしてください。","materialQuiz.dropzone.mobile.answerEmpty":"ここをクリックしてビューを追加してください。","materialQuiz.dropzone.optionEmpty":"オプション","materialQuiz.dropzone.optionReset":"回答をリセットします"};
|
|
6
6
|
|
|
7
7
|
exports.default = ja;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var messageKo = {"materialQuiz.anchorLabel.question":"지문","materialQuiz.anchorLabel.answer":"답안","materialQuiz.error":"퀴즈를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.","materialQuiz.submit":"제출","materialQuiz.resubmit":"다시 제출","materialQuiz.submittedAnswer":"제출한 답","materialQuiz.answer":"정답","materialQuiz.next":"다음 문제로 이동 >","materialQuiz.selectOne.answer.title":"아래 보기에서 골라주세요.","materialQuiz.selectMultiple.answer.title":"아래 보기에서 골라주세요. (중복 선택 가능)","materialQuiz.selectMultipleOrder.answer.title":"답안을 드래그 앤 드롭하세요.","materialQuiz.text.answer.title":"답안을 작성해 주세요.","materialQuiz.empty.title":"퀴즈가 준비 중 입니다.","materialQuiz.empty.description":"퀴즈 게시 후 다시 확인해주세요!","materialQuiz.survey.empty.title":"설문조사 준비 중 입니다.","materialQuiz.survey.empty.description":"설문지 게시 후 다시 확인해주세요!","materialQuiz.submitStatus.success":"제출되었습니다.","materialQuiz.submitStatus.failure":"제출에 실패하였습니다.","materialQuiz.resultStatus.correct":"정답","materialQuiz.resultStatus.wrong":"오답","materialQuiz.resultStatus.submitted":"제출완료","materialQuiz.explanation.close":"퀴즈해설 닫기","materialQuiz.explanation.show":"퀴즈 해설 보기","materialQuiz.explanation.empty":"작성된 해설이 없습니다.","materialQuiz.text.placeholder":"답안을 작성해 주세요.","materialQuiz.text.correct":"정답입니다.","materialQuiz.text.wrong":"오답입니다. 다시 답안을 제출해보세요.","materialQuiz.order.answerEmpty":"항목을 다시 이곳으로 옮길 수 있습니다.","materialQuiz.bottomSheet.title":"보기","materialQuiz.bottomSheet.optionEmpty":"모든 보기를 그룹에 배치하였습니다.","materialQuiz.dropzone.desktop.answerEmpty":"보기를 영역에 끌어 넣어주세요.","materialQuiz.dropzone.mobile.answerEmpty":"이곳을 클릭하여 보기를 넣어주세요.","materialQuiz.dropzone.optionEmpty":"보기","materialQuiz.dropzone.optionReset":"답안 초기화"
|
|
5
|
+
var messageKo = {"materialQuiz.anchorLabel.question":"지문","materialQuiz.anchorLabel.answer":"답안","materialQuiz.error":"퀴즈를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.","materialQuiz.submit":"제출","materialQuiz.resubmit":"다시 제출","materialQuiz.submittedAnswer":"제출한 답","materialQuiz.answer":"정답","materialQuiz.next":"다음 문제로 이동 >","materialQuiz.selectOne.answer.title":"아래 보기에서 골라주세요.","materialQuiz.selectMultiple.answer.title":"아래 보기에서 골라주세요. (중복 선택 가능)","materialQuiz.selectMultipleOrder.answer.title":"답안을 드래그 앤 드롭하세요.","materialQuiz.text.answer.title":"답안을 작성해 주세요.","materialQuiz.empty.title":"퀴즈가 준비 중 입니다.","materialQuiz.empty.description":"퀴즈 게시 후 다시 확인해주세요!","materialQuiz.survey.empty.title":"설문조사 준비 중 입니다.","materialQuiz.survey.empty.description":"설문지 게시 후 다시 확인해주세요!","materialQuiz.submitStatus.success":"제출되었습니다.","materialQuiz.submitStatus.failure":"제출에 실패하였습니다.","materialQuiz.resultStatus.correct":"정답","materialQuiz.resultStatus.wrong":"오답","materialQuiz.resultStatus.submitted":"제출완료","materialQuiz.explanation.close":"퀴즈해설 닫기","materialQuiz.explanation.show":"퀴즈 해설 보기","materialQuiz.explanation.empty":"작성된 해설이 없습니다.","materialQuiz.text.placeholder":"답안을 작성해 주세요.","materialQuiz.text.correct":"정답입니다.","materialQuiz.text.wrong":"오답입니다. 다시 답안을 제출해보세요.","materialQuiz.order.answerEmpty":"항목을 다시 이곳으로 옮길 수 있습니다.","materialQuiz.bottomSheet.title":"보기","materialQuiz.bottomSheet.optionEmpty":"모든 보기를 그룹에 배치하였습니다.","materialQuiz.dropzone.desktop.answerEmpty":"보기를 영역에 끌어 넣어주세요.","materialQuiz.dropzone.mobile.answerEmpty":"이곳을 클릭하여 보기를 넣어주세요.","materialQuiz.dropzone.optionEmpty":"보기","materialQuiz.dropzone.optionReset":"답안 초기화"};
|
|
6
6
|
|
|
7
7
|
exports.default = messageKo;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var th = {"materialQuiz.anchorLabel.question":"ทางเดิน","materialQuiz.anchorLabel.answer":"ดคำตอบ","materialQuiz.error":"ไม่สามารถดึงควิซได้","materialQuiz.submit":"ส่งใบสมัคร","materialQuiz.resubmit":"ส่งอีกครั้ง","materialQuiz.submittedAnswer":"ฉันสามารถตอบคำถามเช่นนี้ได้","materialQuiz.answer":"ตอบ","materialQuiz.next":"คำถามถัดไป >","materialQuiz.selectOne.answer.title":"เลือกจากมุมมองด้านล่างนี้","materialQuiz.selectMultiple.answer.title":"เลือกจากรายการด้านล่าง (มีการเลือกที่ซ้ำซ้อน)","materialQuiz.selectMultipleOrder.answer.title":"ลากและวางคำตอบของคุณ","materialQuiz.text.answer.title":"กรุณากรอกคำตอบ","materialQuiz.empty.title":"ควิซกำลังเตรียมอยู่ตอนนี้","materialQuiz.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์ควิซ!","materialQuiz.survey.empty.title":"การสำรวจกำลังเตรียมการอยู่ค่ะ","materialQuiz.survey.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์แบบสำรวจ!","materialQuiz.submitStatus.success":"เสนอ","materialQuiz.submitStatus.failure":"การส่งล้มเหลว","materialQuiz.resultStatus.correct":"ถูกต้อง","materialQuiz.resultStatus.wrong":"ผิด","materialQuiz.resultStatus.submitted":"เสนอ","materialQuiz.explanation.close":"ปิดคำอธิบายควิซ","materialQuiz.explanation.show":"แสดงคำอธิบายของควิซ","materialQuiz.explanation.empty":"ไม่ให้อธิบาย","materialQuiz.text.placeholder":"กรุณากรอกคำตอบ","materialQuiz.text.correct":"ถูกต้อง!","materialQuiz.text.wrong":"นั่นผิด ลองอีกครั้ง!","materialQuiz.order.answerEmpty":"คุณสามารถย้ายตัวเลือกกลับมาที่นี่ได้","materialQuiz.bottomSheet.title":"ตัวเลือก","materialQuiz.bottomSheet.optionEmpty":"ทุกมุมมองได้ถูกวางไว้ในกลุ่มแล้ว","materialQuiz.dropzone.desktop.answerEmpty":"ลากมุมมองเข้าสู่พื้นที่","materialQuiz.dropzone.mobile.answerEmpty":"คลิกที่นี่เพื่อเพิ่มมุมมอง","materialQuiz.dropzone.optionEmpty":"ตัวเลือก","materialQuiz.dropzone.optionReset":"รีเซ็ตคำตอบ"
|
|
5
|
+
var th = {"materialQuiz.anchorLabel.question":"ทางเดิน","materialQuiz.anchorLabel.answer":"ดคำตอบ","materialQuiz.error":"ไม่สามารถดึงควิซได้","materialQuiz.submit":"ส่งใบสมัคร","materialQuiz.resubmit":"ส่งอีกครั้ง","materialQuiz.submittedAnswer":"ฉันสามารถตอบคำถามเช่นนี้ได้","materialQuiz.answer":"ตอบ","materialQuiz.next":"คำถามถัดไป >","materialQuiz.selectOne.answer.title":"เลือกจากมุมมองด้านล่างนี้","materialQuiz.selectMultiple.answer.title":"เลือกจากรายการด้านล่าง (มีการเลือกที่ซ้ำซ้อน)","materialQuiz.selectMultipleOrder.answer.title":"ลากและวางคำตอบของคุณ","materialQuiz.text.answer.title":"กรุณากรอกคำตอบ","materialQuiz.empty.title":"ควิซกำลังเตรียมอยู่ตอนนี้","materialQuiz.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์ควิซ!","materialQuiz.survey.empty.title":"การสำรวจกำลังเตรียมการอยู่ค่ะ","materialQuiz.survey.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์แบบสำรวจ!","materialQuiz.submitStatus.success":"เสนอ","materialQuiz.submitStatus.failure":"การส่งล้มเหลว","materialQuiz.resultStatus.correct":"ถูกต้อง","materialQuiz.resultStatus.wrong":"ผิด","materialQuiz.resultStatus.submitted":"เสนอ","materialQuiz.explanation.close":"ปิดคำอธิบายควิซ","materialQuiz.explanation.show":"แสดงคำอธิบายของควิซ","materialQuiz.explanation.empty":"ไม่ให้อธิบาย","materialQuiz.text.placeholder":"กรุณากรอกคำตอบ","materialQuiz.text.correct":"ถูกต้อง!","materialQuiz.text.wrong":"นั่นผิด ลองอีกครั้ง!","materialQuiz.order.answerEmpty":"คุณสามารถย้ายตัวเลือกกลับมาที่นี่ได้","materialQuiz.bottomSheet.title":"ตัวเลือก","materialQuiz.bottomSheet.optionEmpty":"ทุกมุมมองได้ถูกวางไว้ในกลุ่มแล้ว","materialQuiz.dropzone.desktop.answerEmpty":"ลากมุมมองเข้าสู่พื้นที่","materialQuiz.dropzone.mobile.answerEmpty":"คลิกที่นี่เพื่อเพิ่มมุมมอง","materialQuiz.dropzone.optionEmpty":"ตัวเลือก","materialQuiz.dropzone.optionReset":"รีเซ็ตคำตอบ"};
|
|
6
6
|
|
|
7
7
|
exports.default = th;
|
|
@@ -8,6 +8,7 @@ var designTokens = require('@elice/design-tokens');
|
|
|
8
8
|
var icons = require('@elice/icons');
|
|
9
9
|
var markdown = require('@elice/markdown');
|
|
10
10
|
var styled = require('styled-components');
|
|
11
|
+
var index = require('../../../helpers/index.js');
|
|
11
12
|
var EbDraggable = require('../../eb-sortable/EbDraggable.js');
|
|
12
13
|
var MaterialQuizContext = require('../context/MaterialQuizContext.js');
|
|
13
14
|
|
|
@@ -84,7 +85,7 @@ var MaterialQuizGroupOptionItem = function MaterialQuizGroupOptionItem(_ref7) {
|
|
|
84
85
|
children: [isOptionContent ? jsxRuntime.jsx(StyledOptionContent, {
|
|
85
86
|
vertical: vertical,
|
|
86
87
|
children: jsxRuntime.jsx(markdown.MarkdownSSR, {
|
|
87
|
-
children: (_a = option.options
|
|
88
|
+
children: (_a = index.addAltTextToImage(option.options)) !== null && _a !== void 0 ? _a : '',
|
|
88
89
|
paddingx: 0,
|
|
89
90
|
paddingy: 0,
|
|
90
91
|
dark: true
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QuizResultStatus } from '../../helpers';
|
|
3
2
|
import type { ButtonProps } from '@elice/blocks';
|
|
4
3
|
import type { UseMeasureRef } from 'react-use/lib/useMeasure';
|
|
5
4
|
interface QuestionBoxProps {
|
|
@@ -11,7 +10,6 @@ interface QuestionBoxProps {
|
|
|
11
10
|
onNext?: () => void;
|
|
12
11
|
isNextActive?: boolean;
|
|
13
12
|
bodyContainerRef?: UseMeasureRef<HTMLDivElement>;
|
|
14
|
-
questionStatus?: QuizResultStatus;
|
|
15
13
|
}
|
|
16
14
|
export declare const StyledQuestionBox: import("styled-components").StyledComponent<"div", any, {
|
|
17
15
|
vertical: boolean;
|
|
@@ -14,7 +14,6 @@ var material = require('@mui/material');
|
|
|
14
14
|
var animateScrollTo = require('animated-scroll-to');
|
|
15
15
|
var styled = require('styled-components');
|
|
16
16
|
var element = require('../../constant/element.js');
|
|
17
|
-
var index = require('../../helpers/index.js');
|
|
18
17
|
var MaterialQuizContext = require('../material-quiz/context/MaterialQuizContext.js');
|
|
19
18
|
var mergeRefs = require('./utils/mergeRefs.js');
|
|
20
19
|
|
|
@@ -84,8 +83,7 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
84
83
|
var onNext = _a.onNext,
|
|
85
84
|
isNextActive = _a.isNextActive,
|
|
86
85
|
bodyContainerRef = _a.bodyContainerRef,
|
|
87
|
-
|
|
88
|
-
props = tslib.__rest(_a, ["children", "footerActions", "title", "titlePrefix", "submitResult", "submitStatus", "onNext", "isNextActive", "bodyContainerRef", "questionStatus"]);
|
|
86
|
+
props = tslib.__rest(_a, ["children", "footerActions", "title", "titlePrefix", "submitResult", "submitStatus", "onNext", "isNextActive", "bodyContainerRef"]);
|
|
89
87
|
var theme = material.useTheme();
|
|
90
88
|
var intl$1 = intl.useRawEliceIntl();
|
|
91
89
|
var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
|
|
@@ -94,7 +92,6 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
94
92
|
var intersectionRef = React__default.default.useRef(null);
|
|
95
93
|
var headerRef = React__default.default.useRef(null);
|
|
96
94
|
var bodyRef = React__default.default.useRef(null);
|
|
97
|
-
var questionFeedbackRef = React__default.default.useRef(null);
|
|
98
95
|
var currentBodyRef = mergeRefs.mergeRefs(bodyContainerRef, bodyRef);
|
|
99
96
|
var hasFooter = footerActions.length > 0;
|
|
100
97
|
var visibleAnchorSection = vertical && isLongPassage;
|
|
@@ -104,19 +101,6 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
104
101
|
threshold: 0.1
|
|
105
102
|
});
|
|
106
103
|
var isViewingAnswerContainer = Boolean(intersection === null || intersection === void 0 ? void 0 : intersection.isIntersecting);
|
|
107
|
-
React.useEffect(function () {
|
|
108
|
-
var content = '';
|
|
109
|
-
if (questionStatus === index.QuizResultStatus.Correct) {
|
|
110
|
-
content = intl$1.formatMessage({
|
|
111
|
-
id: 'materialQuiz.a11y.correct-answer'
|
|
112
|
-
});
|
|
113
|
-
} else if (questionStatus === index.QuizResultStatus.Wrong) {
|
|
114
|
-
content = intl$1.formatMessage({
|
|
115
|
-
id: 'materialQuiz.a11y.incorrect-answer'
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
questionFeedbackRef.current && (questionFeedbackRef.current.textContent = content);
|
|
119
|
-
}, [questionStatus, intl$1]);
|
|
120
104
|
React.useEffect(function () {
|
|
121
105
|
var answerContainer = document.getElementById(element.MATERIAL_QUIZ_ANSWER_ID);
|
|
122
106
|
// only enable for vertical mode
|
|
@@ -262,17 +246,7 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
262
246
|
};
|
|
263
247
|
return jsxRuntime.jsxs(StyledQuestionBox, Object.assign({}, props, {
|
|
264
248
|
vertical: vertical,
|
|
265
|
-
children: [header, renderContent(), _renderAnchorSection()
|
|
266
|
-
ref: questionFeedbackRef,
|
|
267
|
-
"aria-live": "polite",
|
|
268
|
-
style: {
|
|
269
|
-
position: 'absolute',
|
|
270
|
-
margin: '-1px',
|
|
271
|
-
width: '1px',
|
|
272
|
-
height: '1px',
|
|
273
|
-
overflow: 'hidden'
|
|
274
|
-
}
|
|
275
|
-
})]
|
|
249
|
+
children: [header, renderContent(), _renderAnchorSection()]
|
|
276
250
|
}));
|
|
277
251
|
};
|
|
278
252
|
|
package/cjs/helpers/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GetOrgLectureGetResponses, GetOrgMaterialQuizResponseGetResponses } from '@elice/types';
|
|
2
2
|
import type { QuizOptionType } from '@elice/types/es/enums';
|
|
3
|
+
import type { QuizGroupOption } from "../components/material-quiz/material-quiz-group/context/context";
|
|
3
4
|
interface OptionInfo {
|
|
4
5
|
content: string;
|
|
5
6
|
optionType: QuizOptionType;
|
|
@@ -46,4 +47,5 @@ export declare function shouldResetOptions({ materialQuizResponse, }: {
|
|
|
46
47
|
materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse'];
|
|
47
48
|
}): boolean;
|
|
48
49
|
export declare function getQuizResult(materialQuizResponse: GetOrgMaterialQuizResponseGetResponses['quizResponse']): boolean | undefined;
|
|
50
|
+
export declare const addAltTextToImage: ({ content, title, }: QuizGroupOption['options']) => string | undefined;
|
|
49
51
|
export {};
|
package/cjs/helpers/index.js
CHANGED
|
@@ -62,7 +62,17 @@ function getQuizResult(materialQuizResponse) {
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
var addAltTextToImage = function addAltTextToImage(_ref3) {
|
|
66
|
+
var content = _ref3.content,
|
|
67
|
+
title = _ref3.title;
|
|
68
|
+
if (!title) return content;
|
|
69
|
+
// Match the pattern 
|
|
70
|
+
var regex = /!\[]\((.*?)\)/;
|
|
71
|
+
// Replace with the alt text inside the []
|
|
72
|
+
return content === null || content === void 0 ? void 0 : content.replace(regex, ""));
|
|
73
|
+
};
|
|
65
74
|
|
|
75
|
+
exports.addAltTextToImage = addAltTextToImage;
|
|
66
76
|
exports.checkUserLectureTestEnded = checkUserLectureTestEnded;
|
|
67
77
|
exports.getOptionStatus = getOptionStatus;
|
|
68
78
|
exports.getQuizResult = getQuizResult;
|
|
@@ -6,7 +6,7 @@ import { base } from '@elice/design-tokens';
|
|
|
6
6
|
import { useRawEliceIntl } from '@elice/intl';
|
|
7
7
|
import { useTheme, Stack } from '@mui/material';
|
|
8
8
|
import { MATERIAL_QUIZ_PASSIVE_ID, MATERIAL_QUIZ_ANSWER_ID } from '../../constant/element.js';
|
|
9
|
-
import { checkUserLectureTestEnded,
|
|
9
|
+
import { checkUserLectureTestEnded, shouldResetOptions, getOptionStatus, getQuizResult } from '../../helpers/index.js';
|
|
10
10
|
import { useCaculatePassage } from '../../hooks/useCaculatePassage.js';
|
|
11
11
|
import '../shared/QuizDraggbleDroppedOption.js';
|
|
12
12
|
import '../shared/QuizDraggbleDummyOption.js';
|
|
@@ -65,7 +65,6 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
|
|
|
65
65
|
setHasSubmitted = _React$useState10[1];
|
|
66
66
|
var isNextActive = hasSubmitted && typeof onNext === 'function';
|
|
67
67
|
var isDisabled = selectedAnswer.length === 0 || checkUserLectureTestEnded(lecture) || !!userId;
|
|
68
|
-
var questionStatus = hasSubmitted ? getQuizResultStatus(materialQuizResponse) : undefined;
|
|
69
68
|
// answer select handler
|
|
70
69
|
var handleAnswerSelect = function handleAnswerSelect(index) {
|
|
71
70
|
if (checkUserLectureTestEnded(lecture) || !!userId) {
|
|
@@ -217,7 +216,6 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
|
|
|
217
216
|
color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? base.color.gray3 : theme.palette.primary.contrastText
|
|
218
217
|
}
|
|
219
218
|
}],
|
|
220
|
-
questionStatus: questionStatus,
|
|
221
219
|
children: jsxs(Stack, {
|
|
222
220
|
height: "100%",
|
|
223
221
|
gap: "1rem",
|
|
@@ -6,7 +6,7 @@ import { base } from '@elice/design-tokens';
|
|
|
6
6
|
import { useRawEliceIntl } from '@elice/intl';
|
|
7
7
|
import { useTheme, Stack } from '@mui/material';
|
|
8
8
|
import { MATERIAL_QUIZ_PASSIVE_ID, MATERIAL_QUIZ_ANSWER_ID } from '../../constant/element.js';
|
|
9
|
-
import { checkUserLectureTestEnded,
|
|
9
|
+
import { checkUserLectureTestEnded, getOptionStatus, getQuizResult } from '../../helpers/index.js';
|
|
10
10
|
import { useCaculatePassage } from '../../hooks/useCaculatePassage.js';
|
|
11
11
|
import '../shared/QuizDraggbleDroppedOption.js';
|
|
12
12
|
import '../shared/QuizDraggbleDummyOption.js';
|
|
@@ -65,7 +65,6 @@ var MaterialQuizSelectOne = function MaterialQuizSelectOne(_ref) {
|
|
|
65
65
|
setHasSubmitted = _React$useState10[1];
|
|
66
66
|
var isNextActive = hasSubmitted && typeof onNext === 'function';
|
|
67
67
|
var isDisabled = selectedAnswer === undefined || checkUserLectureTestEnded(lecture) || !!userId;
|
|
68
|
-
var questionStatus = hasSubmitted ? getQuizResultStatus(materialQuizResponse) : undefined;
|
|
69
68
|
// answer select handler
|
|
70
69
|
var handleAnswerSelect = function handleAnswerSelect(index) {
|
|
71
70
|
if (checkUserLectureTestEnded(lecture) || !!userId) {
|
|
@@ -206,7 +205,6 @@ var MaterialQuizSelectOne = function MaterialQuizSelectOne(_ref) {
|
|
|
206
205
|
color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? base.color.gray3 : theme.palette.primary.contrastText
|
|
207
206
|
}
|
|
208
207
|
}],
|
|
209
|
-
questionStatus: questionStatus,
|
|
210
208
|
children: jsxs(Stack, {
|
|
211
209
|
height: "100%",
|
|
212
210
|
gap: "1rem",
|
|
@@ -8,7 +8,7 @@ import { useRawEliceIntl } from '@elice/intl';
|
|
|
8
8
|
import { useTheme, Stack } from '@mui/material';
|
|
9
9
|
import styled from 'styled-components';
|
|
10
10
|
import { MATERIAL_QUIZ_PASSIVE_ID, MATERIAL_QUIZ_ANSWER_ID } from '../../constant/element.js';
|
|
11
|
-
import { checkUserLectureTestEnded,
|
|
11
|
+
import { checkUserLectureTestEnded, getQuizResult } from '../../helpers/index.js';
|
|
12
12
|
import { useCaculatePassage } from '../../hooks/useCaculatePassage.js';
|
|
13
13
|
import QuestionBox from '../shared/QuestionBox.js';
|
|
14
14
|
import { useMaterialQuizState, useMaterialQuizDispatch } from './context/MaterialQuizContext.js';
|
|
@@ -62,7 +62,6 @@ var MaterialQuizText = function MaterialQuizText(_ref2) {
|
|
|
62
62
|
setHasSubmitted = _React$useState8[1];
|
|
63
63
|
var isNextActive = hasSubmitted && typeof onNext === 'function';
|
|
64
64
|
var isDisabled = answer.length === 0 || checkUserLectureTestEnded(lecture) || !!userId;
|
|
65
|
-
var questionStatus = hasSubmitted ? getQuizResultStatus(materialQuizResponse) : undefined;
|
|
66
65
|
// quiz response fetcher
|
|
67
66
|
React.useEffect(function () {
|
|
68
67
|
if (!userId && (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.lastQuizResponseId)) {
|
|
@@ -204,7 +203,6 @@ var MaterialQuizText = function MaterialQuizText(_ref2) {
|
|
|
204
203
|
color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? base.color.gray3 : theme.palette.primary.contrastText
|
|
205
204
|
}
|
|
206
205
|
}],
|
|
207
|
-
questionStatus: questionStatus,
|
|
208
206
|
children: jsxs(Stack, {
|
|
209
207
|
height: "100%",
|
|
210
208
|
gap: "1rem",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var messageEn = {"materialQuiz.anchorLabel.question":"Passage","materialQuiz.anchorLabel.answer":"Answer","materialQuiz.error":"Failed to fetch quiz","materialQuiz.submit":"Submit","materialQuiz.resubmit":"Resubmit","materialQuiz.submittedAnswer":"Submitted Answer","materialQuiz.answer":"Answer","materialQuiz.next":"Next question >","materialQuiz.selectOne.answer.title":"Choose from the views below.","materialQuiz.selectMultiple.answer.title":"Choose from the views below. (Redundant selections available)","materialQuiz.selectMultipleOrder.answer.title":"Drag and drop your answers.","materialQuiz.text.answer.title":"Please fill out the answer.","materialQuiz.empty.title":"Quiz is now preparing.","materialQuiz.empty.description":"Please check again after quiz posting!","materialQuiz.survey.empty.title":"Survey is now preparing.","materialQuiz.survey.empty.description":"Please check again after survey posting!","materialQuiz.submitStatus.success":"Submitted","materialQuiz.submitStatus.failure":"Failed to submit","materialQuiz.resultStatus.correct":"Correct","materialQuiz.resultStatus.wrong":"Wrong","materialQuiz.resultStatus.submitted":"Submitted","materialQuiz.explanation.close":"close quiz explanations","materialQuiz.explanation.show":"show quiz explanations","materialQuiz.explanation.empty":"no explanations","materialQuiz.text.placeholder":"please fill the answer","materialQuiz.text.correct":"that's correct!","materialQuiz.text.wrong":"that's wrong. try it again!","materialQuiz.order.answerEmpty":"You could move the options back here","materialQuiz.bottomSheet.title":"Options","materialQuiz.bottomSheet.optionEmpty":"All views have been placed in the group.","materialQuiz.dropzone.desktop.answerEmpty":"Drag the view into the area.","materialQuiz.dropzone.mobile.answerEmpty":"Click here to add a view.","materialQuiz.dropzone.optionEmpty":"Option","materialQuiz.dropzone.optionReset":"Answer Reset"
|
|
1
|
+
var messageEn = {"materialQuiz.anchorLabel.question":"Passage","materialQuiz.anchorLabel.answer":"Answer","materialQuiz.error":"Failed to fetch quiz","materialQuiz.submit":"Submit","materialQuiz.resubmit":"Resubmit","materialQuiz.submittedAnswer":"Submitted Answer","materialQuiz.answer":"Answer","materialQuiz.next":"Next question >","materialQuiz.selectOne.answer.title":"Choose from the views below.","materialQuiz.selectMultiple.answer.title":"Choose from the views below. (Redundant selections available)","materialQuiz.selectMultipleOrder.answer.title":"Drag and drop your answers.","materialQuiz.text.answer.title":"Please fill out the answer.","materialQuiz.empty.title":"Quiz is now preparing.","materialQuiz.empty.description":"Please check again after quiz posting!","materialQuiz.survey.empty.title":"Survey is now preparing.","materialQuiz.survey.empty.description":"Please check again after survey posting!","materialQuiz.submitStatus.success":"Submitted","materialQuiz.submitStatus.failure":"Failed to submit","materialQuiz.resultStatus.correct":"Correct","materialQuiz.resultStatus.wrong":"Wrong","materialQuiz.resultStatus.submitted":"Submitted","materialQuiz.explanation.close":"close quiz explanations","materialQuiz.explanation.show":"show quiz explanations","materialQuiz.explanation.empty":"no explanations","materialQuiz.text.placeholder":"please fill the answer","materialQuiz.text.correct":"that's correct!","materialQuiz.text.wrong":"that's wrong. try it again!","materialQuiz.order.answerEmpty":"You could move the options back here","materialQuiz.bottomSheet.title":"Options","materialQuiz.bottomSheet.optionEmpty":"All views have been placed in the group.","materialQuiz.dropzone.desktop.answerEmpty":"Drag the view into the area.","materialQuiz.dropzone.mobile.answerEmpty":"Click here to add a view.","materialQuiz.dropzone.optionEmpty":"Option","materialQuiz.dropzone.optionReset":"Answer Reset"};
|
|
2
2
|
|
|
3
3
|
export { messageEn as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var ja = {"materialQuiz.anchorLabel.question":"文章","materialQuiz.anchorLabel.answer":"回答","materialQuiz.error":"クイズの取得に失敗しました。","materialQuiz.submit":"提出","materialQuiz.resubmit":"再送信","materialQuiz.submittedAnswer":"提出された回答","materialQuiz.answer":"回答","materialQuiz.next":"次の質問 >","materialQuiz.selectOne.answer.title":"以下から選択してください。","materialQuiz.selectMultiple.answer.title":"以下から選択してください。 (冗長な選択肢も利用可能)","materialQuiz.selectMultipleOrder.answer.title":"ドラッグして回答をドロップしてください。","materialQuiz.text.answer.title":"回答を記入してください。","materialQuiz.empty.title":"クイズは今準備中です。","materialQuiz.empty.description":"クイズの投稿後にもう一度確認してください!","materialQuiz.survey.empty.title":"調査は現在準備中です。","materialQuiz.survey.empty.description":"調査投稿後にもう一度ご確認ください!","materialQuiz.submitStatus.success":"提出済","materialQuiz.submitStatus.failure":"提出に失敗しました。","materialQuiz.resultStatus.correct":"正しい","materialQuiz.resultStatus.wrong":"間違った","materialQuiz.resultStatus.submitted":"提出済","materialQuiz.explanation.close":"クイズの説明を閉じる","materialQuiz.explanation.show":"クイズの説明を表示します","materialQuiz.explanation.empty":"いいです。","materialQuiz.text.placeholder":"回答を入力してください","materialQuiz.text.correct":"その通りです!","materialQuiz.text.wrong":"それは間違っています。もう一度やってみてください!","materialQuiz.order.answerEmpty":"オプションをここに戻すことができます。","materialQuiz.bottomSheet.title":"オプション","materialQuiz.bottomSheet.optionEmpty":"すべてのビューがグループに配置されました。","materialQuiz.dropzone.desktop.answerEmpty":"ビューをエリアにドラッグしてください。","materialQuiz.dropzone.mobile.answerEmpty":"ここをクリックしてビューを追加してください。","materialQuiz.dropzone.optionEmpty":"オプション","materialQuiz.dropzone.optionReset":"回答をリセットします"
|
|
1
|
+
var ja = {"materialQuiz.anchorLabel.question":"文章","materialQuiz.anchorLabel.answer":"回答","materialQuiz.error":"クイズの取得に失敗しました。","materialQuiz.submit":"提出","materialQuiz.resubmit":"再送信","materialQuiz.submittedAnswer":"提出された回答","materialQuiz.answer":"回答","materialQuiz.next":"次の質問 >","materialQuiz.selectOne.answer.title":"以下から選択してください。","materialQuiz.selectMultiple.answer.title":"以下から選択してください。 (冗長な選択肢も利用可能)","materialQuiz.selectMultipleOrder.answer.title":"ドラッグして回答をドロップしてください。","materialQuiz.text.answer.title":"回答を記入してください。","materialQuiz.empty.title":"クイズは今準備中です。","materialQuiz.empty.description":"クイズの投稿後にもう一度確認してください!","materialQuiz.survey.empty.title":"調査は現在準備中です。","materialQuiz.survey.empty.description":"調査投稿後にもう一度ご確認ください!","materialQuiz.submitStatus.success":"提出済","materialQuiz.submitStatus.failure":"提出に失敗しました。","materialQuiz.resultStatus.correct":"正しい","materialQuiz.resultStatus.wrong":"間違った","materialQuiz.resultStatus.submitted":"提出済","materialQuiz.explanation.close":"クイズの説明を閉じる","materialQuiz.explanation.show":"クイズの説明を表示します","materialQuiz.explanation.empty":"いいです。","materialQuiz.text.placeholder":"回答を入力してください","materialQuiz.text.correct":"その通りです!","materialQuiz.text.wrong":"それは間違っています。もう一度やってみてください!","materialQuiz.order.answerEmpty":"オプションをここに戻すことができます。","materialQuiz.bottomSheet.title":"オプション","materialQuiz.bottomSheet.optionEmpty":"すべてのビューがグループに配置されました。","materialQuiz.dropzone.desktop.answerEmpty":"ビューをエリアにドラッグしてください。","materialQuiz.dropzone.mobile.answerEmpty":"ここをクリックしてビューを追加してください。","materialQuiz.dropzone.optionEmpty":"オプション","materialQuiz.dropzone.optionReset":"回答をリセットします"};
|
|
2
2
|
|
|
3
3
|
export { ja as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var messageKo = {"materialQuiz.anchorLabel.question":"지문","materialQuiz.anchorLabel.answer":"답안","materialQuiz.error":"퀴즈를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.","materialQuiz.submit":"제출","materialQuiz.resubmit":"다시 제출","materialQuiz.submittedAnswer":"제출한 답","materialQuiz.answer":"정답","materialQuiz.next":"다음 문제로 이동 >","materialQuiz.selectOne.answer.title":"아래 보기에서 골라주세요.","materialQuiz.selectMultiple.answer.title":"아래 보기에서 골라주세요. (중복 선택 가능)","materialQuiz.selectMultipleOrder.answer.title":"답안을 드래그 앤 드롭하세요.","materialQuiz.text.answer.title":"답안을 작성해 주세요.","materialQuiz.empty.title":"퀴즈가 준비 중 입니다.","materialQuiz.empty.description":"퀴즈 게시 후 다시 확인해주세요!","materialQuiz.survey.empty.title":"설문조사 준비 중 입니다.","materialQuiz.survey.empty.description":"설문지 게시 후 다시 확인해주세요!","materialQuiz.submitStatus.success":"제출되었습니다.","materialQuiz.submitStatus.failure":"제출에 실패하였습니다.","materialQuiz.resultStatus.correct":"정답","materialQuiz.resultStatus.wrong":"오답","materialQuiz.resultStatus.submitted":"제출완료","materialQuiz.explanation.close":"퀴즈해설 닫기","materialQuiz.explanation.show":"퀴즈 해설 보기","materialQuiz.explanation.empty":"작성된 해설이 없습니다.","materialQuiz.text.placeholder":"답안을 작성해 주세요.","materialQuiz.text.correct":"정답입니다.","materialQuiz.text.wrong":"오답입니다. 다시 답안을 제출해보세요.","materialQuiz.order.answerEmpty":"항목을 다시 이곳으로 옮길 수 있습니다.","materialQuiz.bottomSheet.title":"보기","materialQuiz.bottomSheet.optionEmpty":"모든 보기를 그룹에 배치하였습니다.","materialQuiz.dropzone.desktop.answerEmpty":"보기를 영역에 끌어 넣어주세요.","materialQuiz.dropzone.mobile.answerEmpty":"이곳을 클릭하여 보기를 넣어주세요.","materialQuiz.dropzone.optionEmpty":"보기","materialQuiz.dropzone.optionReset":"답안 초기화"
|
|
1
|
+
var messageKo = {"materialQuiz.anchorLabel.question":"지문","materialQuiz.anchorLabel.answer":"답안","materialQuiz.error":"퀴즈를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.","materialQuiz.submit":"제출","materialQuiz.resubmit":"다시 제출","materialQuiz.submittedAnswer":"제출한 답","materialQuiz.answer":"정답","materialQuiz.next":"다음 문제로 이동 >","materialQuiz.selectOne.answer.title":"아래 보기에서 골라주세요.","materialQuiz.selectMultiple.answer.title":"아래 보기에서 골라주세요. (중복 선택 가능)","materialQuiz.selectMultipleOrder.answer.title":"답안을 드래그 앤 드롭하세요.","materialQuiz.text.answer.title":"답안을 작성해 주세요.","materialQuiz.empty.title":"퀴즈가 준비 중 입니다.","materialQuiz.empty.description":"퀴즈 게시 후 다시 확인해주세요!","materialQuiz.survey.empty.title":"설문조사 준비 중 입니다.","materialQuiz.survey.empty.description":"설문지 게시 후 다시 확인해주세요!","materialQuiz.submitStatus.success":"제출되었습니다.","materialQuiz.submitStatus.failure":"제출에 실패하였습니다.","materialQuiz.resultStatus.correct":"정답","materialQuiz.resultStatus.wrong":"오답","materialQuiz.resultStatus.submitted":"제출완료","materialQuiz.explanation.close":"퀴즈해설 닫기","materialQuiz.explanation.show":"퀴즈 해설 보기","materialQuiz.explanation.empty":"작성된 해설이 없습니다.","materialQuiz.text.placeholder":"답안을 작성해 주세요.","materialQuiz.text.correct":"정답입니다.","materialQuiz.text.wrong":"오답입니다. 다시 답안을 제출해보세요.","materialQuiz.order.answerEmpty":"항목을 다시 이곳으로 옮길 수 있습니다.","materialQuiz.bottomSheet.title":"보기","materialQuiz.bottomSheet.optionEmpty":"모든 보기를 그룹에 배치하였습니다.","materialQuiz.dropzone.desktop.answerEmpty":"보기를 영역에 끌어 넣어주세요.","materialQuiz.dropzone.mobile.answerEmpty":"이곳을 클릭하여 보기를 넣어주세요.","materialQuiz.dropzone.optionEmpty":"보기","materialQuiz.dropzone.optionReset":"답안 초기화"};
|
|
2
2
|
|
|
3
3
|
export { messageKo as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var th = {"materialQuiz.anchorLabel.question":"ทางเดิน","materialQuiz.anchorLabel.answer":"ดคำตอบ","materialQuiz.error":"ไม่สามารถดึงควิซได้","materialQuiz.submit":"ส่งใบสมัคร","materialQuiz.resubmit":"ส่งอีกครั้ง","materialQuiz.submittedAnswer":"ฉันสามารถตอบคำถามเช่นนี้ได้","materialQuiz.answer":"ตอบ","materialQuiz.next":"คำถามถัดไป >","materialQuiz.selectOne.answer.title":"เลือกจากมุมมองด้านล่างนี้","materialQuiz.selectMultiple.answer.title":"เลือกจากรายการด้านล่าง (มีการเลือกที่ซ้ำซ้อน)","materialQuiz.selectMultipleOrder.answer.title":"ลากและวางคำตอบของคุณ","materialQuiz.text.answer.title":"กรุณากรอกคำตอบ","materialQuiz.empty.title":"ควิซกำลังเตรียมอยู่ตอนนี้","materialQuiz.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์ควิซ!","materialQuiz.survey.empty.title":"การสำรวจกำลังเตรียมการอยู่ค่ะ","materialQuiz.survey.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์แบบสำรวจ!","materialQuiz.submitStatus.success":"เสนอ","materialQuiz.submitStatus.failure":"การส่งล้มเหลว","materialQuiz.resultStatus.correct":"ถูกต้อง","materialQuiz.resultStatus.wrong":"ผิด","materialQuiz.resultStatus.submitted":"เสนอ","materialQuiz.explanation.close":"ปิดคำอธิบายควิซ","materialQuiz.explanation.show":"แสดงคำอธิบายของควิซ","materialQuiz.explanation.empty":"ไม่ให้อธิบาย","materialQuiz.text.placeholder":"กรุณากรอกคำตอบ","materialQuiz.text.correct":"ถูกต้อง!","materialQuiz.text.wrong":"นั่นผิด ลองอีกครั้ง!","materialQuiz.order.answerEmpty":"คุณสามารถย้ายตัวเลือกกลับมาที่นี่ได้","materialQuiz.bottomSheet.title":"ตัวเลือก","materialQuiz.bottomSheet.optionEmpty":"ทุกมุมมองได้ถูกวางไว้ในกลุ่มแล้ว","materialQuiz.dropzone.desktop.answerEmpty":"ลากมุมมองเข้าสู่พื้นที่","materialQuiz.dropzone.mobile.answerEmpty":"คลิกที่นี่เพื่อเพิ่มมุมมอง","materialQuiz.dropzone.optionEmpty":"ตัวเลือก","materialQuiz.dropzone.optionReset":"รีเซ็ตคำตอบ"
|
|
1
|
+
var th = {"materialQuiz.anchorLabel.question":"ทางเดิน","materialQuiz.anchorLabel.answer":"ดคำตอบ","materialQuiz.error":"ไม่สามารถดึงควิซได้","materialQuiz.submit":"ส่งใบสมัคร","materialQuiz.resubmit":"ส่งอีกครั้ง","materialQuiz.submittedAnswer":"ฉันสามารถตอบคำถามเช่นนี้ได้","materialQuiz.answer":"ตอบ","materialQuiz.next":"คำถามถัดไป >","materialQuiz.selectOne.answer.title":"เลือกจากมุมมองด้านล่างนี้","materialQuiz.selectMultiple.answer.title":"เลือกจากรายการด้านล่าง (มีการเลือกที่ซ้ำซ้อน)","materialQuiz.selectMultipleOrder.answer.title":"ลากและวางคำตอบของคุณ","materialQuiz.text.answer.title":"กรุณากรอกคำตอบ","materialQuiz.empty.title":"ควิซกำลังเตรียมอยู่ตอนนี้","materialQuiz.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์ควิซ!","materialQuiz.survey.empty.title":"การสำรวจกำลังเตรียมการอยู่ค่ะ","materialQuiz.survey.empty.description":"โปรดตรวจสอบอีกครั้งหลังจากโพสต์แบบสำรวจ!","materialQuiz.submitStatus.success":"เสนอ","materialQuiz.submitStatus.failure":"การส่งล้มเหลว","materialQuiz.resultStatus.correct":"ถูกต้อง","materialQuiz.resultStatus.wrong":"ผิด","materialQuiz.resultStatus.submitted":"เสนอ","materialQuiz.explanation.close":"ปิดคำอธิบายควิซ","materialQuiz.explanation.show":"แสดงคำอธิบายของควิซ","materialQuiz.explanation.empty":"ไม่ให้อธิบาย","materialQuiz.text.placeholder":"กรุณากรอกคำตอบ","materialQuiz.text.correct":"ถูกต้อง!","materialQuiz.text.wrong":"นั่นผิด ลองอีกครั้ง!","materialQuiz.order.answerEmpty":"คุณสามารถย้ายตัวเลือกกลับมาที่นี่ได้","materialQuiz.bottomSheet.title":"ตัวเลือก","materialQuiz.bottomSheet.optionEmpty":"ทุกมุมมองได้ถูกวางไว้ในกลุ่มแล้ว","materialQuiz.dropzone.desktop.answerEmpty":"ลากมุมมองเข้าสู่พื้นที่","materialQuiz.dropzone.mobile.answerEmpty":"คลิกที่นี่เพื่อเพิ่มมุมมอง","materialQuiz.dropzone.optionEmpty":"ตัวเลือก","materialQuiz.dropzone.optionReset":"รีเซ็ตคำตอบ"};
|
|
2
2
|
|
|
3
3
|
export { th as default };
|
|
@@ -4,6 +4,7 @@ import { base } from '@elice/design-tokens';
|
|
|
4
4
|
import { eilMathsignMultiplyBasic } from '@elice/icons';
|
|
5
5
|
import { MarkdownSSR } from '@elice/markdown';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
+
import { addAltTextToImage } from '../../../helpers/index.js';
|
|
7
8
|
import EbDraggable from '../../eb-sortable/EbDraggable.js';
|
|
8
9
|
import { useMaterialQuizState } from '../context/MaterialQuizContext.js';
|
|
9
10
|
|
|
@@ -76,7 +77,7 @@ var MaterialQuizGroupOptionItem = function MaterialQuizGroupOptionItem(_ref7) {
|
|
|
76
77
|
children: [isOptionContent ? jsx(StyledOptionContent, {
|
|
77
78
|
vertical: vertical,
|
|
78
79
|
children: jsx(MarkdownSSR, {
|
|
79
|
-
children: (_a = option.options
|
|
80
|
+
children: (_a = addAltTextToImage(option.options)) !== null && _a !== void 0 ? _a : '',
|
|
80
81
|
paddingx: 0,
|
|
81
82
|
paddingy: 0,
|
|
82
83
|
dark: true
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QuizResultStatus } from '../../helpers';
|
|
3
2
|
import type { ButtonProps } from '@elice/blocks';
|
|
4
3
|
import type { UseMeasureRef } from 'react-use/lib/useMeasure';
|
|
5
4
|
interface QuestionBoxProps {
|
|
@@ -11,7 +10,6 @@ interface QuestionBoxProps {
|
|
|
11
10
|
onNext?: () => void;
|
|
12
11
|
isNextActive?: boolean;
|
|
13
12
|
bodyContainerRef?: UseMeasureRef<HTMLDivElement>;
|
|
14
|
-
questionStatus?: QuizResultStatus;
|
|
15
13
|
}
|
|
16
14
|
export declare const StyledQuestionBox: import("styled-components").StyledComponent<"div", any, {
|
|
17
15
|
vertical: boolean;
|
|
@@ -10,7 +10,6 @@ import { useTheme } from '@mui/material';
|
|
|
10
10
|
import animateScrollTo from 'animated-scroll-to';
|
|
11
11
|
import styled from 'styled-components';
|
|
12
12
|
import { MATERIAL_QUIZ_ANSWER_ID, MATERIAL_QUIZ_PASSIVE_ID } from '../../constant/element.js';
|
|
13
|
-
import { QuizResultStatus } from '../../helpers/index.js';
|
|
14
13
|
import { useMaterialQuizState } from '../material-quiz/context/MaterialQuizContext.js';
|
|
15
14
|
import { mergeRefs } from './utils/mergeRefs.js';
|
|
16
15
|
|
|
@@ -74,8 +73,7 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
74
73
|
var onNext = _a.onNext,
|
|
75
74
|
isNextActive = _a.isNextActive,
|
|
76
75
|
bodyContainerRef = _a.bodyContainerRef,
|
|
77
|
-
|
|
78
|
-
props = __rest(_a, ["children", "footerActions", "title", "titlePrefix", "submitResult", "submitStatus", "onNext", "isNextActive", "bodyContainerRef", "questionStatus"]);
|
|
76
|
+
props = __rest(_a, ["children", "footerActions", "title", "titlePrefix", "submitResult", "submitStatus", "onNext", "isNextActive", "bodyContainerRef"]);
|
|
79
77
|
var theme = useTheme();
|
|
80
78
|
var intl = useRawEliceIntl();
|
|
81
79
|
var _useMaterialQuizState = useMaterialQuizState(),
|
|
@@ -84,7 +82,6 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
84
82
|
var intersectionRef = React.useRef(null);
|
|
85
83
|
var headerRef = React.useRef(null);
|
|
86
84
|
var bodyRef = React.useRef(null);
|
|
87
|
-
var questionFeedbackRef = React.useRef(null);
|
|
88
85
|
var currentBodyRef = mergeRefs(bodyContainerRef, bodyRef);
|
|
89
86
|
var hasFooter = footerActions.length > 0;
|
|
90
87
|
var visibleAnchorSection = vertical && isLongPassage;
|
|
@@ -94,19 +91,6 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
94
91
|
threshold: 0.1
|
|
95
92
|
});
|
|
96
93
|
var isViewingAnswerContainer = Boolean(intersection === null || intersection === void 0 ? void 0 : intersection.isIntersecting);
|
|
97
|
-
useEffect(function () {
|
|
98
|
-
var content = '';
|
|
99
|
-
if (questionStatus === QuizResultStatus.Correct) {
|
|
100
|
-
content = intl.formatMessage({
|
|
101
|
-
id: 'materialQuiz.a11y.correct-answer'
|
|
102
|
-
});
|
|
103
|
-
} else if (questionStatus === QuizResultStatus.Wrong) {
|
|
104
|
-
content = intl.formatMessage({
|
|
105
|
-
id: 'materialQuiz.a11y.incorrect-answer'
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
questionFeedbackRef.current && (questionFeedbackRef.current.textContent = content);
|
|
109
|
-
}, [questionStatus, intl]);
|
|
110
94
|
useEffect(function () {
|
|
111
95
|
var answerContainer = document.getElementById(MATERIAL_QUIZ_ANSWER_ID);
|
|
112
96
|
// only enable for vertical mode
|
|
@@ -252,17 +236,7 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
252
236
|
};
|
|
253
237
|
return jsxs(StyledQuestionBox, Object.assign({}, props, {
|
|
254
238
|
vertical: vertical,
|
|
255
|
-
children: [header, renderContent(), _renderAnchorSection()
|
|
256
|
-
ref: questionFeedbackRef,
|
|
257
|
-
"aria-live": "polite",
|
|
258
|
-
style: {
|
|
259
|
-
position: 'absolute',
|
|
260
|
-
margin: '-1px',
|
|
261
|
-
width: '1px',
|
|
262
|
-
height: '1px',
|
|
263
|
-
overflow: 'hidden'
|
|
264
|
-
}
|
|
265
|
-
})]
|
|
239
|
+
children: [header, renderContent(), _renderAnchorSection()]
|
|
266
240
|
}));
|
|
267
241
|
};
|
|
268
242
|
|
package/es/helpers/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { GetOrgLectureGetResponses, GetOrgMaterialQuizResponseGetResponses } from '@elice/types';
|
|
2
2
|
import type { QuizOptionType } from '@elice/types/es/enums';
|
|
3
|
+
import type { QuizGroupOption } from "../components/material-quiz/material-quiz-group/context/context";
|
|
3
4
|
interface OptionInfo {
|
|
4
5
|
content: string;
|
|
5
6
|
optionType: QuizOptionType;
|
|
@@ -46,4 +47,5 @@ export declare function shouldResetOptions({ materialQuizResponse, }: {
|
|
|
46
47
|
materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse'];
|
|
47
48
|
}): boolean;
|
|
48
49
|
export declare function getQuizResult(materialQuizResponse: GetOrgMaterialQuizResponseGetResponses['quizResponse']): boolean | undefined;
|
|
50
|
+
export declare const addAltTextToImage: ({ content, title, }: QuizGroupOption['options']) => string | undefined;
|
|
49
51
|
export {};
|
package/es/helpers/index.js
CHANGED
|
@@ -60,5 +60,14 @@ function getQuizResult(materialQuizResponse) {
|
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
var addAltTextToImage = function addAltTextToImage(_ref3) {
|
|
64
|
+
var content = _ref3.content,
|
|
65
|
+
title = _ref3.title;
|
|
66
|
+
if (!title) return content;
|
|
67
|
+
// Match the pattern 
|
|
68
|
+
var regex = /!\[]\((.*?)\)/;
|
|
69
|
+
// Replace with the alt text inside the []
|
|
70
|
+
return content === null || content === void 0 ? void 0 : content.replace(regex, ""));
|
|
71
|
+
};
|
|
63
72
|
|
|
64
|
-
export { QuizResultStatus, checkUserLectureTestEnded, getOptionStatus, getQuizResult, getQuizResultStatus, shouldResetOptions };
|
|
73
|
+
export { QuizResultStatus, addAltTextToImage, checkUserLectureTestEnded, getOptionStatus, getQuizResult, getQuizResultStatus, shouldResetOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-quiz",
|
|
3
|
-
"version": "1.240802.0
|
|
3
|
+
"version": "1.240802.0",
|
|
4
4
|
"description": "User view and editing components of Elice material quiz",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
|
|
67
67
|
"@elice/intl": "0.240425.0-rc.2",
|
|
68
68
|
"@elice/markdown": "^1.240124.0",
|
|
69
|
-
"@elice/material-shared-types": "1.240802.0
|
|
70
|
-
"@elice/material-shared-utils": "1.240802.0
|
|
69
|
+
"@elice/material-shared-types": "1.240802.0",
|
|
70
|
+
"@elice/material-shared-utils": "1.240802.0",
|
|
71
71
|
"@elice/mui-system": "^5.240108.1",
|
|
72
72
|
"@elice/types": "1.240709.0",
|
|
73
73
|
"@elice/wysiwyg": "1.240716.1",
|