|
|
|
|
@ -1,6 +1,91 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[65148],{
|
|
|
|
|
|
|
|
|
|
/***/ 81092:
|
|
|
|
|
/*!**********************************************************!*\
|
|
|
|
|
!*** ./src/components/QuestionEditor/MdEditorInForm.tsx ***!
|
|
|
|
|
\**********************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
|
|
/* harmony export */ h: function() { return /* binding */ MdEditorInForm; },
|
|
|
|
|
/* harmony export */ x: function() { return /* binding */ RegularInput; }
|
|
|
|
|
/* harmony export */ });
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js */ 82242);
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js */ 39647);
|
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
/* harmony import */ var _components_markdown_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/markdown-editor */ 2233);
|
|
|
|
|
/* harmony import */ var _index_less_modules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.less?modules */ 53115);
|
|
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
/* harmony import */ var _components_RenderHtml__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/RenderHtml */ 12297);
|
|
|
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["value", "onChange", "scrollId"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var MdEditorInForm = function MdEditorInForm(_ref) {
|
|
|
|
|
var value = _ref.value,
|
|
|
|
|
_onChange = _ref.onChange,
|
|
|
|
|
scrollId = _ref.scrollId,
|
|
|
|
|
props = _root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_1___default()(_ref, _excluded);
|
|
|
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
|
|
|
id: scrollId || '',
|
|
|
|
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_markdown_editor__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, _root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_test1_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, props), {}, {
|
|
|
|
|
// hidetoolBar
|
|
|
|
|
defaultValue: value,
|
|
|
|
|
onChange: function onChange(a, b) {
|
|
|
|
|
console.log("a:", a, b);
|
|
|
|
|
if (!!(b !== null && b !== void 0 && b.length)) _onChange(a, b);else _onChange(a);
|
|
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var RegularInput = function RegularInput(_ref2) {
|
|
|
|
|
var value = _ref2.value,
|
|
|
|
|
onChange = _ref2.onChange,
|
|
|
|
|
onBlur = _ref2.onBlur,
|
|
|
|
|
placeholder = _ref2.placeholder,
|
|
|
|
|
_ref2$height = _ref2.height,
|
|
|
|
|
height = _ref2$height === void 0 ? 140 : _ref2$height,
|
|
|
|
|
isEdit = _ref2.isEdit,
|
|
|
|
|
_ref2$disabled = _ref2.disabled,
|
|
|
|
|
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled;
|
|
|
|
|
return disabled ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
|
|
|
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.inputBorder, " ").concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.placeholder),
|
|
|
|
|
style: {
|
|
|
|
|
cursor: 'not-allowed'
|
|
|
|
|
},
|
|
|
|
|
children: placeholder
|
|
|
|
|
}) : isEdit ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_markdown_editor__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
|
|
|
|
watch: true,
|
|
|
|
|
isFocus: true,
|
|
|
|
|
height: height,
|
|
|
|
|
placeholder: placeholder,
|
|
|
|
|
defaultValue: value,
|
|
|
|
|
onChange: onChange,
|
|
|
|
|
onBlur: onBlur
|
|
|
|
|
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
cursor: 'pointer'
|
|
|
|
|
},
|
|
|
|
|
children: value ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_components_RenderHtml__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
|
|
|
|
className: _index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.inputBorder,
|
|
|
|
|
value: value
|
|
|
|
|
}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
|
|
|
|
|
className: "".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.inputBorder, " ").concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z.placeholder),
|
|
|
|
|
children: placeholder
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 21772:
|
|
|
|
|
/*!***********************************************************************!*\
|
|
|
|
|
!*** ./src/pages/Classrooms/Lists/Polls/Answer/index.tsx + 4 modules ***!
|
|
|
|
|
@ -57,17 +142,19 @@ var es_button = __webpack_require__(3113);
|
|
|
|
|
var ArrowLeftOutlined = __webpack_require__(22596);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var Answermodules = ({"flex_box_center":"flex_box_center___iNvBA","flex_space_between":"flex_space_between___btrNY","flex_box_vertical_center":"flex_box_vertical_center___jNwqd","flex_box_center_end":"flex_box_center_end___yhhzS","flex_box_column":"flex_box_column___XCG9Z","bg":"bg___pkT5R","title":"title___txwwg","questionIcons":"questionIcons___bUmrp","green":"green___pU_n6","orange":"orange___WqPTj","greenTip":"greenTip___xA46L","redTip":"redTip___cLZrd","orangeTip":"orangeTip___IYw_9","pollDesc":"pollDesc___k8j8U","answered":"answered___Wv6LV","unanswer":"unanswer___HFr5V","anchor":"anchor___wiaGO","answerFlag":"answerFlag___Son3q","answerActive":"answerActive___vadIk","redactivie":"redactivie___lv5Yx","questionItem":"questionItem___eheF5","itemType":"itemType___cTyzU","itemFlag":"itemFlag____JLv3","answerWrap":"answerWrap___q0vMa","answerSubjective":"answerSubjective___g0GxR","otherInput":"otherInput___lNi1t","submitButton":"submitButton___Kwl_S","flexRow":"flexRow___CzS9_"});
|
|
|
|
|
/* harmony default export */ var Answermodules = ({"flex_box_center":"flex_box_center___iNvBA","flex_space_between":"flex_space_between___btrNY","flex_box_vertical_center":"flex_box_vertical_center___jNwqd","flex_box_center_end":"flex_box_center_end___yhhzS","flex_box_column":"flex_box_column___XCG9Z","bg":"bg___pkT5R","title":"title___txwwg","questionIcons":"questionIcons___bUmrp","green":"green___pU_n6","orange":"orange___WqPTj","greenTip":"greenTip___xA46L","redTip":"redTip___cLZrd","orangeTip":"orangeTip___IYw_9","pollDesc":"pollDesc___k8j8U","answered":"answered___Wv6LV","unanswer":"unanswer___HFr5V","anchor":"anchor___wiaGO","answerFlag":"answerFlag___Son3q","answerActive":"answerActive___vadIk","redactivie":"redactivie___lv5Yx","questionItem":"questionItem___eheF5","itemType":"itemType___cTyzU","itemFlag":"itemFlag____JLv3","answerWrap":"answerWrap___q0vMa","answerSubjective":"answerSubjective___g0GxR","otherInput":"otherInput___lNi1t","submitButton":"submitButton___Kwl_S","flexRow":"flexRow___CzS9_","startAnswer":"startAnswer___OxB2F"});
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
|
|
var util = __webpack_require__(76279);
|
|
|
|
|
// EXTERNAL MODULE: ./src/service/classrooms.ts
|
|
|
|
|
var classrooms = __webpack_require__(39324);
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
|
|
var authority = __webpack_require__(22961);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
|
|
|
var RenderHtml = __webpack_require__(12297);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
|
|
|
|
|
var es_radio = __webpack_require__(5112);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
|
|
|
var input = __webpack_require__(98135);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/QuestionEditor/MdEditorInForm.tsx
|
|
|
|
|
var MdEditorInForm = __webpack_require__(81092);
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/components/Single.tsx
|
|
|
|
|
@ -79,8 +166,10 @@ var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Single = function Single(_ref) {
|
|
|
|
|
var _itemData$question2, _itemData$question4, _itemData$question6, _answerData$poll;
|
|
|
|
|
var _itemData$question2, _itemData$question4, _itemData$question6, _itemData$question7, _answerData$poll;
|
|
|
|
|
var itemData = _ref.itemData,
|
|
|
|
|
answerData = _ref.answerData,
|
|
|
|
|
_ref$onSave = _ref.onSave,
|
|
|
|
|
@ -97,6 +186,14 @@ var Single = function Single(_ref) {
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
otherData = _useState6[0],
|
|
|
|
|
setOtherData = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
showEditor = _useState8[0],
|
|
|
|
|
setShowEditor = _useState8[1];
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
|
|
isFocus = _useState10[0],
|
|
|
|
|
setIsFocus = _useState10[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
var _itemData$question;
|
|
|
|
|
setData((itemData === null || itemData === void 0 || (_itemData$question = itemData.question) === null || _itemData$question === void 0 ? void 0 : _itemData$question.answers) || []);
|
|
|
|
|
@ -135,32 +232,70 @@ var Single = function Single(_ref) {
|
|
|
|
|
onSave(id, checkedData, '');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
console.log("checkedData", checkedData);
|
|
|
|
|
console.log("itemData--", itemData === null || itemData === void 0 || (_itemData$question7 = itemData.question) === null || _itemData$question7 === void 0 ? void 0 : _itemData$question7.poll_vote_texts);
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
|
|
|
disabled: (0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 || (_answerData$poll = answerData.poll) === null || _answerData$poll === void 0 ? void 0 : _answerData$poll.user_poll_status) === 1,
|
|
|
|
|
value: checkedData,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
var _itemData$question7;
|
|
|
|
|
handerChangeSingle(e.target.value, itemData === null || itemData === void 0 || (_itemData$question7 = itemData.question) === null || _itemData$question7 === void 0 ? void 0 : _itemData$question7.id);
|
|
|
|
|
var _itemData$question8;
|
|
|
|
|
handerChangeSingle(e.target.value, itemData === null || itemData === void 0 || (_itemData$question8 = itemData.question) === null || _itemData$question8 === void 0 ? void 0 : _itemData$question8.id);
|
|
|
|
|
},
|
|
|
|
|
children: data.map(function (answer, index) {
|
|
|
|
|
var _answerData$poll2, _itemData$question9;
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: "".concat(Answermodules.answerWrap, " ").concat(Answermodules.flexRow),
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_id
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "font14",
|
|
|
|
|
children: answer === null || answer === void 0 ? void 0 : answer.answer_text
|
|
|
|
|
}), checkedOtherName(answer === null || answer === void 0 ? void 0 : answer.answer_text) && /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
className: Answermodules.otherInput,
|
|
|
|
|
value: otherData,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
return setOtherData(e.target.value);
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text
|
|
|
|
|
}), checkedOtherName(answer === null || answer === void 0 ? void 0 : answer.answer_text) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
flex: 1
|
|
|
|
|
},
|
|
|
|
|
onBlur: function onBlur(e) {
|
|
|
|
|
var _itemData$question8;
|
|
|
|
|
return handleBlurOhter(itemData === null || itemData === void 0 || (_itemData$question8 = itemData.question) === null || _itemData$question8 === void 0 ? void 0 : _itemData$question8.id);
|
|
|
|
|
}
|
|
|
|
|
})]
|
|
|
|
|
children: (answerData === null || answerData === void 0 || (_answerData$poll2 = answerData.poll) === null || _answerData$poll2 === void 0 ? void 0 : _answerData$poll2.user_poll_status) === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: Answermodules.simpleText,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
value: itemData === null || itemData === void 0 || (_itemData$question9 = itemData.question) === null || _itemData$question9 === void 0 ? void 0 : _itemData$question9.poll_vote_texts
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
marginLeft: '10px'
|
|
|
|
|
},
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
setShowEditor(true);
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MdEditorInForm/* RegularInput */.x, {
|
|
|
|
|
height: 155,
|
|
|
|
|
placeholder: '',
|
|
|
|
|
isEdit: showEditor,
|
|
|
|
|
value: otherData,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
setOtherData(e);
|
|
|
|
|
setIsFocus(true);
|
|
|
|
|
},
|
|
|
|
|
onBlur: function onBlur() {
|
|
|
|
|
var _itemData$question10;
|
|
|
|
|
handleBlurOhter(itemData === null || itemData === void 0 || (_itemData$question10 = itemData.question) === null || _itemData$question10 === void 0 ? void 0 : _itemData$question10.id);
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// onBlur(value.current);
|
|
|
|
|
// }, 200)
|
|
|
|
|
// clearInterval(timeRef.current);
|
|
|
|
|
setIsFocus(false);
|
|
|
|
|
// setShowEditor(false)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// <Input
|
|
|
|
|
// className={styles.otherInput}
|
|
|
|
|
// value={otherData}
|
|
|
|
|
// onChange={e => setOtherData(e.target.value)}
|
|
|
|
|
// onBlur={e => handleBlurOhter(itemData?.question?.id)}
|
|
|
|
|
// />
|
|
|
|
|
]
|
|
|
|
|
}, index);
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
@ -177,6 +312,8 @@ var es_checkbox = __webpack_require__(24905);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Multiple = function Multiple(_ref) {
|
|
|
|
|
var _itemData$question2, _itemData$question4, _itemData$question6, _answerData$poll;
|
|
|
|
|
var itemData = _ref.itemData,
|
|
|
|
|
@ -195,6 +332,14 @@ var Multiple = function Multiple(_ref) {
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
otherData = _useState6[0],
|
|
|
|
|
setOtherData = _useState6[1];
|
|
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
|
|
showEditor = _useState8[0],
|
|
|
|
|
setShowEditor = _useState8[1];
|
|
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
|
|
isFocus = _useState10[0],
|
|
|
|
|
setIsFocus = _useState10[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
var _itemData$question;
|
|
|
|
|
setData((itemData === null || itemData === void 0 || (_itemData$question = itemData.question) === null || _itemData$question === void 0 ? void 0 : _itemData$question.answers) || []);
|
|
|
|
|
@ -241,35 +386,88 @@ var Multiple = function Multiple(_ref) {
|
|
|
|
|
handerChangeMultiple(value, itemData === null || itemData === void 0 || (_itemData$question7 = itemData.question) === null || _itemData$question7 === void 0 ? void 0 : _itemData$question7.id);
|
|
|
|
|
},
|
|
|
|
|
children: data === null || data === void 0 ? void 0 : data.map(function (answer, index) {
|
|
|
|
|
var _answerData$poll2, _itemData$question8;
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: "".concat(Answermodules.answerWrap, " ").concat(Answermodules.flexRow),
|
|
|
|
|
style: {
|
|
|
|
|
width: checkedOtherName(answer === null || answer === void 0 ? void 0 : answer.answer_text) ? '100%' : ''
|
|
|
|
|
},
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_id
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "font14",
|
|
|
|
|
children: answer === null || answer === void 0 ? void 0 : answer.answer_text
|
|
|
|
|
}), checkedOtherName(answer === null || answer === void 0 ? void 0 : answer.answer_text) && /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
className: Answermodules.otherInput,
|
|
|
|
|
value: otherData,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
return setOtherData(e.target.value);
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text
|
|
|
|
|
}), checkedOtherName(answer === null || answer === void 0 ? void 0 : answer.answer_text) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
flex: 1
|
|
|
|
|
},
|
|
|
|
|
onBlur: function onBlur(e) {
|
|
|
|
|
var _itemData$question8;
|
|
|
|
|
return handleBlurOhter(itemData === null || itemData === void 0 || (_itemData$question8 = itemData.question) === null || _itemData$question8 === void 0 ? void 0 : _itemData$question8.id);
|
|
|
|
|
}
|
|
|
|
|
})]
|
|
|
|
|
children: (answerData === null || answerData === void 0 || (_answerData$poll2 = answerData.poll) === null || _answerData$poll2 === void 0 ? void 0 : _answerData$poll2.user_poll_status) === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: Answermodules.simpleText,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
value: itemData === null || itemData === void 0 || (_itemData$question8 = itemData.question) === null || _itemData$question8 === void 0 ? void 0 : _itemData$question8.poll_vote_texts
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
style: {
|
|
|
|
|
marginLeft: '10px'
|
|
|
|
|
},
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
setShowEditor(true);
|
|
|
|
|
},
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(MdEditorInForm/* RegularInput */.x, {
|
|
|
|
|
height: 155,
|
|
|
|
|
placeholder: '',
|
|
|
|
|
isEdit: showEditor,
|
|
|
|
|
value: otherData,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
setOtherData(e);
|
|
|
|
|
setIsFocus(true);
|
|
|
|
|
},
|
|
|
|
|
onBlur: function onBlur() {
|
|
|
|
|
var _itemData$question9;
|
|
|
|
|
handleBlurOhter(itemData === null || itemData === void 0 || (_itemData$question9 = itemData.question) === null || _itemData$question9 === void 0 ? void 0 : _itemData$question9.id);
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// onBlur(value.current);
|
|
|
|
|
// }, 200)
|
|
|
|
|
// clearInterval(timeRef.current);
|
|
|
|
|
setIsFocus(false);
|
|
|
|
|
// setShowEditor(false)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// <RegularInput
|
|
|
|
|
// height={155}
|
|
|
|
|
// placeholder={''}
|
|
|
|
|
// isEdit={true}
|
|
|
|
|
// // disabled={item.disabled ? true : false}
|
|
|
|
|
// value={otherData}
|
|
|
|
|
// onChange={(e) => {
|
|
|
|
|
// setOtherData(e)
|
|
|
|
|
// }}
|
|
|
|
|
// onBlur={e => handleBlurOhter(itemData?.question?.id)}
|
|
|
|
|
// />
|
|
|
|
|
// <Input
|
|
|
|
|
// className={styles.otherInput}
|
|
|
|
|
// value={otherData}
|
|
|
|
|
// onChange={e => setOtherData(e.target.value)}
|
|
|
|
|
// onBlur={e => handleBlurOhter(itemData?.question?.id)}
|
|
|
|
|
// />
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var components_Multiple = (Multiple);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 11 modules
|
|
|
|
|
var markdown_editor = __webpack_require__(2233);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/components/Subjective.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Subjective = function Subjective(_ref) {
|
|
|
|
|
var _itemData$question2, _answerData$poll;
|
|
|
|
|
var itemData = _ref.itemData,
|
|
|
|
|
@ -280,29 +478,62 @@ var Subjective = function Subjective(_ref) {
|
|
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
|
|
otherData = _useState2[0],
|
|
|
|
|
setOtherData = _useState2[1];
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
|
|
showEditor = _useState4[0],
|
|
|
|
|
setShowEditor = _useState4[1];
|
|
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
|
|
isFocus = _useState6[0],
|
|
|
|
|
setIsFocus = _useState6[1];
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
|
|
var _itemData$question;
|
|
|
|
|
setOtherData(itemData === null || itemData === void 0 || (_itemData$question = itemData.question) === null || _itemData$question === void 0 ? void 0 : _itemData$question.poll_vote_texts);
|
|
|
|
|
}, [itemData === null || itemData === void 0 || (_itemData$question2 = itemData.question) === null || _itemData$question2 === void 0 ? void 0 : _itemData$question2.poll_vote_texts]);
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("textarea", {
|
|
|
|
|
className: Answermodules.answerSubjective,
|
|
|
|
|
placeholder: "\u5728\u6B64\u586B\u5165\u7B54\u6848",
|
|
|
|
|
disabled: (0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 || (_answerData$poll = answerData.poll) === null || _answerData$poll === void 0 ? void 0 : _answerData$poll.user_poll_status) === 1,
|
|
|
|
|
value: otherData,
|
|
|
|
|
onChange: function onChange(e) {
|
|
|
|
|
return setOtherData(e.target.value);
|
|
|
|
|
},
|
|
|
|
|
onBlur: function onBlur(e) {
|
|
|
|
|
var _itemData$question3;
|
|
|
|
|
return onSave(itemData === null || itemData === void 0 || (_itemData$question3 = itemData.question) === null || _itemData$question3 === void 0 ? void 0 : _itemData$question3.id, null, otherData);
|
|
|
|
|
}
|
|
|
|
|
children: (answerData === null || answerData === void 0 || (_answerData$poll = answerData.poll) === null || _answerData$poll === void 0 ? void 0 : _answerData$poll.user_poll_status) === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: "mb20",
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: Answermodules.simpleText,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
value: otherData
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
children: showEditor ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
|
|
watch: true,
|
|
|
|
|
isFocus: true,
|
|
|
|
|
defaultValue: otherData,
|
|
|
|
|
id: 'mutiple',
|
|
|
|
|
className: "mt20",
|
|
|
|
|
onChange: function onChange(v) {
|
|
|
|
|
setOtherData(v);
|
|
|
|
|
setIsFocus(true);
|
|
|
|
|
},
|
|
|
|
|
onBlur: function onBlur() {
|
|
|
|
|
var _itemData$question3;
|
|
|
|
|
onSave(itemData === null || itemData === void 0 || (_itemData$question3 = itemData.question) === null || _itemData$question3 === void 0 ? void 0 : _itemData$question3.id, null, otherData);
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// onBlur(value.current);
|
|
|
|
|
// }, 200)
|
|
|
|
|
// clearInterval(timeRef.current);
|
|
|
|
|
setIsFocus(false);
|
|
|
|
|
}
|
|
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
onClick: function onClick() {
|
|
|
|
|
// sign.current = true;
|
|
|
|
|
setShowEditor(true);
|
|
|
|
|
},
|
|
|
|
|
className: Answermodules.startAnswer,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: "c-blue",
|
|
|
|
|
children: "\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54"
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ var components_Subjective = (Subjective);
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
|
|
|
var RenderHtml = __webpack_require__(12297);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Polls/Answer/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -572,8 +803,8 @@ var Answer = function Answer(_ref) {
|
|
|
|
|
}), item.question.question_type == 2 && item.question.min_choices && item.question.max_choices && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
children: item.question.min_choices == item.question.max_choices ? "可选" + item.question.max_choices + "项" : "可选" + item.question.min_choices + "-" + item.question.max_choices + "项"
|
|
|
|
|
})]
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
|
|
children: item.question.question_title
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
|
|
value: item.question.question_title
|
|
|
|
|
}),
|
|
|
|
|
// 单选项
|
|
|
|
|
item.question.question_type == 1 && /*#__PURE__*/(0,jsx_runtime.jsx)(components_Single, {
|
|
|
|
|
@ -697,6 +928,17 @@ var Answer = function Answer(_ref) {
|
|
|
|
|
};
|
|
|
|
|
})(Answer));
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 53115:
|
|
|
|
|
/*!**********************************************************!*\
|
|
|
|
|
!*** ./src/components/QuestionEditor/index.less?modules ***!
|
|
|
|
|
\**********************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ __webpack_exports__.Z = ({"wrap":"wrap___ilWvf","deleteIcon":"deleteIcon___JBDG8","keywordTag":"keywordTag___iieCb","questionTitleEditorWrap":"questionTitleEditorWrap___MHB5s","choiceWrap":"choiceWrap___QFkTc","choiceIndex":"choiceIndex___Mr2YO","judgementIndex":"judgementIndex___fUVWK","setAnswerBtn":"setAnswerBtn___Whox5","activeAnswer":"activeAnswer___fGU6Y","activeJudgementAnswer":"activeJudgementAnswer___wJv8P","actionWrapper":"actionWrapper___ERQ7k","addIcon":"addIcon___L9TE0","inputBorder":"inputBorder___Q5tRE","placeholder":"placeholder___p9sFY","blankWrapper":"blankWrapper___nC45e","blankInput":"blankInput___pEHsx","blankInputNumberWrapper":"blankInputNumberWrapper___uEHb0","addBtn":"addBtn___WR5ZI","blankIndex":"blankIndex___x9Pny","baseInputWrapper":"baseInputWrapper___eVsG7","collapseWrapper":"collapseWrapper___ZTysU","panelHeader":"panelHeader___QSN9g","open":"open___B6FU9","close":"close___QX19r","hide":"hide___mn25n"});
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
}]);
|