You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1444 lines
65 KiB
1444 lines
65 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[1657],{
|
|
|
|
/***/ 30199:
|
|
/*!*********************************************************************!*\
|
|
!*** ./src/components/Editor/NullChildEditor/index.jsx + 1 modules ***!
|
|
\*********************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ Editor_NullChildEditor; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
|
|
var input = __webpack_require__(1056);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tag/index.js + 5 modules
|
|
var es_tag = __webpack_require__(12563);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
;// CONCATENATED MODULE: ./src/components/Editor/NullChildEditor/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var NullChildEditormodules = ({"flex":"flex___eLcnP","flex1":"flex1___yUTT7","color666":"color666___TiUhG","error":"error___gTTtv","deleteIcon":"deleteIcon___mnZW1","addIcon":"addIcon___JC5NS"});
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules
|
|
var PlusOutlined = __webpack_require__(378);
|
|
;// CONCATENATED MODULE: ./src/components/Editor/NullChildEditor/index.jsx
|
|
|
|
|
|
|
|
|
|
const { TextArea } = input["default"];
|
|
class NullChildEditor extends _react_17_0_2_react.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
inputVisible: false,
|
|
EditInputIndex: -1
|
|
};
|
|
}
|
|
// componentDidMount() {
|
|
// // console.log(`${this.props.index}----`,this.props,e);
|
|
// if (this.props.answers[0].length <= 0) {
|
|
// this.setState({
|
|
// EditInputIndex: 0,
|
|
// });
|
|
// }
|
|
// }
|
|
render() {
|
|
let {
|
|
index,
|
|
onAnswerChange,
|
|
addChildAnswer,
|
|
exerciseIsPublish,
|
|
answers,
|
|
activeOptionErrorIndex,
|
|
flex = "0 0 1000px"
|
|
} = this.props;
|
|
console.log("----", answers);
|
|
let { inputVisible, EditInputIndex } = this.state;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: NullChildEditormodules.flex }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
className: `${NullChildEditormodules.color666} mb5 mt6`,
|
|
style: { flex: "0 0 90px" }
|
|
},
|
|
"\u7B54\u6848(\u586B\u7A7A",
|
|
index + 1,
|
|
"):"
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { border: "1px solid #f6f6f6", flex: 1, padding: 10 } }, answers == null ? void 0 : answers.map((tag, itemIndex) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, EditInputIndex !== itemIndex ? (tag == null ? void 0 : tag.length) > 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_tag["default"],
|
|
{
|
|
className: "edit-tag",
|
|
key: tag,
|
|
closable: true,
|
|
onClose: (e) => {
|
|
e.preventDefault();
|
|
if ((answers == null ? void 0 : answers.length) === 1 && itemIndex === 0) {
|
|
this.props.deleteChildAnswermain(index, itemIndex);
|
|
} else {
|
|
this.props.deleteChildAnswer(index, itemIndex);
|
|
}
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"span",
|
|
{
|
|
onDoubleClick: (e) => {
|
|
this.setState({
|
|
EditInputIndex: itemIndex
|
|
});
|
|
e.preventDefault();
|
|
}
|
|
},
|
|
tag
|
|
)
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
defaultValue: tag,
|
|
style: {
|
|
width: 78,
|
|
marginRight: 8,
|
|
height: 24,
|
|
verticalAlign: "top"
|
|
},
|
|
onBlur: (e) => {
|
|
if (e.target.value.replaceAll(" ", "").length <= 0) {
|
|
message/* default */.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");
|
|
return;
|
|
}
|
|
onAnswerChange(index, itemIndex, e.target.value);
|
|
this.setState({
|
|
EditInputIndex: -1,
|
|
inputVisible: false
|
|
});
|
|
}
|
|
}
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
defaultValue: tag,
|
|
style: {
|
|
width: 78,
|
|
marginRight: 8,
|
|
height: 24,
|
|
verticalAlign: "top"
|
|
},
|
|
onBlur: (e) => {
|
|
if (e.target.value.replaceAll(" ", "").length <= 0) {
|
|
message/* default */.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");
|
|
return;
|
|
}
|
|
onAnswerChange(index, itemIndex, e.target.value);
|
|
this.setState({
|
|
EditInputIndex: -1,
|
|
inputVisible: false
|
|
});
|
|
}
|
|
}
|
|
));
|
|
}), !inputVisible && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_tag["default"],
|
|
{
|
|
className: "site-tag-plus",
|
|
onClick: () => {
|
|
addChildAnswer(index);
|
|
this.setState({
|
|
inputVisible: true
|
|
});
|
|
}
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(PlusOutlined/* default */.Z, null),
|
|
" \u65B0\u589E\u7B54\u6848"
|
|
)));
|
|
}
|
|
}
|
|
/* harmony default export */ var Editor_NullChildEditor = (NullChildEditor);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 87768:
|
|
/*!************************************************!*\
|
|
!*** ./src/components/Editor/NullMDEditor.jsx ***!
|
|
\************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ Z: function() { return /* binding */ NullMDEditor; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _markdown_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../markdown-editor */ 20103);
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __publicField = (obj, key, value) => {
|
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
return value;
|
|
};
|
|
|
|
|
|
const NULL_CH = "\u2581";
|
|
class NullMDEditor extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
|
|
constructor() {
|
|
super(...arguments);
|
|
__publicField(this, "getChCountBeforeCursor", (cm, cursor) => {
|
|
const currentLine = cursor.line;
|
|
let placeholderCountBefore = 0;
|
|
for (let _line = 0; _line < currentLine; _line++) {
|
|
placeholderCountBefore += cm.getLine(_line).split(NULL_CH).length - 1;
|
|
}
|
|
const currentLineStringBeforeCursor = cm.getLine(currentLine).substring(0, cursor.ch);
|
|
placeholderCountBefore += currentLineStringBeforeCursor.split(NULL_CH).length - 1;
|
|
return placeholderCountBefore;
|
|
});
|
|
__publicField(this, "onCMBeforeChange", (cm, change) => {
|
|
const rangeText = cm.getRange(change.from, change.to);
|
|
let totalPlaceholderCount = 0;
|
|
change.text.forEach((item) => {
|
|
totalPlaceholderCount += item.split(NULL_CH).length - 1;
|
|
});
|
|
if (rangeText && rangeText.indexOf(NULL_CH) != -1) {
|
|
const placeholderCountInRange = rangeText.split(NULL_CH).length - 1;
|
|
const placeholderCountBefore = this.getChCountBeforeCursor(
|
|
cm,
|
|
change.from
|
|
);
|
|
console.log(
|
|
`\u5220\u9664${placeholderCountInRange}\u4E2A\uFF0C \u4E4B\u524D\u6709${placeholderCountBefore}\u4E2A\uFF0C\u65B0\u589E${totalPlaceholderCount}\u4E2A`
|
|
);
|
|
if (this.props.deleteEmptyDisabled) {
|
|
change.cancel();
|
|
} else {
|
|
this.props.onPlaceholderChange && this.props.onPlaceholderChange(
|
|
placeholderCountBefore,
|
|
placeholderCountInRange,
|
|
totalPlaceholderCount
|
|
);
|
|
}
|
|
} else if (totalPlaceholderCount) {
|
|
const placeholderCountBefore = this.getChCountBeforeCursor(
|
|
cm,
|
|
change.from
|
|
);
|
|
console.log(
|
|
`\u65B0\u589E${totalPlaceholderCount}\u4E2A\uFF0C\u4E4B\u524D\u6709${placeholderCountBefore}\u4E2A`
|
|
);
|
|
this.props.onPlaceholderChange && this.props.onPlaceholderChange(
|
|
placeholderCountBefore,
|
|
0,
|
|
totalPlaceholderCount
|
|
);
|
|
}
|
|
});
|
|
}
|
|
render() {
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
_markdown_editor__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z,
|
|
__spreadProps(__spreadValues({}, this.props), {
|
|
onCMBeforeChange: this.onCMBeforeChange
|
|
})
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 41993:
|
|
/*!**********************************************************!*\
|
|
!*** ./src/components/FixedButton/index.tsx + 1 modules ***!
|
|
\**********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
t: function() { return /* binding */ FixedButton; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var FixedButtonmodules = ({"buttonFixed":"buttonFixed___vyq30","button":"button___hxmYv","buttonWrap":"buttonWrap___uK8dl"});
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
;// CONCATENATED MODULE: ./src/components/FixedButton/index.tsx
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
|
|
|
|
|
|
const FixedButton = ({
|
|
cancelText = "\u53D6\u6D88",
|
|
okText = "\u786E\u5B9A",
|
|
loading = false,
|
|
hasOkBtn = true,
|
|
hasCancelBtn = true,
|
|
okButtonProps = {},
|
|
onCancel = () => {
|
|
},
|
|
onOk = () => {
|
|
},
|
|
className = ""
|
|
}) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: _classnames_2_3_2_classnames_default()(FixedButtonmodules.buttonFixed, className) }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: FixedButtonmodules.buttonWrap }, hasCancelBtn && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
size: "middle",
|
|
className: `${FixedButtonmodules.button} mr20`,
|
|
onClick: onCancel
|
|
},
|
|
cancelText
|
|
), hasOkBtn && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
__spreadValues({
|
|
size: "middle",
|
|
type: "primary",
|
|
className: `${FixedButtonmodules.button} mr20`,
|
|
loading,
|
|
onClick: onOk
|
|
}, okButtonProps),
|
|
okText
|
|
)));
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 43800:
|
|
/*!*****************************************************************************************!*\
|
|
!*** ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/index.tsx + 7 modules ***!
|
|
\*****************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"default": function() { return /* binding */ EditQuestion; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 14 modules
|
|
var _umi_production_exports = __webpack_require__(87210);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
var tabs = __webpack_require__(99313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
var es_form = __webpack_require__(78241);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
var message = __webpack_require__(8591);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
var modal = __webpack_require__(43418);
|
|
// 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__(1056);
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 14 modules
|
|
var markdown_editor = __webpack_require__(20103);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
|
|
var RenderHtml = __webpack_require__(12586);
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
var shixuns = __webpack_require__(86151);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
|
|
var es_select = __webpack_require__(57809);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(3163);
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/components/AddQuestion/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var AddQuestionmodules = ({"flex_box_center":"flex_box_center___VNtUs","flex_space_between":"flex_space_between___yjHqt","flex_box_vertical_center":"flex_box_vertical_center___ExRYO","flex_box_center_end":"flex_box_center_end___R3pck","flex_box_column":"flex_box_column___jCizz","modal":"modal___QCUzg","main":"main___t9DEK","title":"title___roJ27","name":"name___AJcOc","body":"body___k8mdv","form":"form____xxpn","btns":"btns___Zy6h9"});
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/components/editor.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var editormodules = ({"wrap":"wrap___zDMCt","modal":"modal___qzGUK","titleWrap":"titleWrap___k3brc","required":"required___h7eRD","title":"title___cMJHQ","colorGray":"colorGray___bSYRQ","choiceWrap":"choiceWrap___JBxMa","answer":"answer___LyOVU","activeAnswer":"activeAnswer___Jr8Iu","deleteIcon":"deleteIcon___xZU5J","addIcon":"addIcon___b8dJ9","editorWrap":"editorWrap___LcO9S","htmlWrap":"htmlWrap___TI8l7","radio":"radio___xZG0G","color333":"color333___INjEp","color999":"color999___TucNz","fold":"fold___Rtuxo","head":"head___ejhHV"});
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/components/MultipleEditor/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
const tagList = [
|
|
"A",
|
|
"B",
|
|
"C",
|
|
"D",
|
|
"E",
|
|
"F",
|
|
"G",
|
|
"H",
|
|
"I",
|
|
"J",
|
|
"K",
|
|
"L",
|
|
"M",
|
|
"N",
|
|
"O",
|
|
"P",
|
|
"Q",
|
|
"R",
|
|
"S",
|
|
"T",
|
|
"U",
|
|
"V",
|
|
"W",
|
|
"X",
|
|
"Y",
|
|
"Z"
|
|
];
|
|
const MultipleEditor = ({
|
|
editData
|
|
}, ref) => {
|
|
const [questionChoiceList, setQuestionChoiceList] = (0,_react_17_0_2_react.useState)(["", "", "", ""]);
|
|
const [activeEditor, setActiveEditor] = (0,_react_17_0_2_react.useState)();
|
|
const [activeAnswer, setActiveAnswer] = (0,_react_17_0_2_react.useState)([]);
|
|
const [title, setTitle] = (0,_react_17_0_2_react.useState)("");
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a, _b;
|
|
if (!editData) {
|
|
return;
|
|
}
|
|
setTitle(editData == null ? void 0 : editData.subject);
|
|
setQuestionChoiceList((_a = editData == null ? void 0 : editData.choose_contents) == null ? void 0 : _a.map((item) => item.option_name));
|
|
const answerIndex = [];
|
|
(_b = editData == null ? void 0 : editData.choose_contents) == null ? void 0 : _b.map((item, index) => {
|
|
if (item.right_key) {
|
|
answerIndex.push(index);
|
|
}
|
|
});
|
|
setActiveAnswer(answerIndex);
|
|
}, [editData]);
|
|
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
|
onSave,
|
|
Clear
|
|
}));
|
|
const isDuplicate = (array = []) => {
|
|
let ary = [...array];
|
|
let nary = ary.sort();
|
|
for (let i = 0; i < nary.length - 1; i++) {
|
|
if (nary[i] == nary[i + 1]) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
const onSave = () => {
|
|
if (!title) {
|
|
message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72");
|
|
return false;
|
|
}
|
|
const findNotAnswerIndex = questionChoiceList.findIndex((item) => !item);
|
|
if (findNotAnswerIndex > -1) {
|
|
message/* default */.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${tagList[findNotAnswerIndex]} \u9009\u9879\u7684\u5185\u5BB9`);
|
|
return false;
|
|
}
|
|
console.log(questionChoiceList, "questionChoiceList");
|
|
if (isDuplicate(questionChoiceList)) {
|
|
message/* default */.ZP.info("\u9009\u9879\u5DF2\u91CD\u590D");
|
|
return false;
|
|
}
|
|
if (!activeAnswer.length) {
|
|
message/* default */.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E");
|
|
return false;
|
|
}
|
|
const choices = questionChoiceList.map((item, index) => {
|
|
return {
|
|
choice_text: item,
|
|
is_answer: activeAnswer.includes(index) ? 1 : 0
|
|
};
|
|
});
|
|
return {
|
|
name: title,
|
|
choices
|
|
};
|
|
};
|
|
const Clear = () => {
|
|
setQuestionChoiceList(["", "", "", ""]);
|
|
setTitle("");
|
|
setActiveAnswer([]);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
id: "single-question-title",
|
|
watch: true,
|
|
height: 155,
|
|
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
|
|
defaultValue: title,
|
|
onChange: (value) => setTitle(value)
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u7B54\u6848\u9009\u9879\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.colorGray }, "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))), questionChoiceList.map((item, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.choiceWrap, key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848", placement: "left" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"div",
|
|
{
|
|
className: `${editormodules.answer} ${activeAnswer.includes(index) ? editormodules.activeAnswer : ""}`,
|
|
onClick: () => {
|
|
if (activeAnswer.includes(index)) {
|
|
setActiveAnswer(activeAnswer.filter((item2) => item2 !== index));
|
|
} else {
|
|
setActiveAnswer([...activeAnswer, index]);
|
|
}
|
|
}
|
|
},
|
|
tagList[index]
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.editorWrap }, activeEditor === index ? /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
id: `single-question-option-${index}`,
|
|
watch: true,
|
|
height: 155,
|
|
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9009\u9879",
|
|
defaultValue: item,
|
|
onChange: (value) => {
|
|
questionChoiceList[index] = value;
|
|
setQuestionChoiceList(questionChoiceList);
|
|
}
|
|
}
|
|
) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: editormodules.htmlWrap, onClick: () => setActiveEditor(index) }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item }))), index > 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5220\u9664" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: `${editormodules.deleteIcon} iconfont icon-htmal5icon19`,
|
|
onClick: () => setQuestionChoiceList(questionChoiceList.filter((_, key) => key !== index))
|
|
}
|
|
)), index < 7 && index === questionChoiceList.length - 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u65B0\u589E\u53C2\u8003\u7B54\u6848" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"i",
|
|
{
|
|
className: `${editormodules.addIcon} iconfont icon-roundaddfill ml6`,
|
|
onClick: () => setQuestionChoiceList([...questionChoiceList, ""])
|
|
}
|
|
)));
|
|
}), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10 mb10" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999" }, "\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898")));
|
|
};
|
|
/* harmony default export */ var components_MultipleEditor = ((0,_react_17_0_2_react.forwardRef)(MultipleEditor));
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
var es_checkbox = __webpack_require__(24905);
|
|
// EXTERNAL MODULE: ./src/components/Editor/NullMDEditor.jsx
|
|
var NullMDEditor = __webpack_require__(87768);
|
|
// EXTERNAL MODULE: ./src/components/Editor/NullChildEditor/index.jsx + 1 modules
|
|
var NullChildEditor = __webpack_require__(30199);
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/components/CompletionEditor/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CompletionEditor = ({
|
|
editData
|
|
}, ref) => {
|
|
const [title, setTitle] = (0,_react_17_0_2_react.useState)("");
|
|
const [answerList, setAnswerList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [activeOptionErrorIndex, setActiveOptionErrorIndex] = (0,_react_17_0_2_react.useState)("");
|
|
const [checked, setChecked] = (0,_react_17_0_2_react.useState)();
|
|
const [firstSetAnswerFlag, setFirstSetAnswerFlag] = (0,_react_17_0_2_react.useState)(false);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (!editData) {
|
|
return;
|
|
}
|
|
setTitle(editData == null ? void 0 : editData.subject);
|
|
setChecked(editData == null ? void 0 : editData.is_ordered);
|
|
setFirstSetAnswerFlag(true);
|
|
}, [editData]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a;
|
|
if (!firstSetAnswerFlag) {
|
|
return;
|
|
}
|
|
const answer = (_a = editData == null ? void 0 : editData.standard_answers) == null ? void 0 : _a.map((item) => item.text);
|
|
setAnswerList(answer);
|
|
setFirstSetAnswerFlag(false);
|
|
}, [firstSetAnswerFlag]);
|
|
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
|
onSave,
|
|
Clear
|
|
}));
|
|
console.log(answerList, "answerList");
|
|
const onSave = () => {
|
|
let answerArray = [];
|
|
let isEmpty = false;
|
|
answerList.forEach((answers, index) => {
|
|
answerArray.push({
|
|
position: index + 1,
|
|
answer_text: []
|
|
});
|
|
answers.forEach((item, itemIndex) => {
|
|
answerArray[index].answer_text.push(item);
|
|
if (!item || !(0,util/* validateLength */.eR)(item, 1e4)) {
|
|
setActiveOptionErrorIndex(`${index}-${itemIndex}`);
|
|
message/* default */.ZP.info(!item ? `\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A` : "\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26");
|
|
isEmpty = true;
|
|
}
|
|
});
|
|
});
|
|
if (isEmpty) {
|
|
return false;
|
|
}
|
|
if ((answerArray == null ? void 0 : answerArray.length) > 50) {
|
|
message/* default */.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC750\u4E2A\uFF01");
|
|
return false;
|
|
}
|
|
return {
|
|
name: title,
|
|
standard_answers: answerArray,
|
|
is_ordered: checked
|
|
};
|
|
};
|
|
const Clear = () => {
|
|
setTitle("");
|
|
setAnswerList([]);
|
|
setChecked(false);
|
|
};
|
|
const handlePlaceholderChange = (placeholderCountBefore, placeholderCountInRange, totalPlaceholderCount) => {
|
|
const newStandardAnswers = answerList.slice();
|
|
if (placeholderCountInRange) {
|
|
newStandardAnswers.splice(
|
|
placeholderCountBefore,
|
|
placeholderCountInRange
|
|
);
|
|
}
|
|
if (totalPlaceholderCount) {
|
|
for (let i = 0; i < totalPlaceholderCount; i++) {
|
|
newStandardAnswers.splice(placeholderCountBefore + i, 0, [""]);
|
|
}
|
|
}
|
|
setAnswerList(newStandardAnswers);
|
|
};
|
|
const handleAnswerChange = (index, itemIndex, val) => {
|
|
setActiveOptionErrorIndex("");
|
|
let newStandardAnswers = answerList.slice();
|
|
newStandardAnswers[index][itemIndex] = val;
|
|
setAnswerList(newStandardAnswers);
|
|
};
|
|
const handleAddChildAnswer = (index) => {
|
|
let newStandardAnswers = answerList.slice();
|
|
newStandardAnswers[index] = [...newStandardAnswers[index], ...[""]];
|
|
setAnswerList(newStandardAnswers);
|
|
};
|
|
const handleDeleteChildAnswer = (index, childIndex) => {
|
|
let newStandardAnswers = answerList.slice();
|
|
if (!newStandardAnswers[index][childIndex]) {
|
|
newStandardAnswers[index] = newStandardAnswers[index].filter((_, key) => key !== childIndex);
|
|
setAnswerList(newStandardAnswers);
|
|
return;
|
|
}
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: "\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",
|
|
className: editormodules.modal,
|
|
onOk: () => {
|
|
newStandardAnswers[index] = newStandardAnswers[index].filter((_, key) => key !== childIndex);
|
|
setAnswerList(newStandardAnswers);
|
|
}
|
|
});
|
|
};
|
|
const handleDeleteChildAnswermain = (index) => {
|
|
modal["default"].confirm({
|
|
centered: true,
|
|
okText: "\u786E\u5B9A",
|
|
cancelText: "\u53D6\u6D88",
|
|
title: "\u63D0\u793A",
|
|
content: "\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",
|
|
className: editormodules.modal,
|
|
onOk: () => {
|
|
let newStandardAnswers = answerList.slice();
|
|
newStandardAnswers = answerList.filter((_, key) => index !== key);
|
|
setAnswerList(newStandardAnswers);
|
|
}
|
|
});
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
NullMDEditor/* default */.Z,
|
|
{
|
|
id: `completion-question-tittle`,
|
|
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",
|
|
height: 155,
|
|
defaultValue: title,
|
|
onChange: (value) => setTitle(value),
|
|
showNullButton: true,
|
|
onPlaceholderChange: handlePlaceholderChange
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt20" }, answerList.map((answers, index) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
NullChildEditor/* default */.Z,
|
|
{
|
|
key: index,
|
|
answers,
|
|
index,
|
|
is_md: true,
|
|
activeOptionErrorIndex,
|
|
onAnswerChange: handleAnswerChange,
|
|
addChildAnswer: handleAddChildAnswer,
|
|
deleteChildAnswer: handleDeleteChildAnswer,
|
|
deleteChildAnswermain: handleDeleteChildAnswermain
|
|
}
|
|
);
|
|
})), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10 mb5" }, answerList.length > 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_checkbox["default"],
|
|
{
|
|
checked,
|
|
onChange: (e) => setChecked(e.target.checked),
|
|
className: editormodules.color333
|
|
},
|
|
"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${editormodules.color999} font12` }, "\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))));
|
|
};
|
|
/* harmony default export */ var components_CompletionEditor = ((0,_react_17_0_2_react.forwardRef)(CompletionEditor));
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/components/JudgmentEditor/index.tsx
|
|
|
|
|
|
|
|
|
|
const JudgmentEditor_tagList = (/* unused pure expression or super */ null && ([
|
|
"A",
|
|
"B",
|
|
"C",
|
|
"D",
|
|
"E",
|
|
"F",
|
|
"G",
|
|
"H",
|
|
"I",
|
|
"J",
|
|
"K",
|
|
"L",
|
|
"M",
|
|
"N",
|
|
"O",
|
|
"P",
|
|
"Q",
|
|
"R",
|
|
"S",
|
|
"T",
|
|
"U",
|
|
"V",
|
|
"W",
|
|
"X",
|
|
"Y",
|
|
"Z"
|
|
]));
|
|
const JudgmentEditor = ({
|
|
editData
|
|
}, ref) => {
|
|
const [activeAnswer, setActiveAnswer] = (0,_react_17_0_2_react.useState)();
|
|
const [title, setTitle] = (0,_react_17_0_2_react.useState)("");
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (!editData) {
|
|
return;
|
|
}
|
|
setTitle(editData == null ? void 0 : editData.subject);
|
|
setActiveAnswer((editData == null ? void 0 : editData.standard_answer) === "\u6B63\u786E" ? "0" : "1");
|
|
}, [editData]);
|
|
(0,_react_17_0_2_react.useImperativeHandle)(ref, () => ({
|
|
onSave,
|
|
Clear
|
|
}));
|
|
const onSave = () => {
|
|
if (!title) {
|
|
message/* default */.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72");
|
|
return false;
|
|
}
|
|
if (!activeAnswer) {
|
|
message/* default */.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u5224\u65AD\u9898\u7684\u6B63\u786E\u9009\u9879");
|
|
return false;
|
|
}
|
|
const choices = [
|
|
{ choice_text: "\u6B63\u786E", is_answer: activeAnswer === "0" ? 1 : 0 },
|
|
{ choice_text: "\u9519\u8BEF", is_answer: activeAnswer === "1" ? 1 : 0 }
|
|
];
|
|
return {
|
|
name: title,
|
|
choices
|
|
};
|
|
};
|
|
const Clear = () => {
|
|
setTitle("");
|
|
setActiveAnswer("");
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: editormodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u9898\u5E72\uFF1A")), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
markdown_editor/* default */.Z,
|
|
{
|
|
id: "single-question-title",
|
|
watch: true,
|
|
height: 155,
|
|
placeholder: "\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",
|
|
defaultValue: title,
|
|
onChange: (value) => setTitle(value)
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: editormodules.titleWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.required }, "*"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.title }, "\u7B54\u6848\u9009\u9879\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: editormodules.colorGray }, "\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, { className: "mb10", buttonStyle: "solid", value: activeAnswer, onChange: (e) => setActiveAnswer(e.target.value) }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Button */.ZP.Button, { value: "0", className: `${editormodules.radio} mr40` }, "\u6B63\u786E"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Button */.ZP.Button, { value: "1", className: editormodules.radio }, "\u9519\u8BEF")));
|
|
};
|
|
/* harmony default export */ var components_JudgmentEditor = ((0,_react_17_0_2_react.forwardRef)(JudgmentEditor));
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react-router@6.3.0@react-router/index.js
|
|
var _react_router_6_3_0_react_router = __webpack_require__(35338);
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/components/AddQuestion/index.tsx
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AddQuestion = ({
|
|
visible = false,
|
|
is_published,
|
|
editData,
|
|
onOk,
|
|
onCancel
|
|
}) => {
|
|
const params = (0,_react_router_6_3_0_react_router/* useParams */.UO)();
|
|
const [scoreList, setScoreList] = (0,_react_17_0_2_react.useState)([10, 20]);
|
|
const [form] = es_form["default"].useForm();
|
|
const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({});
|
|
const childRef = (0,_react_17_0_2_react.useRef)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
document.getElementById("modal-level-question").style.transform = "none";
|
|
return () => {
|
|
document.getElementById("modal-level-question").style.transform = "translateX(0)";
|
|
};
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (visible && editData) {
|
|
form.setFieldsValue(__spreadValues({}, editData));
|
|
setScoreList(mappingDifficulty[editData.difficult]);
|
|
}
|
|
}, [visible]);
|
|
const mappingDifficulty = {
|
|
1: [10, 20],
|
|
2: [30, 40, 50, 60],
|
|
3: [70, 80, 90, 100]
|
|
};
|
|
const handleValuesChange = (changedValues, values) => {
|
|
setFormValue(__spreadValues({}, values));
|
|
if ("difficult" in changedValues) {
|
|
handleDifficultyChange(changedValues.difficult);
|
|
}
|
|
};
|
|
const getParams = () => __async(void 0, null, function* () {
|
|
var _a, _b;
|
|
const editorData = yield childRef.current.onSave();
|
|
if (!editorData) {
|
|
return false;
|
|
}
|
|
if (visible === 1) {
|
|
let standard_answer = "";
|
|
const question = {
|
|
cnt: editorData == null ? void 0 : editorData.choices.map((item) => item.choice_text)
|
|
};
|
|
const choice = {
|
|
answer: editorData == null ? void 0 : editorData.choices.map((item) => item.is_answer)
|
|
};
|
|
choice == null ? void 0 : choice.answer.map(function(v, k) {
|
|
if (v)
|
|
standard_answer += util/* ZimuSort */.oV[k];
|
|
});
|
|
return {
|
|
challenge_choose: {
|
|
subject: editorData.name,
|
|
answer: formValue.task_pass,
|
|
standard_answer,
|
|
score: formValue.score,
|
|
difficult: formValue.difficult
|
|
},
|
|
question,
|
|
choice
|
|
};
|
|
}
|
|
if (visible === 2) {
|
|
return {
|
|
challenge_choose: {
|
|
subject: editorData.name,
|
|
answer: formValue.task_pass,
|
|
score: formValue.score,
|
|
difficult: formValue.difficult
|
|
},
|
|
blank_answers: editorData == null ? void 0 : editorData.standard_answers,
|
|
is_ordered: editorData == null ? void 0 : editorData.is_ordered
|
|
};
|
|
}
|
|
if (visible === 3) {
|
|
let standard_answer = ((_b = (_a = editorData == null ? void 0 : editorData.choices) == null ? void 0 : _a[0]) == null ? void 0 : _b.is_answer) ? "true" : "false";
|
|
return {
|
|
challenge_choose: {
|
|
subject: editorData.name,
|
|
answer: formValue.task_pass,
|
|
standard_answer,
|
|
score: formValue.score,
|
|
difficult: formValue.difficult
|
|
}
|
|
};
|
|
}
|
|
});
|
|
const handleDifficultyChange = (difficult) => {
|
|
const scores = mappingDifficulty[difficult];
|
|
const defaultScore = scores == null ? void 0 : scores[0];
|
|
setScoreList(scores);
|
|
form.setFieldsValue({ score: defaultScore });
|
|
setFormValue(__spreadValues(__spreadValues({}, form.getFieldsValue()), { score: defaultScore }));
|
|
};
|
|
const handleFinish = (values) => __async(void 0, null, function* () {
|
|
const newParams = yield getParams();
|
|
if (!newParams) {
|
|
return;
|
|
}
|
|
if (editData) {
|
|
const res2 = yield (0,shixuns/* updateChallengesQuestion */.bq)(__spreadProps(__spreadValues(__spreadValues({}, yield newParams), params), { questionId: editData.choose_id, type: visible }));
|
|
if (res2.challenge_choose_id) {
|
|
message/* default */.ZP.success("\u64CD\u4F5C\u6210\u529F");
|
|
onOk();
|
|
}
|
|
return;
|
|
}
|
|
const res = yield (0,shixuns/* addChallengesQuestion */.Tn)(__spreadProps(__spreadValues(__spreadValues({}, yield newParams), params), { type: visible }));
|
|
if (res.challenge_choose_id) {
|
|
message/* default */.ZP.success("\u64CD\u4F5C\u6210\u529F");
|
|
onOk();
|
|
}
|
|
});
|
|
const onClickSave = () => __async(void 0, null, function* () {
|
|
const sV = yield childRef.current.onSave();
|
|
if (!sV) {
|
|
return false;
|
|
}
|
|
form.submit();
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionmodules.modal }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionmodules.main }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionmodules.title }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionmodules.name }, editData ? "\u7F16\u8F91\u9898\u76EE" : "\u6DFB\u52A0\u9898\u76EE"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: AddQuestionmodules.edit, onClick: onCancel }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-guanbi1" }), " ")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionmodules.body, id: "question-scroll" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
form,
|
|
className: AddQuestionmodules.form,
|
|
scrollToFirstError: true,
|
|
layout: "vertical",
|
|
onValuesChange: handleValuesChange,
|
|
onFinish: handleFinish,
|
|
initialValues: {
|
|
difficult: 1,
|
|
score: 10
|
|
}
|
|
},
|
|
visible === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(components_MultipleEditor, { ref: childRef, editData }),
|
|
visible === 2 && /* @__PURE__ */ _react_17_0_2_react.createElement(components_CompletionEditor, { ref: childRef, editData }),
|
|
visible === 3 && /* @__PURE__ */ _react_17_0_2_react.createElement(components_JudgmentEditor, { ref: childRef, editData }),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "task_pass",
|
|
label: "\u53C2\u8003\u7B54\u6848:",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848" },
|
|
{ max: 35e3, message: "\u53C2\u8003\u7B54\u6848\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26" }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(markdown_editor/* default */.Z, { className: "mt5", watch: true, defaultValue: (editData == null ? void 0 : editData.answer) || "" })
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "difficult", label: "\u96BE\u5EA6\u7CFB\u6570:", rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u96BE\u5EA6\u7CFB\u6570" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, { disabled: is_published }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: 1 }, "\u7B80\u5355"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { style: { marginLeft: 80 }, value: 2 }, "\u4E2D\u7B49"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { style: { marginLeft: 80 }, className: "ml80", value: 3 }, "\u56F0\u96BE"))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "customAddItemSelect" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "score", label: "\u5956\u52B1\u91D1\u5E01:", rules: [{ required: true, message: "\u8BF7\u9009\u62E9\u5956\u52B1\u7ECF\u9A8C\u503C" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], { size: "large", disabled: is_published }, scoreList.map((item) => /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: item, value: item }, item))))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: { paddingTop: 18 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "font12 c-light-black ml10 mt20" }, "\u5B66\u5458\u6B63\u786E\u7B54\u9898\u65F6\u83B7\u5F97\u91D1\u5E01\uFF0C\u5E76\u4E14\u83B7\u5F97\u7B49\u91CF\u7684\u7ECF\u9A8C\u503C\u3002\u5982\uFF1A+100\u91D1\u5E01\u3001+100\u7ECF\u9A8C\u503C\u3002")))
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: AddQuestionmodules.btns }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", style: { marginRight: 20 }, onClick: onCancel }, "\u53D6\u6D88"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", type: "primary", onClick: onClickSave }, "\u4FDD\u5B58"))));
|
|
};
|
|
/* harmony default export */ var components_AddQuestion = (AddQuestion);
|
|
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var EditQuestionmodules = ({"flex_box_center":"flex_box_center___ppUNW","flex_space_between":"flex_space_between___WJRAN","flex_box_vertical_center":"flex_box_vertical_center___7gMnX","flex_box_center_end":"flex_box_center_end___hvwcp","flex_box_column":"flex_box_column___yfVcD","bg":"bg___8Isfx","formWrap":"formWrap___r7knb","empty":"empty___eyoKW","list":"list___KSdLX","fs":"fs___Z5WVP","top":"top___brfch","left":"left___sqlv7","title":"title___DZUxC","qs":"qs___hVb1u","qsActive":"qsActive___sevZW","right":"right___dIeSm","bt":"bt___WD12g","answer":"answer___eM8QA","addBtn":"addBtn___uPtMo"});
|
|
// EXTERNAL MODULE: ./src/components/FixedButton/index.tsx + 1 modules
|
|
var FixedButton = __webpack_require__(41993);
|
|
// EXTERNAL MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.tsx + 1 modules
|
|
var Loading = __webpack_require__(43266);
|
|
// EXTERNAL MODULE: ./src/pages/Shixuns/Edit/utils/index.tsx
|
|
var utils = __webpack_require__(65464);
|
|
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
|
|
var ImagesIcon = __webpack_require__(43021);
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
var authority = __webpack_require__(55830);
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/EditQuestion/index.tsx
|
|
var EditQuestion_defProp = Object.defineProperty;
|
|
var EditQuestion_defProps = Object.defineProperties;
|
|
var EditQuestion_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var EditQuestion_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var EditQuestion_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var EditQuestion_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var EditQuestion_defNormalProp = (obj, key, value) => key in obj ? EditQuestion_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var EditQuestion_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (EditQuestion_hasOwnProp.call(b, prop))
|
|
EditQuestion_defNormalProp(a, prop, b[prop]);
|
|
if (EditQuestion_getOwnPropSymbols)
|
|
for (var prop of EditQuestion_getOwnPropSymbols(b)) {
|
|
if (EditQuestion_propIsEnum.call(b, prop))
|
|
EditQuestion_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var EditQuestion_spreadProps = (a, b) => EditQuestion_defProps(a, EditQuestion_getOwnPropDescs(b));
|
|
var EditQuestion_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { TabPane } = tabs["default"];
|
|
const NewCoursePage = ({
|
|
shixunsDetail,
|
|
practiceSetting,
|
|
dispatch
|
|
}) => {
|
|
var _a, _b;
|
|
const params = (0,_umi_production_exports.useParams)();
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const [form] = es_form["default"].useForm();
|
|
const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({});
|
|
const [dataList, setDataList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [listLoading, setListLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(true);
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
const [editData, setEditData] = (0,_react_17_0_2_react.useState)(null);
|
|
const [editChallengeData, setEditChallengeData] = (0,_react_17_0_2_react.useState)(null);
|
|
const [activeKey, setActiveKey] = (0,_react_17_0_2_react.useState)("1");
|
|
const [updateIndex, setUpdateIndex] = (0,_react_17_0_2_react.useState)(1);
|
|
const changeData = (0,_react_17_0_2_react.useRef)({ subject: "", task_pass: "" });
|
|
const timer = (0,_react_17_0_2_react.useRef)(null);
|
|
const { is_published, id } = practiceSetting;
|
|
const { challengesEdit } = shixunsDetail;
|
|
const End = [
|
|
"A",
|
|
"B",
|
|
"C",
|
|
"D",
|
|
"E",
|
|
"F",
|
|
"G",
|
|
"H",
|
|
"I",
|
|
"J",
|
|
"K",
|
|
"L",
|
|
"M",
|
|
"N",
|
|
"O",
|
|
"P",
|
|
"Q",
|
|
"R",
|
|
"S",
|
|
"T",
|
|
"U",
|
|
"V",
|
|
"W",
|
|
"X",
|
|
"Y",
|
|
"Z"
|
|
];
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (searchParams.get("tab")) {
|
|
setActiveKey(searchParams.get("tab"));
|
|
}
|
|
getData();
|
|
getListData();
|
|
return () => {
|
|
clearTimeout(timer.current);
|
|
};
|
|
}, [location.pathname]);
|
|
const setConfirmValue = () => {
|
|
clearTimeout(timer.current);
|
|
timer.current = setTimeout(() => {
|
|
const { subject, task_pass } = form.getFieldsValue();
|
|
if (changeData.current.subject !== "") {
|
|
if (subject !== changeData.current.subject || task_pass !== changeData.current.task_pass) {
|
|
dispatch({
|
|
type: "practiceSetting/setSideBarTabs",
|
|
payload: { confirmLeave: true }
|
|
});
|
|
} else {
|
|
dispatch({
|
|
type: "practiceSetting/setSideBarTabs",
|
|
payload: { confirmLeave: false }
|
|
});
|
|
}
|
|
}
|
|
}, 500);
|
|
};
|
|
const handleValuesChange = (changedValues, values) => {
|
|
setFormValue(EditQuestion_spreadValues({}, values));
|
|
setConfirmValue();
|
|
};
|
|
const getData = () => EditQuestion_async(void 0, null, function* () {
|
|
setLoading(true);
|
|
const res = yield dispatch({
|
|
type: "shixunsDetail/getChallengesEdit",
|
|
payload: EditQuestion_spreadValues({}, params)
|
|
});
|
|
setEditChallengeData(EditQuestion_spreadValues({}, res));
|
|
changeData.current = { subject: res.subject, task_pass: (0,utils/* formatCodemirrorValue */.S)(res.task_pass), unity_3d_routes: res.unity_3d_routes };
|
|
setFormValue(EditQuestion_spreadValues({}, changeData.current));
|
|
form.setFieldsValue(EditQuestion_spreadValues({}, res));
|
|
setLoading(false);
|
|
});
|
|
const getListData = () => EditQuestion_async(void 0, null, function* () {
|
|
setListLoading(true);
|
|
const resList = yield (0,shixuns/* getQuestionList */.eb)(EditQuestion_spreadValues({}, params));
|
|
setDataList(resList.data);
|
|
setListLoading(false);
|
|
});
|
|
const handleFinish = (values) => EditQuestion_async(void 0, null, function* () {
|
|
const unity_3d = !values["unity_3d_routes"] || values["unity_3d_routes"] == "" ? false : true;
|
|
const param = EditQuestion_spreadProps(EditQuestion_spreadValues(EditQuestion_spreadValues({}, values), params), {
|
|
unity_3d_routes: unity_3d ? values["unity_3d_routes"] : null,
|
|
unity_3d
|
|
});
|
|
const res = yield (0,shixuns/* updateChallengesNew */.Rs)(param);
|
|
if (res.status === 0) {
|
|
message/* default */.ZP.success(res.message);
|
|
dispatch({
|
|
type: "practiceSetting/setSideBarTabs",
|
|
payload: { confirmLeave: false }
|
|
});
|
|
dispatch({ type: "practiceSetting/setUpdateIndex" });
|
|
setActiveKey("2");
|
|
initData();
|
|
}
|
|
});
|
|
const add = () => {
|
|
if (activeKey === "1")
|
|
return null;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mb10" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => setVisible(1), type: "primary", ghost: true }, "\u6DFB\u52A0\u9009\u62E9\u9898"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => setVisible(2), type: "primary", className: "ml20 mr20", ghost: true }, "\u6DFB\u52A0\u586B\u7A7A\u9898"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => setVisible(3), type: "primary", ghost: true }, "\u6DFB\u52A0\u5224\u65AD\u9898"));
|
|
};
|
|
const handleTabsClick = (key) => {
|
|
var _a2;
|
|
const toNext = () => {
|
|
setActiveKey(key);
|
|
initData();
|
|
dispatch({
|
|
type: "practiceSetting/setSideBarTabs",
|
|
payload: { confirmLeave: false }
|
|
});
|
|
};
|
|
if ((_a2 = practiceSetting == null ? void 0 : practiceSetting.sideBar) == null ? void 0 : _a2.confirmLeave) {
|
|
modal["default"].confirm({
|
|
title: "\u79BB\u5F00\u6B64\u9875\u63D0\u793A",
|
|
content: "\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",
|
|
okText: "\u79BB\u5F00",
|
|
cancelText: "\u53D6\u6D88",
|
|
onOk: () => {
|
|
toNext();
|
|
}
|
|
});
|
|
} else {
|
|
toNext();
|
|
}
|
|
};
|
|
const deleteList = (questionId) => {
|
|
const put = () => EditQuestion_async(void 0, null, function* () {
|
|
const res = yield (0,shixuns/* deleteChallengesQuestion */.Yn)(EditQuestion_spreadProps(EditQuestion_spreadValues({}, params), { questionId }));
|
|
if (res.challenge_id) {
|
|
getListData();
|
|
message/* default */.ZP.success("\u5220\u9664\u6210\u529F");
|
|
}
|
|
});
|
|
modal["default"].confirm({
|
|
title: "\u63D0\u793A",
|
|
content: "\u662F\u5426\u5220\u9664\u9898\u76EE!",
|
|
centered: true,
|
|
onOk: put
|
|
});
|
|
};
|
|
const upList = (questionId) => EditQuestion_async(void 0, null, function* () {
|
|
const res = yield (0,shixuns/* upChallengesQuestion */._9)(EditQuestion_spreadProps(EditQuestion_spreadValues({}, params), { questionId }));
|
|
if (res.status === 0) {
|
|
getListData();
|
|
}
|
|
});
|
|
const downList = (questionId) => EditQuestion_async(void 0, null, function* () {
|
|
const res = yield (0,shixuns/* downChallengesQuestion */.im)(EditQuestion_spreadProps(EditQuestion_spreadValues({}, params), { questionId }));
|
|
if (res.status === 0) {
|
|
getListData();
|
|
}
|
|
});
|
|
const editList = (questionId) => EditQuestion_async(void 0, null, function* () {
|
|
const res = yield (0,shixuns/* getEditChallengesQuestion */.UQ)(EditQuestion_spreadProps(EditQuestion_spreadValues({}, params), { questionId }));
|
|
setEditData(EditQuestion_spreadProps(EditQuestion_spreadValues({}, res), { choose_id: questionId }));
|
|
setVisible((res == null ? void 0 : res.question_name) === "\u5355\u9009\u9898/\u591A\u9009\u9898" ? 1 : (res == null ? void 0 : res.question_name) === "\u586B\u7A7A\u9898" ? 2 : 3);
|
|
});
|
|
const handleCancel = () => {
|
|
toExit();
|
|
};
|
|
const initData = () => {
|
|
setUpdateIndex(updateIndex + 1);
|
|
getData();
|
|
};
|
|
const toExit = () => {
|
|
var _a2;
|
|
const toNext = () => {
|
|
_umi_production_exports.history.push(`/shixuns/${id}/challenges`);
|
|
dispatch({
|
|
type: "practiceSetting/setSideBarTabs",
|
|
payload: { confirmLeave: false }
|
|
});
|
|
};
|
|
if ((_a2 = practiceSetting == null ? void 0 : practiceSetting.sideBar) == null ? void 0 : _a2.confirmLeave) {
|
|
modal["default"].confirm({
|
|
title: "\u79BB\u5F00\u6B64\u9875\u63D0\u793A",
|
|
content: "\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",
|
|
okText: "\u79BB\u5F00",
|
|
cancelText: "\u53D6\u6D88",
|
|
onOk: () => {
|
|
toNext();
|
|
}
|
|
});
|
|
} else {
|
|
toNext();
|
|
}
|
|
};
|
|
const renderQuestionList = () => {
|
|
return dataList.map((item, index) => {
|
|
const { challenge_choose_id, subject, choose_contents, standard_answer, answer, score, category, question_name, standard_answers } = item;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: challenge_choose_id, className: EditQuestionmodules.list }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.top }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.left }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.title }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.fs }, index + 1, ". "), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: subject })), question_name === "\u5355\u9009\u9898/\u591A\u9009\u9898" && (choose_contents == null ? void 0 : choose_contents.map((e, i) => /* @__PURE__ */ _react_17_0_2_react.createElement("ul", { key: i, className: e.right_key ? EditQuestionmodules.qsActive : EditQuestionmodules.qs }, /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, End[e.position]), /* @__PURE__ */ _react_17_0_2_react.createElement("li", null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: e.option_name }))))), question_name === "\u5224\u65AD\u9898" && /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default.Group */.ZP.Group, { className: "mb10", buttonStyle: "solid", value: standard_answer }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: "\u6B63\u786E", className: `${EditQuestionmodules.radio} mr40` }, "\u6B63\u786E"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { value: "\u9519\u8BEF", className: EditQuestionmodules.radio }, "\u9519\u8BEF"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.right }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => editList(challenge_choose_id), className: "iconfont icon-xiaoxiugai" }), /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => deleteList(challenge_choose_id), className: "iconfont icon-shanchu23" }), index !== dataList.length - 1 && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => downList(challenge_choose_id), className: "iconfont icon-xiayi2" }), index !== 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { onClick: () => upList(challenge_choose_id), className: "iconfont icon-shangyi2" }))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.bt }, "\u9898\u578B\uFF1A", question_name, "\xA0\xA0\xA0\xA0\u5956\u52B1\u91D1\u5E01\uFF1A", score), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.answer }, question_name === "\u586B\u7A7A\u9898" ? standard_answers == null ? void 0 : standard_answers.map((e, i) => {
|
|
var _a2;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("p", { key: i }, "\u586B\u7A7A", i + 1, "\uFF1A", (_a2 = e == null ? void 0 : e.text) == null ? void 0 : _a2.join("\u3001"));
|
|
}) : /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\u6807\u51C6\u7B54\u6848\uFF1A", standard_answer), /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.fs }, "\u53C2\u8003\u7B54\u6848\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: answer }))));
|
|
});
|
|
};
|
|
const onOk = () => {
|
|
setVisible(false);
|
|
setEditData(null);
|
|
getListData();
|
|
};
|
|
const onCancel = () => {
|
|
setVisible(false);
|
|
setEditData(null);
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: EditQuestionmodules.bg, style: { marginBottom: activeKey === "1" ? 67 : 0 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { activeKey, onChange: handleTabsClick, tabBarExtraContent: add() }, /* @__PURE__ */ _react_17_0_2_react.createElement(TabPane, { tab: "\u672C\u5173\u4EFB\u52A1", key: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
key: updateIndex,
|
|
form,
|
|
scrollToFirstError: true,
|
|
className: EditQuestionmodules.formWrap,
|
|
layout: "vertical",
|
|
onValuesChange: handleValuesChange,
|
|
onFinish: handleFinish
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.fieldWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { initialValue: "", name: "subject", label: "\u4EFB\u52A1\u540D\u79F0:", rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0" }] }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { bordered: false, maxLength: 60, suffix: `${((_a = formValue.subject) == null ? void 0 : _a.length) || 0}/60`, placeholder: "\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A" }))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.mdWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "task_pass",
|
|
label: "\u4EFB\u52A1\u8981\u6C42:",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB" },
|
|
{ max: 35e3, message: "\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26" }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(markdown_editor/* default */.Z, { key: params.challengesId || "3", watch: true, defaultValue: challengesEdit.task_pass })
|
|
)),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { noStyle: true }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
FixedButton/* FixedButton */.t,
|
|
{
|
|
okButtonProps: {
|
|
htmlType: "submit"
|
|
},
|
|
className: "customFixedButton",
|
|
onCancel: handleCancel
|
|
}
|
|
)),
|
|
(0,authority/* isCommonSuperAdminOrOperation */.ag)() && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.fieldWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { initialValue: "", name: "unity_3d_routes", label: "\u5D4C\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0:" }, /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { bordered: false, maxLength: 60, suffix: `${((_b = formValue.unity_3d_routes) == null ? void 0 : _b.length) || 0}/60`, placeholder: "\u8BF7\u8F93\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0\u5730\u5740" })))
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement(TabPane, { tab: "\u9898\u76EE", key: "2" }, !!dataList.length && renderQuestionList(), !dataList.length && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: EditQuestionmodules.empty }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: ImagesIcon/* emptyIcon */.x7, width: "258" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-c" }, "\u8BF7\u70B9\u51FB\u53F3\u4E0A\u89D2\u6DFB\u52A0\u9898\u76EE\u6309\u94AE\u8FDB\u884C\u9898\u76EE\u7684\u521B\u5EFA! ")))), !!visible && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
components_AddQuestion,
|
|
{
|
|
is_published,
|
|
visible,
|
|
onCancel,
|
|
onOk,
|
|
editData
|
|
}
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(Loading/* default */.Z, { loading }));
|
|
};
|
|
/* harmony default export */ var EditQuestion = ((0,_umi_production_exports.connect)(
|
|
({
|
|
shixunsDetail,
|
|
newCourse,
|
|
globalSetting,
|
|
practiceSetting
|
|
}) => ({
|
|
shixunsDetail,
|
|
newCourse,
|
|
globalSetting,
|
|
practiceSetting
|
|
})
|
|
)(NewCoursePage));
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 43266:
|
|
/*!***********************************************************************************************!*\
|
|
!*** ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.tsx + 1 modules ***!
|
|
\***********************************************************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ components_Loading; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
var spin = __webpack_require__(71418);
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var Loadingmodules = ({"loading":"loading___lueiN"});
|
|
;// CONCATENATED MODULE: ./src/pages/Shixuns/Edit/body/Level/Challenges/components/Loading/index.tsx
|
|
|
|
|
|
|
|
const Loading = ({
|
|
loading
|
|
}) => {
|
|
return loading ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Loadingmodules.loading }, /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, null)) : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null);
|
|
};
|
|
/* harmony default export */ var components_Loading = (Loading);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 65464:
|
|
/*!************************************************!*\
|
|
!*** ./src/pages/Shixuns/Edit/utils/index.tsx ***!
|
|
\************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ S: function() { return /* binding */ formatCodemirrorValue; }
|
|
/* harmony export */ });
|
|
const formatCodemirrorValue = (value) => {
|
|
let dom = document.createElement("textarea");
|
|
dom.value = value;
|
|
return dom.value;
|
|
};
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |