@elice/material-quiz 1.240805.0 → 1.240806.0-pdf.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.
@@ -172,6 +172,7 @@ var MaterialQuizText = function MaterialQuizText(_ref2) {
172
172
  };
173
173
  }();
174
174
  var commonProps = {
175
+ type: 'text',
175
176
  autoFocus: answer.length === 0,
176
177
  disabled: submitStatus === 'pending' || index.checkUserLectureTestEnded(lecture) || !!userId,
177
178
  placeholder: (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.answerHint) || intl$1.formatMessage({
@@ -8,7 +8,6 @@ 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');
12
11
  var EbDraggable = require('../../eb-sortable/EbDraggable.js');
13
12
  var MaterialQuizContext = require('../context/MaterialQuizContext.js');
14
13
 
@@ -85,7 +84,7 @@ var MaterialQuizGroupOptionItem = function MaterialQuizGroupOptionItem(_ref7) {
85
84
  children: [isOptionContent ? jsxRuntime.jsx(StyledOptionContent, {
86
85
  vertical: vertical,
87
86
  children: jsxRuntime.jsx(markdown.MarkdownSSR, {
88
- children: (_a = index.addAltTextToImage(option.options)) !== null && _a !== void 0 ? _a : '',
87
+ children: (_a = option.options.content) !== null && _a !== void 0 ? _a : '',
89
88
  paddingx: 0,
90
89
  paddingy: 0,
91
90
  dark: true
@@ -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
+ })(["p{margin:0 !important;}code{white-space:pre-wrap;word-break:break-all;}"]);
15
15
 
16
16
  exports.default = StyledMarkdown;
@@ -94,6 +94,7 @@ var QuestionRadioOption = React__default.default.memo(function (_ref6) {
94
94
  children: [jsxRuntime.jsx(StyledQuestionRadioInput, {
95
95
  id: value,
96
96
  type: "radio",
97
+ readOnly: true,
97
98
  checked: selectedValue === value,
98
99
  status: status
99
100
  }), jsxRuntime.jsx(StyledLabel, {
@@ -1,6 +1,5 @@
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";
4
3
  interface OptionInfo {
5
4
  content: string;
6
5
  optionType: QuizOptionType;
@@ -47,5 +46,4 @@ export declare function shouldResetOptions({ materialQuizResponse, }: {
47
46
  materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse'];
48
47
  }): boolean;
49
48
  export declare function getQuizResult(materialQuizResponse: GetOrgMaterialQuizResponseGetResponses['quizResponse']): boolean | undefined;
50
- export declare const addAltTextToImage: ({ content, title, }: QuizGroupOption['options']) => string | undefined;
51
49
  export {};
@@ -62,17 +62,7 @@ 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 ![](<url>)
70
- var regex = /!\[]\((.*?)\)/;
71
- // Replace with the alt text inside the []
72
- return content === null || content === void 0 ? void 0 : content.replace(regex, "![".concat(title, "]($1)"));
73
- };
74
65
 
75
- exports.addAltTextToImage = addAltTextToImage;
76
66
  exports.checkUserLectureTestEnded = checkUserLectureTestEnded;
77
67
  exports.getOptionStatus = getOptionStatus;
78
68
  exports.getQuizResult = getQuizResult;
@@ -163,6 +163,7 @@ var MaterialQuizText = function MaterialQuizText(_ref2) {
163
163
  };
164
164
  }();
165
165
  var commonProps = {
166
+ type: 'text',
166
167
  autoFocus: answer.length === 0,
167
168
  disabled: submitStatus === 'pending' || checkUserLectureTestEnded(lecture) || !!userId,
168
169
  placeholder: (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.answerHint) || intl.formatMessage({
@@ -4,7 +4,6 @@ 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';
8
7
  import EbDraggable from '../../eb-sortable/EbDraggable.js';
9
8
  import { useMaterialQuizState } from '../context/MaterialQuizContext.js';
10
9
 
@@ -77,7 +76,7 @@ var MaterialQuizGroupOptionItem = function MaterialQuizGroupOptionItem(_ref7) {
77
76
  children: [isOptionContent ? jsx(StyledOptionContent, {
78
77
  vertical: vertical,
79
78
  children: jsx(MarkdownSSR, {
80
- children: (_a = addAltTextToImage(option.options)) !== null && _a !== void 0 ? _a : '',
79
+ children: (_a = option.options.content) !== null && _a !== void 0 ? _a : '',
81
80
  paddingx: 0,
82
81
  paddingy: 0,
83
82
  dark: true
@@ -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
+ })(["p{margin:0 !important;}code{white-space:pre-wrap;word-break:break-all;}"]);
7
7
 
8
8
  export { StyledMarkdown as default };
@@ -85,6 +85,7 @@ var QuestionRadioOption = React.memo(function (_ref6) {
85
85
  children: [jsx(StyledQuestionRadioInput, {
86
86
  id: value,
87
87
  type: "radio",
88
+ readOnly: true,
88
89
  checked: selectedValue === value,
89
90
  status: status
90
91
  }), jsx(StyledLabel, {
@@ -1,6 +1,5 @@
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";
4
3
  interface OptionInfo {
5
4
  content: string;
6
5
  optionType: QuizOptionType;
@@ -47,5 +46,4 @@ export declare function shouldResetOptions({ materialQuizResponse, }: {
47
46
  materialQuizResponse?: GetOrgMaterialQuizResponseGetResponses['quizResponse'];
48
47
  }): boolean;
49
48
  export declare function getQuizResult(materialQuizResponse: GetOrgMaterialQuizResponseGetResponses['quizResponse']): boolean | undefined;
50
- export declare const addAltTextToImage: ({ content, title, }: QuizGroupOption['options']) => string | undefined;
51
49
  export {};
@@ -60,14 +60,5 @@ 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 ![](<url>)
68
- var regex = /!\[]\((.*?)\)/;
69
- // Replace with the alt text inside the []
70
- return content === null || content === void 0 ? void 0 : content.replace(regex, "![".concat(title, "]($1)"));
71
- };
72
63
 
73
- export { QuizResultStatus, addAltTextToImage, checkUserLectureTestEnded, getOptionStatus, getQuizResult, getQuizResultStatus, shouldResetOptions };
64
+ export { QuizResultStatus, checkUserLectureTestEnded, getOptionStatus, getQuizResult, getQuizResultStatus, shouldResetOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-quiz",
3
- "version": "1.240805.0",
3
+ "version": "1.240806.0-pdf.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",
@@ -60,14 +60,14 @@
60
60
  "devDependencies": {
61
61
  "@dnd-kit/core": "^6.1.0",
62
62
  "@elice/api-client": "^1.240619.0",
63
- "@elice/blocks": "1.240802.1",
63
+ "@elice/blocks": "^1.240529.0",
64
64
  "@elice/design-tokens": "^1.220803.0",
65
65
  "@elice/icons": "^1.230814.0",
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.240805.0",
70
- "@elice/material-shared-utils": "1.240805.0",
69
+ "@elice/material-shared-types": "1.240722.0",
70
+ "@elice/material-shared-utils": "1.240722.0",
71
71
  "@elice/mui-system": "^5.240108.1",
72
72
  "@elice/types": "1.240709.0",
73
73
  "@elice/wysiwyg": "1.240716.1",