@elice/material-quiz 1.240912.1 → 1.241004.0-aidt.2
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/MaterialQuiz.js +3 -1
- package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +1 -0
- package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +1 -1
- package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +2 -1
- package/cjs/components/material-quiz/locales/th.json.js +1 -1
- package/cjs/components/material-quiz-edit/locales/th.json.js +1 -1
- package/cjs/components/shared/QuestionBox.js +14 -6
- package/cjs/components/shared/StyledMarkdown.js +1 -1
- package/cjs/helpers/index.d.ts +3 -1
- package/cjs/helpers/index.js +18 -0
- package/cjs/hooks/useCaculatePassage.js +7 -9
- package/es/components/material-quiz/MaterialQuiz.js +3 -1
- package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +1 -0
- package/es/components/material-quiz/MaterialQuizSelectMultiple.js +2 -2
- package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +3 -2
- package/es/components/material-quiz/locales/th.json.js +1 -1
- package/es/components/material-quiz-edit/locales/th.json.js +1 -1
- package/es/components/shared/QuestionBox.js +15 -7
- package/es/components/shared/StyledMarkdown.js +1 -1
- package/es/helpers/index.d.ts +3 -1
- package/es/helpers/index.js +17 -1
- package/es/hooks/useCaculatePassage.js +7 -9
- package/package.json +6 -5
|
@@ -106,7 +106,9 @@ var MaterialQuiz = function MaterialQuiz() {
|
|
|
106
106
|
var isRenderQuestionWithPassage = (vertical || !isLongPassage || isQuizGroupType) && !!materialQuiz;
|
|
107
107
|
React__default.default.useEffect(function () {
|
|
108
108
|
if (debouncedWidth > 0) {
|
|
109
|
-
|
|
109
|
+
// Make always vertical false for horizontal layout
|
|
110
|
+
// ref: https://elicer.atlassian.net/browse/LXP-4406
|
|
111
|
+
setVertical(false);
|
|
110
112
|
}
|
|
111
113
|
}, [debouncedWidth, setVertical]);
|
|
112
114
|
var renderQuestionOption = function renderQuestionOption() {
|
|
@@ -35,6 +35,7 @@ var MaterialQuizAnswerExplanation = function MaterialQuizAnswerExplanation() {
|
|
|
35
35
|
margintop: "1rem",
|
|
36
36
|
children: jsxRuntime.jsx(StyledAccordion, {
|
|
37
37
|
dark: true,
|
|
38
|
+
defaultExpanded: true,
|
|
38
39
|
header: jsxRuntime.jsx(blocks.Text, {
|
|
39
40
|
bold: true,
|
|
40
41
|
role: "navy0",
|
|
@@ -249,7 +249,7 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
|
|
|
249
249
|
var materialQuizResponseAnswer = materialQuizResponse.answer;
|
|
250
250
|
return (_a = materialQuizResponseAnswer.includes(index)) !== null && _a !== void 0 ? _a : false;
|
|
251
251
|
};
|
|
252
|
-
var status = index.getOptionStatus({
|
|
252
|
+
var status = index.getQuizSelectMultipleOptionResultStatus(index$1, materialQuiz) || index.getOptionStatus({
|
|
253
253
|
materialQuizResponse: materialQuizResponse,
|
|
254
254
|
isSelected: getIsSelected(index$1, materialQuizResponse),
|
|
255
255
|
isActive: isActive
|
|
@@ -505,10 +505,11 @@ var MaterialQuizSelectMultipleOrder = function MaterialQuizSelectMultipleOrder(_
|
|
|
505
505
|
return jsxRuntime.jsx(StyledQuizAnswersDropZone, {
|
|
506
506
|
children: answerList.map(function (option, index$1) {
|
|
507
507
|
var getRole = function getRole() {
|
|
508
|
+
var _a;
|
|
508
509
|
if (isActive) {
|
|
509
510
|
return 'default';
|
|
510
511
|
}
|
|
511
|
-
var status = index.getQuizResultStatus(materialQuizResponse);
|
|
512
|
+
var status = (_a = index.getQuizSelectMultipleOrderOptionResultStatus(index$1, materialQuiz, materialQuizResponse)) !== null && _a !== void 0 ? _a : index.getQuizResultStatus(materialQuizResponse);
|
|
512
513
|
switch (status) {
|
|
513
514
|
case index.QuizResultStatus.Correct:
|
|
514
515
|
return 'correct';
|
|
@@ -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":"
|
|
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;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var th = {"common.option":"ตัวเลือก {number}","common.group":"กลุ่ม {group}","common.errorMessage.range":"
|
|
5
|
+
var th = {"common.option":"ตัวเลือก {number}","common.group":"กลุ่ม {group}","common.errorMessage.range":"กรุณากรอกภายใน {min} ~ {max} ตัวอักษร","content.title":"คำถาม","content.title.errorMessage.required":"กรุณากรอกคำถาม","content.title.placeholder":"กรุณากรอกคำถามสำหรับปัญหานี้ค่ะ","content.description.title":"คำอธิบายของปัญหา","content.description.placeholder":"กรุณากรอกคำอธิบายปัญหาอย่างละเอียดพร้อมโค้ดหรือรูปภาพ เป็นต้น","content.option.title":"ตอบ","content.option.tooltip.disabled":"การแก้ไขไม่สามารถทำได้ถ้าควิซเป็นสาธารณะหรือถ้ามีนักเรียนที่ส่งปัญหาไปแล้ว {_termPathRoleStudent} คุณสามารถตรวจสอบปัญหาที่กำหนดค่าไว้ในแท็บ {_termLibraryLecturePage} ของผู้เรียนทางซ้ายได้เลย","content.option.select.items.selectOne":"การเลือกคำตอบหลายตัวเลือก (เลือกได้เพียงหนึ่งคำตอบ)","content.option.select.items.selectMultiple":"ตัวเลือกหลายตัวเลือก (ตอบได้หลายตัวเลือก)","content.option.select.items.selectMultipleOrder":"ลากและวาง","content.option.select.items.text":"อาการที่เป็นเรื่องส่วนบุคคล","content.option.optionsSetEnabled.label":"สับเปลี่ยนลำดับคำตอบ","content.option.optionsSetEnabled.tooltip":"เมื่อเปิดใช้งานคุณลักษณะนี้ ลำดับของคำตอบจะถูกสลับสลายสำหรับแต่ละ {_termPathRoleStudent}","content.option.alert.randomized.title":"การสับเปลี่ยนลำดับของคำตอบถูกเปิดใช้งาน","content.option.alert.randomized.description":"{_termPathRoleStudent} จะเห็นการเรียงลำดับของคำตอบของพวกเขาที่สลับกัน","content.option.select.items.group":"ลากและวาง (ประเภทกลุ่ม)","content.option.statusText.dragNDrop":"หลังจากป้อนตัวเลือกเสร็จ ให้คลิกตามลำดับของคำตอบที่ถูกต้อง\nคุณสามารถเช็คปัญหาที่กำหนดค่าไว้ได้ในแท็บ {_termLibraryLecturePage} ทางซ้าย","content.option.statusText.dragNDropGroup":"คุณสามารถตรวจสอบปัญหาที่กำหนดค่าไว้ในแท็บ {_termLibraryLecturePage} ของผู้เรียนทางด้านซ้ายได้","content.option.errorMessage.required":"โปรดเลือกคำตอบ","content.answerHint.title":"ระบุข้อความในช่องข้อมูลที่แสดงคำใบ้","content.answerHint.description":"คุณสามารถระบุข้อความใบ้สำหรับช่องป้อนที่จะใส่คำตอบได้","content.answerHint.placeholder":"ป้อนข้อความในช่องใส่ข้อมูล","content.explanationInfo.title":"เขียนอธิบาย","content.explanationInfo.description":"คำอธิบายนี้จะปรากฏหลังจากปัญหาได้รับการแก้ไขแล้ว","content.explanationInfo.checkbox.label":"ใช้","content.explanationInfo.textarea.placeholder":"กรุณาใส่คำอธิบาย","content.explanationInfo.textarea.errorMessage.required":"โปรดเขียนคำอธิบายเกี่ยวกับปัญหา","option.common.select.errorMessage.required":"กรุณากรอกตัวเลือก","option.common.select.placeholder":"ป้อนตัวเลือก","option.common.select.tooltip.minOptionInfoItem":"คุณต้องป้อนตัวเลือกอย่างน้อย 2 ตัวเลือก","option.common.select.tooltip.maxOptionInfoItem":"คุณไม่สามารถป้อนตัวเลือกได้มากกว่า 20 ตัวเลือก","option.common.select.addButton":"เพิ่มตัวเลือก","option.text.answerInfo.errorMessage.required":"กรุณากรอกคำตอบที่ถูกต้อง","option.text.answerInfo.hintText":"คำตอบจะถูกให้คะแนนโดยใช้ regular expressions หากคำตอบที่ถูกต้องรวมถึง meta-characters (^[]$()|*+?{}.\\) โปรดเติมเครื่องหมาย backslash (\\) ไว้ข้างหน้า","option.text.isAutoGrade.checkbox.label":"การให้คะแนนโดยการตรวจสอบโดยไม่ระบุคำตอบ","group.option.title":"กลุ่ม","group.option.addButton":"เพิ่มกลุ่ม","group.option.errorMessage.required":"กรุณาใส่ชื่อกลุ่ม","group.option.errorMessage.notChild":"มีกลุ่มที่ถูกสร้างขึ้นแล้ว ซึ่งไม่ได้อยู่ในตัวเลือกใดๆ ","group.option.tooltip.minDisabled":"คุณต้องกำหนดค่าอย่างน้อย 2 กลุ่ม","group.option.tooltip.maxDisabled":"คุณสามารถกำหนดค่ากลุ่มได้สูงสุด 6 กลุ่ม","answer.option.errorMessage":"ต้องมีตัวเลือกหรือค่าไฟล์","answer.option.title.text":"ตัวเลือก","answer.option.title.file":"ไฟล์","answer.option.title.group":"กลุ่มที่ตัวเลือกเป็นส่วนหนึ่งของ","answer.option.addButton":"เพิ่มตัวเลือก","answer.option.file.label":"อัพโหลดไฟล์","answer.option.file.description.imageSize":"อัตราส่วนที่แนะนำสำหรับไฟล์คือ 1:1 (185 x 185px)","answer.option.file.description.fileSize":"คุณสามารถอัพโหลดไฟล์ได้สูงสุด 3MB","answer.option.file.description.extension":"รองรับสกุลไฟล์ .mp3, .mp4, .mov, .png, .jpg, .svg และ .gif","answer.option.file.errorMessage.maxSize":"คุณสามารถอัพโหลดได้สูงสุด {size}MB.","answer.option.default.group":"ไม่มี","answer.option.tooltip.minDisabled":"คุณต้องกำหนดค่าอย่างน้อย 2 ตัวเลือก","answer.option.tooltip.maxDisabled":"คุณสามารถกำหนดค่าตั้งค่าได้สูงสุด 20 ตัวเลือก"};
|
|
6
6
|
|
|
7
7
|
exports.default = th;
|
|
@@ -10,6 +10,7 @@ var reactUse = require('react-use');
|
|
|
10
10
|
var blocks = require('@elice/blocks');
|
|
11
11
|
var designTokens = require('@elice/design-tokens');
|
|
12
12
|
var intl = require('@elice/intl');
|
|
13
|
+
var markdown = require('@elice/markdown');
|
|
13
14
|
var material = require('@mui/material');
|
|
14
15
|
var animateScrollTo = require('animated-scroll-to');
|
|
15
16
|
var styled = require('styled-components');
|
|
@@ -72,7 +73,11 @@ var StyledQuestionBoxFooterActions = styled__default.default.div.withConfig({
|
|
|
72
73
|
var StyledPrimaryButton = styled__default.default(blocks.Button).withConfig({
|
|
73
74
|
componentId: "sc-6qfyxj-6"
|
|
74
75
|
})(["background-color:", ";border-color:", ";"], designTokens.base.color.primary6, designTokens.base.color.primary6);
|
|
76
|
+
var StyledMarkdownTypography = styled__default.default(markdown.MarkdownTypography).withConfig({
|
|
77
|
+
componentId: "sc-6qfyxj-7"
|
|
78
|
+
})(["p{margin:0 !important;padding:0 !important;}"]);
|
|
75
79
|
var QuestionBox = function QuestionBox(_a) {
|
|
80
|
+
var _b;
|
|
76
81
|
var children = _a.children,
|
|
77
82
|
_a$footerActions = _a.footerActions,
|
|
78
83
|
footerActions = _a$footerActions === void 0 ? [] : _a$footerActions,
|
|
@@ -89,7 +94,8 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
89
94
|
var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
|
|
90
95
|
vertical = _useMaterialQuizState.vertical,
|
|
91
96
|
isLongPassage = _useMaterialQuizState.isLongPassage,
|
|
92
|
-
isRecommendLecture = _useMaterialQuizState.isRecommendLecture
|
|
97
|
+
isRecommendLecture = _useMaterialQuizState.isRecommendLecture,
|
|
98
|
+
course = _useMaterialQuizState.course;
|
|
93
99
|
var intersectionRef = React__default.default.useRef(null);
|
|
94
100
|
var headerRef = React__default.default.useRef(null);
|
|
95
101
|
var bodyRef = React__default.default.useRef(null);
|
|
@@ -148,11 +154,13 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
148
154
|
marginRight: '0.5rem'
|
|
149
155
|
},
|
|
150
156
|
children: titlePrefix
|
|
151
|
-
}) : null, jsxRuntime.jsx(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
}) : null, ((_b = course === null || course === void 0 ? void 0 : course.preference) === null || _b === void 0 ? void 0 : _b.renderMarkdownInQuizOptions) ? jsxRuntime.jsx(StyledMarkdownTypography, {
|
|
158
|
+
color: "text.primary",
|
|
159
|
+
variant: "subtitle2",
|
|
160
|
+
children: title
|
|
161
|
+
}) : jsxRuntime.jsx(material.Typography, {
|
|
162
|
+
color: "text.primary",
|
|
163
|
+
variant: "subtitle2",
|
|
156
164
|
children: title
|
|
157
165
|
})]
|
|
158
166
|
})
|
|
@@ -11,6 +11,6 @@ var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
|
11
11
|
|
|
12
12
|
var StyledMarkdown = styled__default.default(markdown.Markdown).withConfig({
|
|
13
13
|
componentId: "sc-l6r531-0"
|
|
14
|
-
})(["& > .elicemd{overflow:hidden;}p{margin:0 !important;}code{white-space:pre-wrap;word-break:break-all;}"]);
|
|
14
|
+
})(["& > .elicemd{overflow:hidden;}p{margin:0 !important;display:flex;align-items:center;}code{white-space:pre-wrap;word-break:break-all;}"]);
|
|
15
15
|
|
|
16
16
|
exports.default = StyledMarkdown;
|
package/cjs/helpers/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetOrgLectureGetResponses, GetOrgMaterialQuizResponseGetResponses } from '@elice/types';
|
|
1
|
+
import type { GetOrgLectureGetResponses, GetOrgMaterialQuizGetResponses, GetOrgMaterialQuizResponseGetResponses } from '@elice/types';
|
|
2
2
|
import type { QuizOptionType } from '@elice/types/es/enums';
|
|
3
3
|
import type { QuizGroupOption } from "../components/material-quiz/material-quiz-group/context/context";
|
|
4
4
|
interface OptionInfo {
|
|
@@ -22,6 +22,8 @@ export declare enum QuizResultStatus {
|
|
|
22
22
|
NotSubmitted = 4
|
|
23
23
|
}
|
|
24
24
|
export declare function getQuizResultStatus(materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse']): QuizResultStatus.Correct | QuizResultStatus.Wrong | QuizResultStatus.Submitted | QuizResultStatus.NotSubmitted;
|
|
25
|
+
export declare function getQuizSelectMultipleOrderOptionResultStatus(index: number, materialQuiz?: GetOrgMaterialQuizGetResponses['materialQuiz'], materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse']): QuizResultStatus.Correct | undefined;
|
|
26
|
+
export declare function getQuizSelectMultipleOptionResultStatus(index: number, materialQuiz?: GetOrgMaterialQuizGetResponses['materialQuiz']): "correct" | undefined;
|
|
25
27
|
export declare const getOptionStatus: ({ isSelected, isActive, materialQuizResponse, }: {
|
|
26
28
|
isSelected: boolean;
|
|
27
29
|
isActive: boolean;
|
package/cjs/helpers/index.js
CHANGED
|
@@ -22,6 +22,22 @@ function getQuizResultStatus(materialQuizResponse) {
|
|
|
22
22
|
}
|
|
23
23
|
return exports.QuizResultStatus.NotSubmitted;
|
|
24
24
|
}
|
|
25
|
+
function getQuizSelectMultipleOrderOptionResultStatus(index, materialQuiz, materialQuizResponse) {
|
|
26
|
+
var _a;
|
|
27
|
+
var userAnswer = materialQuizResponse === null || materialQuizResponse === void 0 ? void 0 : materialQuizResponse.answer[index];
|
|
28
|
+
var correctAnswer = (_a = materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.answerInfo) === null || _a === void 0 ? void 0 : _a[index];
|
|
29
|
+
if (userAnswer === correctAnswer) {
|
|
30
|
+
return exports.QuizResultStatus.Correct;
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
function getQuizSelectMultipleOptionResultStatus(index, materialQuiz) {
|
|
35
|
+
var answerInfo = materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.answerInfo;
|
|
36
|
+
if (answerInfo.includes(index)) {
|
|
37
|
+
return 'correct';
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
25
41
|
var getOptionStatus = function getOptionStatus(_ref) {
|
|
26
42
|
var isSelected = _ref.isSelected,
|
|
27
43
|
isActive = _ref.isActive,
|
|
@@ -77,4 +93,6 @@ exports.checkUserLectureTestEnded = checkUserLectureTestEnded;
|
|
|
77
93
|
exports.getOptionStatus = getOptionStatus;
|
|
78
94
|
exports.getQuizResult = getQuizResult;
|
|
79
95
|
exports.getQuizResultStatus = getQuizResultStatus;
|
|
96
|
+
exports.getQuizSelectMultipleOptionResultStatus = getQuizSelectMultipleOptionResultStatus;
|
|
97
|
+
exports.getQuizSelectMultipleOrderOptionResultStatus = getQuizSelectMultipleOrderOptionResultStatus;
|
|
80
98
|
exports.shouldResetOptions = shouldResetOptions;
|
|
@@ -4,7 +4,6 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.j
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactUse = require('react-use');
|
|
6
6
|
var MaterialQuizContext = require('../components/material-quiz/context/MaterialQuizContext.js');
|
|
7
|
-
var element = require('../constant/element.js');
|
|
8
7
|
|
|
9
8
|
var useCaculatePassage = function useCaculatePassage() {
|
|
10
9
|
var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
|
|
@@ -14,18 +13,17 @@ var useCaculatePassage = function useCaculatePassage() {
|
|
|
14
13
|
setIsLongPassage = _useMaterialQuizDispa.setIsLongPassage,
|
|
15
14
|
setIsInitialLoading = _useMaterialQuizDispa.setIsInitialLoading;
|
|
16
15
|
var _useMeasure = reactUse.useMeasure(),
|
|
17
|
-
_useMeasure2 = _rollupPluginBabelHelpers.slicedToArray(_useMeasure,
|
|
18
|
-
questionRef = _useMeasure2[0]
|
|
19
|
-
questionDetailHeight = _useMeasure2[1].height;
|
|
16
|
+
_useMeasure2 = _rollupPluginBabelHelpers.slicedToArray(_useMeasure, 1),
|
|
17
|
+
questionRef = _useMeasure2[0];
|
|
20
18
|
var _useMeasure3 = reactUse.useMeasure(),
|
|
21
19
|
_useMeasure4 = _rollupPluginBabelHelpers.slicedToArray(_useMeasure3, 2),
|
|
22
20
|
containerRef = _useMeasure4[0],
|
|
23
21
|
containerHeight = _useMeasure4[1].height;
|
|
24
22
|
React.useEffect(function () {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setIsLongPassage(
|
|
23
|
+
if (materialQuiz && materialQuiz.questionDescription) {
|
|
24
|
+
// Make always long passage true for horizontal layout
|
|
25
|
+
// ref: https://elicer.atlassian.net/browse/LXP-4406
|
|
26
|
+
setIsLongPassage(true);
|
|
29
27
|
// add timeout for forcing caculate layout and render in the parent
|
|
30
28
|
// finish before turning off loading
|
|
31
29
|
setTimeout(function () {
|
|
@@ -34,7 +32,7 @@ var useCaculatePassage = function useCaculatePassage() {
|
|
|
34
32
|
} else if (materialQuiz && !materialQuiz.questionDescription) {
|
|
35
33
|
setIsInitialLoading(false);
|
|
36
34
|
}
|
|
37
|
-
}, [containerHeight,
|
|
35
|
+
}, [containerHeight, materialQuiz, setIsLongPassage, vertical, setIsInitialLoading]);
|
|
38
36
|
return {
|
|
39
37
|
questionRef: questionRef,
|
|
40
38
|
containerRef: containerRef
|
|
@@ -97,7 +97,9 @@ var MaterialQuiz = function MaterialQuiz() {
|
|
|
97
97
|
var isRenderQuestionWithPassage = (vertical || !isLongPassage || isQuizGroupType) && !!materialQuiz;
|
|
98
98
|
React.useEffect(function () {
|
|
99
99
|
if (debouncedWidth > 0) {
|
|
100
|
-
|
|
100
|
+
// Make always vertical false for horizontal layout
|
|
101
|
+
// ref: https://elicer.atlassian.net/browse/LXP-4406
|
|
102
|
+
setVertical(false);
|
|
101
103
|
}
|
|
102
104
|
}, [debouncedWidth, setVertical]);
|
|
103
105
|
var renderQuestionOption = function renderQuestionOption() {
|
|
@@ -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, shouldResetOptions, getOptionStatus, getQuizResult } from '../../helpers/index.js';
|
|
9
|
+
import { checkUserLectureTestEnded, shouldResetOptions, getQuizSelectMultipleOptionResultStatus, 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';
|
|
@@ -241,7 +241,7 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
|
|
|
241
241
|
var materialQuizResponseAnswer = materialQuizResponse.answer;
|
|
242
242
|
return (_a = materialQuizResponseAnswer.includes(index)) !== null && _a !== void 0 ? _a : false;
|
|
243
243
|
};
|
|
244
|
-
var status = getOptionStatus({
|
|
244
|
+
var status = getQuizSelectMultipleOptionResultStatus(index, materialQuiz) || getOptionStatus({
|
|
245
245
|
materialQuizResponse: materialQuizResponse,
|
|
246
246
|
isSelected: getIsSelected(index, materialQuizResponse),
|
|
247
247
|
isActive: isActive
|
|
@@ -10,7 +10,7 @@ import { useRawEliceIntl } from '@elice/intl';
|
|
|
10
10
|
import { useTheme, Stack } from '@mui/material';
|
|
11
11
|
import styled from 'styled-components';
|
|
12
12
|
import { MATERIAL_QUIZ_PASSIVE_ID, MATERIAL_QUIZ_ANSWER_ID } from '../../constant/element.js';
|
|
13
|
-
import { checkUserLectureTestEnded, getQuizResultStatus, QuizResultStatus, getQuizResult } from '../../helpers/index.js';
|
|
13
|
+
import { checkUserLectureTestEnded, getQuizSelectMultipleOrderOptionResultStatus, getQuizResultStatus, QuizResultStatus, getQuizResult } from '../../helpers/index.js';
|
|
14
14
|
import { useCaculatePassage } from '../../hooks/useCaculatePassage.js';
|
|
15
15
|
import EbDroppable from '../eb-sortable/EbDroppable.js';
|
|
16
16
|
import QuestionBox from '../shared/QuestionBox.js';
|
|
@@ -496,10 +496,11 @@ var MaterialQuizSelectMultipleOrder = function MaterialQuizSelectMultipleOrder(_
|
|
|
496
496
|
return jsx(StyledQuizAnswersDropZone, {
|
|
497
497
|
children: answerList.map(function (option, index) {
|
|
498
498
|
var getRole = function getRole() {
|
|
499
|
+
var _a;
|
|
499
500
|
if (isActive) {
|
|
500
501
|
return 'default';
|
|
501
502
|
}
|
|
502
|
-
var status = getQuizResultStatus(materialQuizResponse);
|
|
503
|
+
var status = (_a = getQuizSelectMultipleOrderOptionResultStatus(index, materialQuiz, materialQuizResponse)) !== null && _a !== void 0 ? _a : getQuizResultStatus(materialQuizResponse);
|
|
503
504
|
switch (status) {
|
|
504
505
|
case QuizResultStatus.Correct:
|
|
505
506
|
return 'correct';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var th = {"materialQuiz.anchorLabel.question":"ทางเดิน","materialQuiz.anchorLabel.answer":"ดคำตอบ","materialQuiz.error":"
|
|
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 };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var th = {"common.option":"ตัวเลือก {number}","common.group":"กลุ่ม {group}","common.errorMessage.range":"
|
|
1
|
+
var th = {"common.option":"ตัวเลือก {number}","common.group":"กลุ่ม {group}","common.errorMessage.range":"กรุณากรอกภายใน {min} ~ {max} ตัวอักษร","content.title":"คำถาม","content.title.errorMessage.required":"กรุณากรอกคำถาม","content.title.placeholder":"กรุณากรอกคำถามสำหรับปัญหานี้ค่ะ","content.description.title":"คำอธิบายของปัญหา","content.description.placeholder":"กรุณากรอกคำอธิบายปัญหาอย่างละเอียดพร้อมโค้ดหรือรูปภาพ เป็นต้น","content.option.title":"ตอบ","content.option.tooltip.disabled":"การแก้ไขไม่สามารถทำได้ถ้าควิซเป็นสาธารณะหรือถ้ามีนักเรียนที่ส่งปัญหาไปแล้ว {_termPathRoleStudent} คุณสามารถตรวจสอบปัญหาที่กำหนดค่าไว้ในแท็บ {_termLibraryLecturePage} ของผู้เรียนทางซ้ายได้เลย","content.option.select.items.selectOne":"การเลือกคำตอบหลายตัวเลือก (เลือกได้เพียงหนึ่งคำตอบ)","content.option.select.items.selectMultiple":"ตัวเลือกหลายตัวเลือก (ตอบได้หลายตัวเลือก)","content.option.select.items.selectMultipleOrder":"ลากและวาง","content.option.select.items.text":"อาการที่เป็นเรื่องส่วนบุคคล","content.option.optionsSetEnabled.label":"สับเปลี่ยนลำดับคำตอบ","content.option.optionsSetEnabled.tooltip":"เมื่อเปิดใช้งานคุณลักษณะนี้ ลำดับของคำตอบจะถูกสลับสลายสำหรับแต่ละ {_termPathRoleStudent}","content.option.alert.randomized.title":"การสับเปลี่ยนลำดับของคำตอบถูกเปิดใช้งาน","content.option.alert.randomized.description":"{_termPathRoleStudent} จะเห็นการเรียงลำดับของคำตอบของพวกเขาที่สลับกัน","content.option.select.items.group":"ลากและวาง (ประเภทกลุ่ม)","content.option.statusText.dragNDrop":"หลังจากป้อนตัวเลือกเสร็จ ให้คลิกตามลำดับของคำตอบที่ถูกต้อง\nคุณสามารถเช็คปัญหาที่กำหนดค่าไว้ได้ในแท็บ {_termLibraryLecturePage} ทางซ้าย","content.option.statusText.dragNDropGroup":"คุณสามารถตรวจสอบปัญหาที่กำหนดค่าไว้ในแท็บ {_termLibraryLecturePage} ของผู้เรียนทางด้านซ้ายได้","content.option.errorMessage.required":"โปรดเลือกคำตอบ","content.answerHint.title":"ระบุข้อความในช่องข้อมูลที่แสดงคำใบ้","content.answerHint.description":"คุณสามารถระบุข้อความใบ้สำหรับช่องป้อนที่จะใส่คำตอบได้","content.answerHint.placeholder":"ป้อนข้อความในช่องใส่ข้อมูล","content.explanationInfo.title":"เขียนอธิบาย","content.explanationInfo.description":"คำอธิบายนี้จะปรากฏหลังจากปัญหาได้รับการแก้ไขแล้ว","content.explanationInfo.checkbox.label":"ใช้","content.explanationInfo.textarea.placeholder":"กรุณาใส่คำอธิบาย","content.explanationInfo.textarea.errorMessage.required":"โปรดเขียนคำอธิบายเกี่ยวกับปัญหา","option.common.select.errorMessage.required":"กรุณากรอกตัวเลือก","option.common.select.placeholder":"ป้อนตัวเลือก","option.common.select.tooltip.minOptionInfoItem":"คุณต้องป้อนตัวเลือกอย่างน้อย 2 ตัวเลือก","option.common.select.tooltip.maxOptionInfoItem":"คุณไม่สามารถป้อนตัวเลือกได้มากกว่า 20 ตัวเลือก","option.common.select.addButton":"เพิ่มตัวเลือก","option.text.answerInfo.errorMessage.required":"กรุณากรอกคำตอบที่ถูกต้อง","option.text.answerInfo.hintText":"คำตอบจะถูกให้คะแนนโดยใช้ regular expressions หากคำตอบที่ถูกต้องรวมถึง meta-characters (^[]$()|*+?{}.\\) โปรดเติมเครื่องหมาย backslash (\\) ไว้ข้างหน้า","option.text.isAutoGrade.checkbox.label":"การให้คะแนนโดยการตรวจสอบโดยไม่ระบุคำตอบ","group.option.title":"กลุ่ม","group.option.addButton":"เพิ่มกลุ่ม","group.option.errorMessage.required":"กรุณาใส่ชื่อกลุ่ม","group.option.errorMessage.notChild":"มีกลุ่มที่ถูกสร้างขึ้นแล้ว ซึ่งไม่ได้อยู่ในตัวเลือกใดๆ ","group.option.tooltip.minDisabled":"คุณต้องกำหนดค่าอย่างน้อย 2 กลุ่ม","group.option.tooltip.maxDisabled":"คุณสามารถกำหนดค่ากลุ่มได้สูงสุด 6 กลุ่ม","answer.option.errorMessage":"ต้องมีตัวเลือกหรือค่าไฟล์","answer.option.title.text":"ตัวเลือก","answer.option.title.file":"ไฟล์","answer.option.title.group":"กลุ่มที่ตัวเลือกเป็นส่วนหนึ่งของ","answer.option.addButton":"เพิ่มตัวเลือก","answer.option.file.label":"อัพโหลดไฟล์","answer.option.file.description.imageSize":"อัตราส่วนที่แนะนำสำหรับไฟล์คือ 1:1 (185 x 185px)","answer.option.file.description.fileSize":"คุณสามารถอัพโหลดไฟล์ได้สูงสุด 3MB","answer.option.file.description.extension":"รองรับสกุลไฟล์ .mp3, .mp4, .mov, .png, .jpg, .svg และ .gif","answer.option.file.errorMessage.maxSize":"คุณสามารถอัพโหลดได้สูงสุด {size}MB.","answer.option.default.group":"ไม่มี","answer.option.tooltip.minDisabled":"คุณต้องกำหนดค่าอย่างน้อย 2 ตัวเลือก","answer.option.tooltip.maxDisabled":"คุณสามารถกำหนดค่าตั้งค่าได้สูงสุด 20 ตัวเลือก"};
|
|
2
2
|
|
|
3
3
|
export { th as default };
|
|
@@ -6,7 +6,8 @@ import { useIntersection } from 'react-use';
|
|
|
6
6
|
import { Button, Flex, Text, Box } from '@elice/blocks';
|
|
7
7
|
import { base } from '@elice/design-tokens';
|
|
8
8
|
import { useRawEliceIntl } from '@elice/intl';
|
|
9
|
-
import {
|
|
9
|
+
import { MarkdownTypography } from '@elice/markdown';
|
|
10
|
+
import { useTheme, Typography } from '@mui/material';
|
|
10
11
|
import animateScrollTo from 'animated-scroll-to';
|
|
11
12
|
import styled from 'styled-components';
|
|
12
13
|
import { MATERIAL_QUIZ_ANSWER_ID, MATERIAL_QUIZ_PASSIVE_ID } from '../../constant/element.js';
|
|
@@ -62,7 +63,11 @@ var StyledQuestionBoxFooterActions = styled.div.withConfig({
|
|
|
62
63
|
var StyledPrimaryButton = styled(Button).withConfig({
|
|
63
64
|
componentId: "sc-6qfyxj-6"
|
|
64
65
|
})(["background-color:", ";border-color:", ";"], base.color.primary6, base.color.primary6);
|
|
66
|
+
var StyledMarkdownTypography = styled(MarkdownTypography).withConfig({
|
|
67
|
+
componentId: "sc-6qfyxj-7"
|
|
68
|
+
})(["p{margin:0 !important;padding:0 !important;}"]);
|
|
65
69
|
var QuestionBox = function QuestionBox(_a) {
|
|
70
|
+
var _b;
|
|
66
71
|
var children = _a.children,
|
|
67
72
|
_a$footerActions = _a.footerActions,
|
|
68
73
|
footerActions = _a$footerActions === void 0 ? [] : _a$footerActions,
|
|
@@ -79,7 +84,8 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
79
84
|
var _useMaterialQuizState = useMaterialQuizState(),
|
|
80
85
|
vertical = _useMaterialQuizState.vertical,
|
|
81
86
|
isLongPassage = _useMaterialQuizState.isLongPassage,
|
|
82
|
-
isRecommendLecture = _useMaterialQuizState.isRecommendLecture
|
|
87
|
+
isRecommendLecture = _useMaterialQuizState.isRecommendLecture,
|
|
88
|
+
course = _useMaterialQuizState.course;
|
|
83
89
|
var intersectionRef = React.useRef(null);
|
|
84
90
|
var headerRef = React.useRef(null);
|
|
85
91
|
var bodyRef = React.useRef(null);
|
|
@@ -138,11 +144,13 @@ var QuestionBox = function QuestionBox(_a) {
|
|
|
138
144
|
marginRight: '0.5rem'
|
|
139
145
|
},
|
|
140
146
|
children: titlePrefix
|
|
141
|
-
}) : null, jsx(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
}) : null, ((_b = course === null || course === void 0 ? void 0 : course.preference) === null || _b === void 0 ? void 0 : _b.renderMarkdownInQuizOptions) ? jsx(StyledMarkdownTypography, {
|
|
148
|
+
color: "text.primary",
|
|
149
|
+
variant: "subtitle2",
|
|
150
|
+
children: title
|
|
151
|
+
}) : jsx(Typography, {
|
|
152
|
+
color: "text.primary",
|
|
153
|
+
variant: "subtitle2",
|
|
146
154
|
children: title
|
|
147
155
|
})]
|
|
148
156
|
})
|
|
@@ -3,6 +3,6 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
var StyledMarkdown = styled(Markdown).withConfig({
|
|
5
5
|
componentId: "sc-l6r531-0"
|
|
6
|
-
})(["& > .elicemd{overflow:hidden;}p{margin:0 !important;}code{white-space:pre-wrap;word-break:break-all;}"]);
|
|
6
|
+
})(["& > .elicemd{overflow:hidden;}p{margin:0 !important;display:flex;align-items:center;}code{white-space:pre-wrap;word-break:break-all;}"]);
|
|
7
7
|
|
|
8
8
|
export { StyledMarkdown as default };
|
package/es/helpers/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetOrgLectureGetResponses, GetOrgMaterialQuizResponseGetResponses } from '@elice/types';
|
|
1
|
+
import type { GetOrgLectureGetResponses, GetOrgMaterialQuizGetResponses, GetOrgMaterialQuizResponseGetResponses } from '@elice/types';
|
|
2
2
|
import type { QuizOptionType } from '@elice/types/es/enums';
|
|
3
3
|
import type { QuizGroupOption } from "../components/material-quiz/material-quiz-group/context/context";
|
|
4
4
|
interface OptionInfo {
|
|
@@ -22,6 +22,8 @@ export declare enum QuizResultStatus {
|
|
|
22
22
|
NotSubmitted = 4
|
|
23
23
|
}
|
|
24
24
|
export declare function getQuizResultStatus(materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse']): QuizResultStatus.Correct | QuizResultStatus.Wrong | QuizResultStatus.Submitted | QuizResultStatus.NotSubmitted;
|
|
25
|
+
export declare function getQuizSelectMultipleOrderOptionResultStatus(index: number, materialQuiz?: GetOrgMaterialQuizGetResponses['materialQuiz'], materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse']): QuizResultStatus.Correct | undefined;
|
|
26
|
+
export declare function getQuizSelectMultipleOptionResultStatus(index: number, materialQuiz?: GetOrgMaterialQuizGetResponses['materialQuiz']): "correct" | undefined;
|
|
25
27
|
export declare const getOptionStatus: ({ isSelected, isActive, materialQuizResponse, }: {
|
|
26
28
|
isSelected: boolean;
|
|
27
29
|
isActive: boolean;
|
package/es/helpers/index.js
CHANGED
|
@@ -20,6 +20,22 @@ function getQuizResultStatus(materialQuizResponse) {
|
|
|
20
20
|
}
|
|
21
21
|
return QuizResultStatus.NotSubmitted;
|
|
22
22
|
}
|
|
23
|
+
function getQuizSelectMultipleOrderOptionResultStatus(index, materialQuiz, materialQuizResponse) {
|
|
24
|
+
var _a;
|
|
25
|
+
var userAnswer = materialQuizResponse === null || materialQuizResponse === void 0 ? void 0 : materialQuizResponse.answer[index];
|
|
26
|
+
var correctAnswer = (_a = materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.answerInfo) === null || _a === void 0 ? void 0 : _a[index];
|
|
27
|
+
if (userAnswer === correctAnswer) {
|
|
28
|
+
return QuizResultStatus.Correct;
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
function getQuizSelectMultipleOptionResultStatus(index, materialQuiz) {
|
|
33
|
+
var answerInfo = materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.answerInfo;
|
|
34
|
+
if (answerInfo.includes(index)) {
|
|
35
|
+
return 'correct';
|
|
36
|
+
}
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
23
39
|
var getOptionStatus = function getOptionStatus(_ref) {
|
|
24
40
|
var isSelected = _ref.isSelected,
|
|
25
41
|
isActive = _ref.isActive,
|
|
@@ -70,4 +86,4 @@ var addAltTextToImage = function addAltTextToImage(_ref3) {
|
|
|
70
86
|
return content === null || content === void 0 ? void 0 : content.replace(regex, ""));
|
|
71
87
|
};
|
|
72
88
|
|
|
73
|
-
export { QuizResultStatus, addAltTextToImage, checkUserLectureTestEnded, getOptionStatus, getQuizResult, getQuizResultStatus, shouldResetOptions };
|
|
89
|
+
export { QuizResultStatus, addAltTextToImage, checkUserLectureTestEnded, getOptionStatus, getQuizResult, getQuizResultStatus, getQuizSelectMultipleOptionResultStatus, getQuizSelectMultipleOrderOptionResultStatus, shouldResetOptions };
|
|
@@ -2,7 +2,6 @@ import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelH
|
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
3
|
import { useMeasure } from 'react-use';
|
|
4
4
|
import { useMaterialQuizState, useMaterialQuizDispatch } from '../components/material-quiz/context/MaterialQuizContext.js';
|
|
5
|
-
import { MATERIAL_QUIZ_CONTAINER_ID } from '../constant/element.js';
|
|
6
5
|
|
|
7
6
|
var useCaculatePassage = function useCaculatePassage() {
|
|
8
7
|
var _useMaterialQuizState = useMaterialQuizState(),
|
|
@@ -12,18 +11,17 @@ var useCaculatePassage = function useCaculatePassage() {
|
|
|
12
11
|
setIsLongPassage = _useMaterialQuizDispa.setIsLongPassage,
|
|
13
12
|
setIsInitialLoading = _useMaterialQuizDispa.setIsInitialLoading;
|
|
14
13
|
var _useMeasure = useMeasure(),
|
|
15
|
-
_useMeasure2 = _slicedToArray(_useMeasure,
|
|
16
|
-
questionRef = _useMeasure2[0]
|
|
17
|
-
questionDetailHeight = _useMeasure2[1].height;
|
|
14
|
+
_useMeasure2 = _slicedToArray(_useMeasure, 1),
|
|
15
|
+
questionRef = _useMeasure2[0];
|
|
18
16
|
var _useMeasure3 = useMeasure(),
|
|
19
17
|
_useMeasure4 = _slicedToArray(_useMeasure3, 2),
|
|
20
18
|
containerRef = _useMeasure4[0],
|
|
21
19
|
containerHeight = _useMeasure4[1].height;
|
|
22
20
|
useEffect(function () {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
setIsLongPassage(
|
|
21
|
+
if (materialQuiz && materialQuiz.questionDescription) {
|
|
22
|
+
// Make always long passage true for horizontal layout
|
|
23
|
+
// ref: https://elicer.atlassian.net/browse/LXP-4406
|
|
24
|
+
setIsLongPassage(true);
|
|
27
25
|
// add timeout for forcing caculate layout and render in the parent
|
|
28
26
|
// finish before turning off loading
|
|
29
27
|
setTimeout(function () {
|
|
@@ -32,7 +30,7 @@ var useCaculatePassage = function useCaculatePassage() {
|
|
|
32
30
|
} else if (materialQuiz && !materialQuiz.questionDescription) {
|
|
33
31
|
setIsInitialLoading(false);
|
|
34
32
|
}
|
|
35
|
-
}, [containerHeight,
|
|
33
|
+
}, [containerHeight, materialQuiz, setIsLongPassage, vertical, setIsInitialLoading]);
|
|
36
34
|
return {
|
|
37
35
|
questionRef: questionRef,
|
|
38
36
|
containerRef: containerRef
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-quiz",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.241004.0-aidt.2",
|
|
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",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"jquery": "^3.6.0",
|
|
56
56
|
"jquery-ui": "^1.13.1",
|
|
57
57
|
"lodash-es": "^4.17.21",
|
|
58
|
+
"marked": "^14.1.2",
|
|
58
59
|
"react-hook-form": "~7.45.4",
|
|
59
60
|
"react-transition-group": "^4.4.0",
|
|
60
61
|
"tslib": "^2.6.1"
|
|
@@ -67,14 +68,14 @@
|
|
|
67
68
|
"@elice/icons": "^1.230814.0",
|
|
68
69
|
"@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
|
|
69
70
|
"@elice/intl": "0.240425.0-rc.2",
|
|
70
|
-
"@elice/markdown": "
|
|
71
|
-
"@elice/material-shared-types": "1.
|
|
72
|
-
"@elice/material-shared-utils": "1.
|
|
71
|
+
"@elice/markdown": "1.241007.0-aidt.0",
|
|
72
|
+
"@elice/material-shared-types": "1.241004.0-aidt.2",
|
|
73
|
+
"@elice/material-shared-utils": "1.241004.0-aidt.2",
|
|
73
74
|
"@elice/mui-elements": "^5.240820.0",
|
|
74
75
|
"@elice/mui-system": "^5.240820.0",
|
|
75
76
|
"@elice/openapi-client-course": "^1.230814.0",
|
|
76
77
|
"@elice/types": "1.240709.0",
|
|
77
|
-
"@elice/wysiwyg": "1.
|
|
78
|
+
"@elice/wysiwyg": "1.241004.0-aidt.0",
|
|
78
79
|
"@emotion/react": "^11.10.5",
|
|
79
80
|
"@emotion/styled": "^11.10.5",
|
|
80
81
|
"@fortawesome/pro-regular-svg-icons": "^6.4.2",
|