@elice/material-quiz 1.250320.0 → 1.250325.0-edit.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/MaterialQuizImage.js +13 -15
- package/cjs/components/material-quiz-edit/options/OptionEditor.js +1 -3
- package/cjs/components/material-quiz-edit/options/option-text/AnswerInfoDefaultController.js +1 -4
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +1 -2
- package/es/components/material-quiz/MaterialQuizImage.js +14 -16
- package/es/components/material-quiz-edit/options/OptionEditor.js +1 -3
- package/es/components/material-quiz-edit/options/option-text/AnswerInfoDefaultController.js +1 -4
- package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +1 -2
- package/package.json +4 -4
|
@@ -235,21 +235,19 @@ var MaterialQuizImage = function MaterialQuizImage(_ref) {
|
|
|
235
235
|
children: intl$1.formatMessage({
|
|
236
236
|
id: "materialQuiz.".concat(userId ? 'submitted' : 'upload', "_file")
|
|
237
237
|
})
|
|
238
|
-
}), jsxRuntime.jsx(fileClient.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
})
|
|
238
|
+
}), jsxRuntime.jsx(fileClient.FileUpload, {
|
|
239
|
+
multiple: false,
|
|
240
|
+
readOnly: Boolean(userId),
|
|
241
|
+
preview: true,
|
|
242
|
+
accept: {
|
|
243
|
+
'application/*': ['.mpg', '.wmv', '.avi', '.mkv', '.wavm', '.jpg', '.jpeg', '.png']
|
|
244
|
+
},
|
|
245
|
+
maxSize: MAX_FILE_SIZE,
|
|
246
|
+
value: uploadResourceId,
|
|
247
|
+
onChange: function onChange(nextResource) {
|
|
248
|
+
var _a;
|
|
249
|
+
setUploadResourceId((_a = nextResource === null || nextResource === void 0 ? void 0 : nextResource.resourceId) !== null && _a !== void 0 ? _a : null);
|
|
250
|
+
}
|
|
253
251
|
})]
|
|
254
252
|
});
|
|
255
253
|
};
|
|
@@ -77,9 +77,7 @@ var OptionEditor = React__default.default.forwardRef(function (_a, ref) {
|
|
|
77
77
|
ref: handleTextAreaApi,
|
|
78
78
|
invalid: invalid,
|
|
79
79
|
readOnly: readOnly,
|
|
80
|
-
resetFocus: props.onBlur
|
|
81
|
-
disabled: readOnly,
|
|
82
|
-
"aria-disabled": props.disabled
|
|
80
|
+
resetFocus: props.onBlur
|
|
83
81
|
})), suffix ? jsxRuntime.jsx("div", {
|
|
84
82
|
className: "".concat(PREFIX, "-adornment suffix"),
|
|
85
83
|
onDragStart: function onDragStart(e) {
|
package/cjs/components/material-quiz-edit/options/option-text/AnswerInfoDefaultController.js
CHANGED
|
@@ -6,7 +6,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var reactHookForm = require('react-hook-form');
|
|
7
7
|
var intl = require('@elice/intl');
|
|
8
8
|
var material = require('@mui/material');
|
|
9
|
-
var context = require('../../context.js');
|
|
10
9
|
|
|
11
10
|
//
|
|
12
11
|
//
|
|
@@ -22,8 +21,6 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
|
|
|
22
21
|
//
|
|
23
22
|
var intl$1 = intl.useRawEliceIntl();
|
|
24
23
|
//
|
|
25
|
-
var _useMaterialQuizEditC = context.useMaterialQuizEditContext(),
|
|
26
|
-
disabled = _useMaterialQuizEditC.disabled;
|
|
27
24
|
var _useFormContext = reactHookForm.useFormContext(),
|
|
28
25
|
control = _useFormContext.control;
|
|
29
26
|
//
|
|
@@ -75,7 +72,7 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
|
|
|
75
72
|
max: MAX_TEXT_LENGTH
|
|
76
73
|
}
|
|
77
74
|
},
|
|
78
|
-
disabled: !watchedIsAutoGrade
|
|
75
|
+
disabled: !watchedIsAutoGrade,
|
|
79
76
|
error: fieldState.invalid,
|
|
80
77
|
helperText: ((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || ((_b = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _b === void 0 ? void 0 : _b.helperText),
|
|
81
78
|
placeholder: ((_c = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _c === void 0 ? void 0 : _c.placeholder) || intl$1.formatMessage({
|
|
@@ -81,8 +81,7 @@ var OptionGroupGroupListItem = function OptionGroupGroupListItem(_ref2) {
|
|
|
81
81
|
fieldState = _ref3.fieldState;
|
|
82
82
|
return jsxRuntime.jsx(StyledInputGroup, Object.assign({
|
|
83
83
|
invalid: fieldState.invalid || !isGroupChildAnswer,
|
|
84
|
-
width: "full"
|
|
85
|
-
disabled: disabled
|
|
84
|
+
width: "full"
|
|
86
85
|
}, field, {
|
|
87
86
|
ref: null
|
|
88
87
|
}));
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { useMount } from 'react-use';
|
|
5
5
|
import { getOrgMaterialQuizResponseGet, getOrgMaterialQuizResponseList, postOrgMaterialQuizResponseAdd } from '@elice/api-client';
|
|
6
6
|
import { base } from '@elice/design-tokens';
|
|
7
|
-
import {
|
|
7
|
+
import { FileUpload } from '@elice/file-client';
|
|
8
8
|
import { useRawEliceIntl } from '@elice/intl';
|
|
9
9
|
import { useTheme, Stack, FormLabel } from '@mui/material';
|
|
10
10
|
import { useQueryClient, useQuery } from '@tanstack/react-query';
|
|
@@ -227,21 +227,19 @@ var MaterialQuizImage = function MaterialQuizImage(_ref) {
|
|
|
227
227
|
children: intl.formatMessage({
|
|
228
228
|
id: "materialQuiz.".concat(userId ? 'submitted' : 'upload', "_file")
|
|
229
229
|
})
|
|
230
|
-
}), jsx(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
})
|
|
230
|
+
}), jsx(FileUpload, {
|
|
231
|
+
multiple: false,
|
|
232
|
+
readOnly: Boolean(userId),
|
|
233
|
+
preview: true,
|
|
234
|
+
accept: {
|
|
235
|
+
'application/*': ['.mpg', '.wmv', '.avi', '.mkv', '.wavm', '.jpg', '.jpeg', '.png']
|
|
236
|
+
},
|
|
237
|
+
maxSize: MAX_FILE_SIZE,
|
|
238
|
+
value: uploadResourceId,
|
|
239
|
+
onChange: function onChange(nextResource) {
|
|
240
|
+
var _a;
|
|
241
|
+
setUploadResourceId((_a = nextResource === null || nextResource === void 0 ? void 0 : nextResource.resourceId) !== null && _a !== void 0 ? _a : null);
|
|
242
|
+
}
|
|
245
243
|
})]
|
|
246
244
|
});
|
|
247
245
|
};
|
|
@@ -67,9 +67,7 @@ var OptionEditor = React.forwardRef(function (_a, ref) {
|
|
|
67
67
|
ref: handleTextAreaApi,
|
|
68
68
|
invalid: invalid,
|
|
69
69
|
readOnly: readOnly,
|
|
70
|
-
resetFocus: props.onBlur
|
|
71
|
-
disabled: readOnly,
|
|
72
|
-
"aria-disabled": props.disabled
|
|
70
|
+
resetFocus: props.onBlur
|
|
73
71
|
})), suffix ? jsx("div", {
|
|
74
72
|
className: "".concat(PREFIX, "-adornment suffix"),
|
|
75
73
|
onDragStart: function onDragStart(e) {
|
|
@@ -2,7 +2,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useFormContext, useWatch, Controller } from 'react-hook-form';
|
|
3
3
|
import { useRawEliceIntl } from '@elice/intl';
|
|
4
4
|
import { TextField } from '@mui/material';
|
|
5
|
-
import { useMaterialQuizEditContext } from '../../context.js';
|
|
6
5
|
|
|
7
6
|
//
|
|
8
7
|
//
|
|
@@ -18,8 +17,6 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
|
|
|
18
17
|
//
|
|
19
18
|
var intl = useRawEliceIntl();
|
|
20
19
|
//
|
|
21
|
-
var _useMaterialQuizEditC = useMaterialQuizEditContext(),
|
|
22
|
-
disabled = _useMaterialQuizEditC.disabled;
|
|
23
20
|
var _useFormContext = useFormContext(),
|
|
24
21
|
control = _useFormContext.control;
|
|
25
22
|
//
|
|
@@ -71,7 +68,7 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
|
|
|
71
68
|
max: MAX_TEXT_LENGTH
|
|
72
69
|
}
|
|
73
70
|
},
|
|
74
|
-
disabled: !watchedIsAutoGrade
|
|
71
|
+
disabled: !watchedIsAutoGrade,
|
|
75
72
|
error: fieldState.invalid,
|
|
76
73
|
helperText: ((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || ((_b = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _b === void 0 ? void 0 : _b.helperText),
|
|
77
74
|
placeholder: ((_c = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _c === void 0 ? void 0 : _c.placeholder) || intl.formatMessage({
|
|
@@ -72,8 +72,7 @@ var OptionGroupGroupListItem = function OptionGroupGroupListItem(_ref2) {
|
|
|
72
72
|
fieldState = _ref3.fieldState;
|
|
73
73
|
return jsx(StyledInputGroup, Object.assign({
|
|
74
74
|
invalid: fieldState.invalid || !isGroupChildAnswer,
|
|
75
|
-
width: "full"
|
|
76
|
-
disabled: disabled
|
|
75
|
+
width: "full"
|
|
77
76
|
}, field, {
|
|
78
77
|
ref: null
|
|
79
78
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-quiz",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.250325.0-edit.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",
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
"@elice/api-client": "^1.241220.0",
|
|
72
72
|
"@elice/blocks": "1.241007.0",
|
|
73
73
|
"@elice/design-tokens": "^1.220803.0",
|
|
74
|
-
"@elice/file-client": "^1.
|
|
74
|
+
"@elice/file-client": "^1.250307.0",
|
|
75
75
|
"@elice/icons": "^1.230814.0",
|
|
76
76
|
"@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
|
|
77
77
|
"@elice/intl": "0.241127.0",
|
|
78
78
|
"@elice/markdown": "1.241015.0",
|
|
79
|
-
"@elice/material-shared-types": "1.
|
|
80
|
-
"@elice/material-shared-utils": "1.
|
|
79
|
+
"@elice/material-shared-types": "1.250325.0-edit.0",
|
|
80
|
+
"@elice/material-shared-utils": "1.250325.0-edit.0",
|
|
81
81
|
"@elice/mui-elements": "^5.250108.0-controllabel.0",
|
|
82
82
|
"@elice/mui-system": "^5.250108.0-controllabel.0",
|
|
83
83
|
"@elice/openapi-client-course": "^1.241220.0",
|