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.
1427 lines
72 KiB
1427 lines
72 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[45992],{
|
|
|
|
/***/ 77068:
|
|
/*!*****************************************!*\
|
|
!*** ./src/components/NoData/index.tsx ***!
|
|
\*****************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_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_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/assets/images/icons/nodata.png */ 93314);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 3113);
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var noData = function noData(_ref) {
|
|
var img = _ref.img,
|
|
_ref$buttonProps = _ref.buttonProps,
|
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
_ref$styles = _ref.styles,
|
|
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
|
customText = _ref.customText,
|
|
ButtonText = _ref.ButtonText,
|
|
ButtonClick = _ref.ButtonClick,
|
|
Buttonclass = _ref.Buttonclass,
|
|
ButtonTwo = _ref.ButtonTwo,
|
|
imgStyles = _ref.imgStyles,
|
|
_ref$loading = _ref.loading,
|
|
loading = _ref$loading === void 0 ? false : _ref$loading;
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("section", {
|
|
className: "tc animated fadeIn",
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, {
|
|
color: '#999',
|
|
margin: '100px auto',
|
|
visibility: loading ? 'hidden' : 'visible'
|
|
}), styles),
|
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
|
|
src: img || _assets_images_icons_nodata_png__WEBPACK_IMPORTED_MODULE_2__,
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, imgStyles), {}, {
|
|
pointerEvents: "none",
|
|
userSelect: "none"
|
|
})
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
|
|
className: "mt20 font14",
|
|
children: customText || '暂时还没有相关数据哦!'
|
|
}), ButtonText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({
|
|
className: Buttonclass,
|
|
onClick: ButtonClick
|
|
}, buttonProps), {}, {
|
|
children: ButtonText
|
|
})), ButtonTwo && ButtonTwo]
|
|
});
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = (noData);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 49714:
|
|
/*!*********************************************************!*\
|
|
!*** ./src/components/PreviewAll/index.tsx + 1 modules ***!
|
|
\*********************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
Z: function() { return /* binding */ PreviewAll; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var PreviewAllmodules = ({"wrp":"wrp___dq7YK","bgBlack":"bgBlack___ARIUV","monaco":"monaco___VnZC3","darkBlue":"darkBlue___UprA9","close":"close___LKoWu","embed":"embed___hvpEJ"});
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
var es_button = __webpack_require__(3113);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.3@@ant-design/icons/es/icons/ArrowDownOutlined.js + 1 modules
|
|
var ArrowDownOutlined = __webpack_require__(42846);
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
|
|
var monaco_editor = __webpack_require__(32598);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(63834);
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
var exercise = __webpack_require__(39935);
|
|
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
|
|
var NoData = __webpack_require__(77068);
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(33259);
|
|
// EXTERNAL MODULE: ./src/service/attachment.ts
|
|
var attachment = __webpack_require__(82284);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/components/PreviewAll/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var PreviewAll = (function (_ref) {
|
|
var _data, _data2, _data3, _data4, _data5, _data6;
|
|
var _ref$editOffice = _ref.editOffice,
|
|
editOffice = _ref$editOffice === void 0 ? 'view' : _ref$editOffice,
|
|
data = _ref.data,
|
|
theme = _ref.theme,
|
|
type = _ref.type,
|
|
filename = _ref.filename,
|
|
monacoEditor = _ref.monacoEditor,
|
|
className = _ref.className,
|
|
style = _ref.style,
|
|
close = _ref.close,
|
|
onClose = _ref.onClose,
|
|
hasMask = _ref.hasMask,
|
|
disabledDownload = _ref.disabledDownload,
|
|
onImgDimensions = _ref.onImgDimensions,
|
|
showNodata = _ref.showNodata,
|
|
recordInfo = _ref.recordInfo;
|
|
var _useState = (0,_react_17_0_2_react.useState)('https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt'),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
src = _useState2[0],
|
|
setSrc = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(""),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
token = _useState4[0],
|
|
setToken = _useState4[1];
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
officeData = _useState6[0],
|
|
setOfficeData = _useState6[1];
|
|
var officePath = window.ENV === "build" ? "/react/build" : "";
|
|
var apiServer = location.host.startsWith("localhost") ? env/* default */.Z.PROXY_SERVER : env/* default */.Z.API_SERVER;
|
|
// let size;
|
|
var unit = 1024 * 1024;
|
|
var maxSize = 10 * unit;
|
|
var closeRef = (0,_react_17_0_2_react.useRef)();
|
|
if ((_data = data) !== null && _data !== void 0 && _data.startsWith("/api") && type !== "txt") {
|
|
data = env/* default */.Z.API_SERVER + data;
|
|
}
|
|
var getFileExtension = function getFileExtension(url) {
|
|
var filename = url.substring(url.lastIndexOf('/') + 1);
|
|
var extension = filename.split('.').pop();
|
|
return extension;
|
|
};
|
|
if (filename) monacoEditor.filename = filename;
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
var _document$cookie;
|
|
var cookies = (_document$cookie = document.cookie) === null || _document$cookie === void 0 || (_document$cookie = _document$cookie.replace(/\s/g, "")) === null || _document$cookie === void 0 ? void 0 : _document$cookie.split(";");
|
|
cookies === null || cookies === void 0 || cookies.map(function (item) {
|
|
var i = item.split("=");
|
|
if (i[0] === '_educoder_session') {
|
|
setToken(i[1]);
|
|
}
|
|
});
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
if (type === "office") {
|
|
if (data.indexOf("bigfilescdn.") > -1 || data.indexOf("bigfiles1") > -1) {
|
|
setOfficeData({
|
|
url: data,
|
|
fileType: getFileExtension(data),
|
|
model: data.indexOf("model=edit") ? "edit" : "view"
|
|
});
|
|
} else {
|
|
getData();
|
|
}
|
|
}
|
|
}, [type, data]);
|
|
var getData = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
var _url, _id, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
console.log("data:", data);
|
|
_url = data;
|
|
if (!data.startsWith("http")) {
|
|
_url = location.origin + _url;
|
|
}
|
|
_id = new URL(_url).pathname.split("/").pop();
|
|
_context.next = 6;
|
|
return (0,exercise/* setEcsAttachment */.gJ)({
|
|
attachment_id: _id
|
|
});
|
|
case 6:
|
|
res = _context.sent;
|
|
res.url = apiServer + res.url;
|
|
setOfficeData(res);
|
|
case 9:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function getData() {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleClick = function handleClick() {
|
|
if (data.startsWith("http") || data.startsWith('blob:')) {
|
|
handleDown();
|
|
return;
|
|
}
|
|
(0,util/* downloadFile */.Sv)(filename || 'educoder', data, filename);
|
|
};
|
|
var handleDown = function handleDown() {
|
|
if (recordInfo) {
|
|
// 教学资料--点击下载资料时记录下载信息
|
|
(0,attachment/* add_file_quantity */.fc)({
|
|
id: recordInfo === null || recordInfo === void 0 ? void 0 : recordInfo.id,
|
|
watch_type: 1,
|
|
course_id: recordInfo === null || recordInfo === void 0 ? void 0 : recordInfo.course_id
|
|
});
|
|
}
|
|
(0,util/* downLoadLink */.Nd)(filename || 'educoder', decodeURIComponent(data));
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
style: objectSpread2_default()({}, style || {}),
|
|
className: "".concat(hasMask && PreviewAllmodules.bgBlack, " ").concat(!!type ? PreviewAllmodules.wrp : "hide"),
|
|
children: [close && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: PreviewAllmodules.close,
|
|
ref: closeRef,
|
|
children: [!!onImgDimensions && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",
|
|
getPopupContainer: function getPopupContainer() {
|
|
return closeRef.current;
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: function onClick() {
|
|
onClose();
|
|
onImgDimensions();
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon-yulanpizhu"
|
|
})
|
|
})
|
|
}), !disabledDownload && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",
|
|
getPopupContainer: function getPopupContainer() {
|
|
return closeRef.current;
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
onClick: handleDown,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon-quxiaozhiding"
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
title: "\u5173\u95ED",
|
|
getPopupContainer: function getPopupContainer() {
|
|
return closeRef.current;
|
|
},
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "",
|
|
onClick: onClose,
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "icon-guanbi1"
|
|
})
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: "".concat(PreviewAllmodules[className], " ").concat(className, " ").concat(PreviewAllmodules.monaco, " ").concat(type === "txt" ? "show" : "hide"),
|
|
children: type === "txt" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, objectSpread2_default()({}, monacoEditor))
|
|
})
|
|
}), type === "audio" && /*#__PURE__*/(0,jsx_runtime.jsx)("audio", {
|
|
src: "".concat(((_data2 = data) === null || _data2 === void 0 ? void 0 : _data2.indexOf("http://")) > -1 || ((_data3 = data) === null || _data3 === void 0 ? void 0 : _data3.indexOf("https://")) > -1 ? "" : "data:audio/mp3;base64,").concat(data),
|
|
autoPlay: true
|
|
}), type === "video" && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: ((_data4 = data) === null || _data4 === void 0 ? void 0 : _data4.indexOf("http")) > -1 ? /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
controls: true,
|
|
src: "".concat(data),
|
|
autoPlay: true
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
|
|
controls: true,
|
|
src: "data:video/mp4;base64,".concat(data),
|
|
autoPlay: true
|
|
})
|
|
}), type === 'office' && officeData && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
src: "".concat(officePath, "/office.html?key=").concat(officeData.key, "&url=").concat(btoa(officeData.url), "&callbackUrl=").concat(apiServer + officeData.callbackUrl, "&fileType=").concat(officeData.fileType, "&title=").concat(officeData.title, "&model=").concat(editOffice, "&officeServer=").concat(env/* default */.Z.ONLYOFFICE, "&disabledDownload=").concat(!!disabledDownload)
|
|
}), type === 'html' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
src: data + '&disposition=inline'
|
|
}), type === 'pdf' && /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
src: "".concat(officePath, "/js/pdfview/index.html?url=").concat(data, "&disabledDownload=").concat(!!disabledDownload)
|
|
}) //<embed className={styles.embed + "#toolbar=0"} src={data} />
|
|
, type === "image" && /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
src: "".concat(((_data5 = data) === null || _data5 === void 0 ? void 0 : _data5.indexOf("http://")) > -1 || ((_data6 = data) === null || _data6 === void 0 ? void 0 : _data6.indexOf("https://")) > -1 ? "" : "data:image/png;base64,").concat(data)
|
|
}), (type === "other" || type === "download") && /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
children: showNodata ? /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {
|
|
customText: "\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",
|
|
ButtonTwo: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
className: "iconfont icon-xiazai4 font14"
|
|
}),
|
|
type: "primary",
|
|
size: 'middle',
|
|
onClick: handleClick,
|
|
children: "\u4E0B\u8F7D"
|
|
})
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
type: "primary",
|
|
size: 'middle',
|
|
onClick: handleClick,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ArrowDownOutlined/* default */.Z, {}), "\u70B9\u51FB\u4E0B\u8F7D"]
|
|
})
|
|
})]
|
|
});
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 52961:
|
|
/*!*********************************************!*\
|
|
!*** ./src/components/RenderHtml/index.tsx ***!
|
|
\*********************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_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_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js */ 37205);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/createForOfIteratorHelper.js */ 91232);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var katex_dist_katex_min_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! katex/dist/katex.min.css */ 97762);
|
|
/* harmony import */ var _utils_marked__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/marked */ 37598);
|
|
/* harmony import */ var code_prettify__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! code-prettify */ 64018);
|
|
/* harmony import */ var code_prettify__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(code_prettify__WEBPACK_IMPORTED_MODULE_7__);
|
|
/* harmony import */ var hls_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! hls.js */ 70169);
|
|
/* harmony import */ var _utils_env__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/env */ 33259);
|
|
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! katex */ 15342);
|
|
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_10__);
|
|
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! uuid */ 1012);
|
|
/* harmony import */ var _components_PreviewAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/PreviewAll */ 49714);
|
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ 37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ADD_MULTI = '@▁▁@';
|
|
var ADD_SINGLE = '@▁@';
|
|
var preRegex = /<pre[^>]*>/g;
|
|
function _unescape(str) {
|
|
var div = document.createElement('div');
|
|
div.innerHTML = str;
|
|
return div.childNodes.length === 0 ? '' : div.childNodes[0].nodeValue;
|
|
}
|
|
/* harmony default export */ __webpack_exports__.Z = (function (_ref) {
|
|
var _ref$value = _ref.value,
|
|
value = _ref$value === void 0 ? '' : _ref$value,
|
|
className = _ref.className,
|
|
showTextOnly = _ref.showTextOnly,
|
|
showLines = _ref.showLines,
|
|
_ref$style = _ref.style,
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
_ref$stylesPrev = _ref.stylesPrev,
|
|
stylesPrev = _ref$stylesPrev === void 0 ? {} : _ref$stylesPrev,
|
|
highlightKeywords = _ref.highlightKeywords,
|
|
showProgramFill = _ref.showProgramFill,
|
|
isProgramFill = _ref.isProgramFill,
|
|
_ref$disabledFill = _ref.disabledFill,
|
|
disabledFill = _ref$disabledFill === void 0 ? false : _ref$disabledFill,
|
|
programFillValue = _ref.programFillValue,
|
|
_ref$onFillChange = _ref.onFillChange,
|
|
onFillChange = _ref$onFillChange === void 0 ? function (value) {} : _ref$onFillChange,
|
|
_ref$onFillBlur = _ref.onFillBlur,
|
|
onFillBlur = _ref$onFillBlur === void 0 ? function () {} : _ref$onFillBlur;
|
|
var str = String(value);
|
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(""),
|
|
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
|
|
data = _useState2[0],
|
|
setData = _useState2[1];
|
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)("office"),
|
|
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState3, 2),
|
|
type = _useState4[0],
|
|
setType = _useState4[1];
|
|
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]),
|
|
_useState6 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState5, 2),
|
|
projectValue = _useState6[0],
|
|
setProjectValue = _useState6[1];
|
|
var classNamesRef = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)("a" + (0,uuid__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z)());
|
|
var formObj = {};
|
|
var createInput = function createInput(a, num) {
|
|
// const wrap = document.createElement("span")
|
|
// wrap.className =
|
|
var input = document.createElement(a === ADD_SINGLE ? "input" : "textarea");
|
|
input.style.width = "100%";
|
|
input.style.height = a === ADD_SINGLE ? "40px" : "151px";
|
|
input.rows = 5;
|
|
input.spellcheck = false;
|
|
input.name = "edu-program-fill";
|
|
input.placeholder = "请输入";
|
|
input.dataset.id = num;
|
|
var key = Object.keys(formObj).length;
|
|
formObj[key] = input;
|
|
return "<span class=\"edu-program-fill-wrap ".concat(a === ADD_SINGLE ? "" : "show", "\" style=\"width:").concat(a === ADD_SINGLE ? "200px" : "100%", "\"><span>").concat(input.outerHTML, "<span class=\"edu-program-fill-score\"></span></span></span>");
|
|
};
|
|
var formatMD = function formatMD(rs) {
|
|
return rs.replace(/<style.*?>([\s\S]+?)<\/style>/gim, function (_, css) {
|
|
var _css = css.replace(/(\n|\r)/g, "").split("}");
|
|
var arr = [];
|
|
_css.map(function (item) {
|
|
if (item != '') {
|
|
arr.push(".".concat(classNamesRef.current, " ").concat(item));
|
|
}
|
|
});
|
|
return "<style>".concat(arr.join("}"), "</style>");
|
|
});
|
|
};
|
|
var html = (0,react__WEBPACK_IMPORTED_MODULE_4__.useMemo)(function () {
|
|
try {
|
|
var reg = /\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g;
|
|
var reg2 = /\"\/api\/attachments\/|\"\/attachments\/download\//g;
|
|
var reg3 = /\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;
|
|
str = str.replace(reg, "(" + _utils_env__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.API_SERVER + "/api/attachments/").replace(reg2, '"' + _utils_env__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.API_SERVER + "/api/attachments/").replace(reg3, '"' + _utils_env__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Z.API_SERVER + "/files/uploads/").replaceAll("http://video.educoder", "https://video.educoder").replaceAll("http://www.educoder.net/api", "https://data.educoder.net/api").replaceAll("https://www.educoder.net/api", "https://data.educoder.net/api").replace(/\r\n/g, "\n");
|
|
// str = str.replace(new RegExp("(?<!\\n)\\n(?!\\n)", "g"), " \n")
|
|
} catch (e) {}
|
|
;
|
|
if (showProgramFill) {
|
|
var num = -1;
|
|
str = str.replaceAll("<", "<").replaceAll(">", ">").replace(/(@▁▁@|@▁@)/g, function (a, b, c) {
|
|
++num;
|
|
return createInput(a, num);
|
|
});
|
|
return "<pre style=\"background:#fff;padding:4px\">".concat(formatMD(str || ""), "</pre>");
|
|
}
|
|
var rs = formatMD(str);
|
|
rs = (0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .ZP)(rs);
|
|
var math_expressions = (0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .getMathExpressions */ .ez)();
|
|
if (str.match(/\[TOC\]/)) {
|
|
rs = rs.replace('<p>[TOC]</p>', (0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .getTocContent */ .Qv)());
|
|
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .cleanToc */ .Iy)();
|
|
}
|
|
rs = rs.replace(/(__special_katext_id_\d+__)/g, function (_match, capture) {
|
|
var _math_expressions$cap = math_expressions[capture],
|
|
type = _math_expressions$cap.type,
|
|
expression = _math_expressions$cap.expression;
|
|
return (0,katex__WEBPACK_IMPORTED_MODULE_10__.renderToString)(_unescape(expression) || '', {
|
|
displayMode: type === 'block',
|
|
throwOnError: false,
|
|
output: 'html'
|
|
});
|
|
});
|
|
rs = rs.replace(/▁/g, '▁▁▁');
|
|
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .resetMathExpressions */ .AL)();
|
|
// return dompurify.sanitize(rs)
|
|
var dom = document.createElement('div');
|
|
dom.innerHTML = rs;
|
|
if (highlightKeywords) {
|
|
var escapedKeywords = highlightKeywords.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
findKeyword(dom, escapedKeywords);
|
|
return dom.innerHTML;
|
|
}
|
|
if (showTextOnly) {
|
|
return dom.innerText;
|
|
}
|
|
setTimeout(function () {
|
|
return onLoad();
|
|
}, 500);
|
|
return dom.innerHTML;
|
|
}, [str, highlightKeywords]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
|
|
if (el.current) {
|
|
var inputs = el.current.querySelectorAll(["input", "textarea"]);
|
|
inputs.forEach(function (input) {
|
|
input.oninput = onInput;
|
|
input.onblur = onBlur;
|
|
});
|
|
}
|
|
}, [projectValue]);
|
|
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
|
|
if (!!(programFillValue !== null && programFillValue !== void 0 && programFillValue.length)) {
|
|
try {
|
|
var scoreDom = el.current.querySelectorAll(".edu-program-fill-score");
|
|
var dom = el.current.querySelectorAll('[name="edu-program-fill"]');
|
|
var _iterator = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2___default()(dom.entries()),
|
|
_step;
|
|
try {
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
var _programFillValue$k;
|
|
var _step$value = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_step.value, 2),
|
|
k = _step$value[0],
|
|
i = _step$value[1];
|
|
i.value = (_programFillValue$k = programFillValue[k]) === null || _programFillValue$k === void 0 ? void 0 : _programFillValue$k.value;
|
|
if (programFillValue[k].type === "warning") {
|
|
i.className = "program-fill-warning";
|
|
} else if (programFillValue[k].type === "success") {
|
|
i.className = "program-fill-success";
|
|
} else {
|
|
i.className = "";
|
|
}
|
|
}
|
|
} catch (err) {
|
|
_iterator.e(err);
|
|
} finally {
|
|
_iterator.f();
|
|
}
|
|
var _iterator2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_createForOfIteratorHelper_js__WEBPACK_IMPORTED_MODULE_2___default()(scoreDom.entries()),
|
|
_step2;
|
|
try {
|
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
var _programFillValue$_k, _programFillValue$_k2;
|
|
var _step2$value = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_step2.value, 2),
|
|
_k = _step2$value[0],
|
|
_i = _step2$value[1];
|
|
_i.innerHTML = (_programFillValue$_k = programFillValue[_k]) !== null && _programFillValue$_k !== void 0 && _programFillValue$_k.score ? "".concat((_programFillValue$_k2 = programFillValue[_k]) === null || _programFillValue$_k2 === void 0 ? void 0 : _programFillValue$_k2.score, "\u5206") : "";
|
|
}
|
|
} catch (err) {
|
|
_iterator2.e(err);
|
|
} finally {
|
|
_iterator2.f();
|
|
}
|
|
setProjectValue(programFillValue);
|
|
} catch (error) {}
|
|
}
|
|
}, [programFillValue]);
|
|
var onInput = function onInput(e) {
|
|
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
|
|
projectValue[e.target.dataset.id]["value"] = e.target.value;
|
|
setProjectValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(projectValue));
|
|
onFillChange(projectValue, e.target.dataset.id);
|
|
};
|
|
var onBlur = function onBlur(e) {
|
|
projectValue[e.target.dataset.id] = projectValue[e.target.dataset.id] || {};
|
|
projectValue[e.target.dataset.id]["value"] = e.target.value;
|
|
setProjectValue(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(projectValue));
|
|
onFillBlur(projectValue, e.target.dataset.id);
|
|
};
|
|
function findKeyword(node, keyword) {
|
|
return node.childNodes.forEach(function (childNode) {
|
|
if (childNode.childNodes.length > 0) {
|
|
findKeyword(childNode, keyword);
|
|
} else if (childNode.nodeName !== "IMG") {
|
|
if (childNode.innerHTML) {
|
|
var _childNode$innerHTML;
|
|
childNode.innerHTML = (_childNode$innerHTML = childNode.innerHTML) === null || _childNode$innerHTML === void 0 ? void 0 : _childNode$innerHTML.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
|
|
} else {
|
|
var dom = document.createElement("span");
|
|
dom.innerHTML = childNode.textContent.replace(new RegExp(keyword, "gi"), '<span style="color:#0152d9;background-color:#1890ff33">$&</span>');
|
|
childNode.replaceWith(dom);
|
|
}
|
|
}
|
|
});
|
|
|
|
// return dom.childNodes.forEach((node:any) => {
|
|
// console.log("nodeLen:",node.childNodes.length)
|
|
// if(node.childNodes.length > 0){
|
|
// debugger
|
|
// // findKeyword(dom.childNodes,keyword)
|
|
// }else{
|
|
// if(node.nodeName !== "#text"){
|
|
// node.innerHTML = node.innerHTML.replaceAll(keyword,`<span class="c-blue">${keyword}</span>`)
|
|
// console.log("node:",node,dom,node.nodeName,node.innerHTML,node.childNodes.length)
|
|
// debugger
|
|
// }
|
|
// }
|
|
|
|
// return node
|
|
// });
|
|
}
|
|
var el = (0,react__WEBPACK_IMPORTED_MODULE_4__.useRef)();
|
|
_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .lines */ .jb['WebkitLineClamp'] = showLines;
|
|
if (showLines) {
|
|
style = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, style), _utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .lines */ .jb);
|
|
}
|
|
function onAncherHandler(e) {
|
|
var target = e.target;
|
|
if (target.tagName.toUpperCase() === 'A') {
|
|
var ancher = target.getAttribute('href');
|
|
if (ancher.indexOf("office") > -1) {
|
|
e.preventDefault();
|
|
setData(ancher);
|
|
setType("office");
|
|
} else if (ancher.indexOf("application/pdf") > -1) {
|
|
e.preventDefault();
|
|
setData(ancher);
|
|
setType("pdf");
|
|
} else if (ancher.indexOf("text/html") > -1) {
|
|
e.preventDefault();
|
|
setData(ancher);
|
|
setType("html");
|
|
} else if (ancher.startsWith('#')) {
|
|
e.preventDefault();
|
|
var viewEl = document.getElementById(ancher.replace('#', ''));
|
|
if (viewEl) {
|
|
viewEl.scrollIntoView(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var onLoad = function onLoad() {
|
|
var _el$current;
|
|
var videoElement = (_el$current = el.current) === null || _el$current === void 0 ? void 0 : _el$current.querySelectorAll('video');
|
|
videoElement === null || videoElement === void 0 || videoElement.forEach(function (item) {
|
|
item.oncontextmenu = function () {
|
|
return false;
|
|
};
|
|
if (item.src.indexOf('.m3u8') > -1) {
|
|
if (item.canPlayType('application/vnd.apple.mpegurl')) {} else if (hls_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"].isSupported */ .ZP.isSupported()) {
|
|
var hls = new hls_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .ZP();
|
|
hls.loadSource(item.src);
|
|
hls.attachMedia(item);
|
|
}
|
|
}
|
|
});
|
|
};
|
|
(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)(function () {
|
|
if (el.current && html) {
|
|
if (html.match(preRegex)) {
|
|
window.PR.prettyPrint();
|
|
}
|
|
}
|
|
if (el.current) {
|
|
el.current.addEventListener('click', onAncherHandler);
|
|
return function () {
|
|
var _el$current2;
|
|
(_el$current2 = el.current) === null || _el$current2 === void 0 || _el$current2.removeEventListener('click', onAncherHandler);
|
|
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .resetMathExpressions */ .AL)();
|
|
(0,_utils_marked__WEBPACK_IMPORTED_MODULE_6__/* .cleanToc */ .Iy)();
|
|
};
|
|
}
|
|
}, [html, el.current, onAncherHandler]);
|
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.Fragment, {
|
|
children: [showTextOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
|
|
ref: el,
|
|
children: html
|
|
}), !showTextOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
|
|
ref: el,
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, style),
|
|
className: "".concat(className ? className : '', " ").concat(disabledFill ? "disabled-fill" : "", " markdown-body ").concat(classNamesRef.current),
|
|
dangerouslySetInnerHTML: {
|
|
__html: html
|
|
}
|
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_components_PreviewAll__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z, {
|
|
close: true,
|
|
data: data,
|
|
type: !!(data !== null && data !== void 0 && data.length) ? type : "",
|
|
style: _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, stylesPrev),
|
|
onClose: function onClose() {
|
|
return setData("");
|
|
}
|
|
})]
|
|
});
|
|
});
|
|
|
|
/***/ }),
|
|
|
|
/***/ 31793:
|
|
/*!*******************************************************************************!*\
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/ReviewGroup/index.tsx + 2 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 */ ReviewGroup; }
|
|
});
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
var slicedToArray = __webpack_require__(79800);
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
|
|
var objectWithoutProperties = __webpack_require__(39647);
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
// 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 + 15 modules
|
|
var _umi_production_exports = __webpack_require__(8931);
|
|
// 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/input-number/index.js + 14 modules
|
|
var input_number = __webpack_require__(97913);
|
|
// 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/breadcrumb/index.js + 6 modules
|
|
var breadcrumb = __webpack_require__(66104);
|
|
// 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/divider/index.js + 1 modules
|
|
var divider = __webpack_require__(28103);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/anchor/index.js + 4 modules
|
|
var es_anchor = __webpack_require__(79817);
|
|
// 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__(68782);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.3.3@@ant-design/icons/es/icons/ArrowLeftOutlined.js + 1 modules
|
|
var ArrowLeftOutlined = __webpack_require__(64509);
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
var service_exercise = __webpack_require__(39935);
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
var RenderHtml = __webpack_require__(52961);
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ReviewGroup/component/SeeAnswer.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var SeeAnswer = function SeeAnswer(_ref) {
|
|
var data = _ref.data;
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
show = _useState2[0],
|
|
setShow = _useState2[1];
|
|
var renderDom = function renderDom() {
|
|
var _data$standard_answer;
|
|
switch (data.question_type) {
|
|
case 3:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
cursor: "pointer"
|
|
},
|
|
className: "font12 c-blue",
|
|
onClick: function onClick() {
|
|
setShow(!show);
|
|
},
|
|
children: show ? "隐藏参考答案" : "查看参考答案"
|
|
}), show && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: data === null || data === void 0 || (_data$standard_answer = data.standard_answer) === null || _data$standard_answer === void 0 ? void 0 : _data$standard_answer.map(function (item, key) {
|
|
var _item$answer_text;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
className: "mt10",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: "50px",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "mt10",
|
|
children: ["\u586B\u7A7A", item.choice_id]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
flex: 1,
|
|
children: item === null || item === void 0 || (_item$answer_text = item.answer_text) === null || _item$answer_text === void 0 ? void 0 : _item$answer_text.map(function (val, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
style: {
|
|
border: "1px solid #eee",
|
|
padding: "15px 10px 0 10px"
|
|
},
|
|
children: val
|
|
});
|
|
})
|
|
})]
|
|
});
|
|
})
|
|
})]
|
|
});
|
|
break;
|
|
case 4:
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
cursor: "pointer"
|
|
},
|
|
className: "font12 c-blue",
|
|
onClick: function onClick() {
|
|
setShow(!show);
|
|
},
|
|
children: show ? "隐藏参考答案" : "查看参考答案"
|
|
}), show && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: data.standard_answer.join(" ")
|
|
})
|
|
})]
|
|
});
|
|
break;
|
|
}
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("section", {
|
|
children: renderDom()
|
|
});
|
|
};
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ReviewGroup/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var ReviewGroupmodules = ({"flex_box_center":"flex_box_center___rZhUX","flex_space_between":"flex_space_between___WSWPP","flex_box_vertical_center":"flex_box_vertical_center___Fl2CQ","flex_box_center_end":"flex_box_center_end___zIA_L","flex_box_column":"flex_box_column___wpPM2","bg":"bg___PTvAX","title":"title___NRpL_","questionIcons":"questionIcons___qftEo","green":"green___DII_f","orange":"orange___nqaHJ","greenTip":"greenTip___NQ5fc","redTip":"redTip___BYmiY","orangeTip":"orangeTip___wlzcb","cuttOff":"cuttOff___Y19D3"});
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(63834);
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ReviewGroup/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["exercise", "globalSetting", "loading", "user", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var questionType = ['单选题', '多选题', '判断题', '填空题', '简答题', '实训题'];
|
|
var ExeriseReview = function ExeriseReview(_ref) {
|
|
var _user$userInfo3, _userInfo$course, _reviewGroupExercise$, _reviewGroupExercise$2, _reviewGroupExercise$3, _reviewGroupExercise$4, _reviewGroupExercise$5, _reviewGroupExercise$6, _reviewGroupExercise$7, _reviewGroupExercise$8, _reviewGroupExercise$9, _reviewGroupExercise$10, _reviewGroupExercise$11, _reviewGroupExercise$12, _reviewGroupExercise$13, _reviewGroupExercise$14, _reviewGroupExercise$15, _reviewGroupExercise$16;
|
|
var exercise = _ref.exercise,
|
|
globalSetting = _ref.globalSetting,
|
|
loading = _ref.loading,
|
|
user = _ref.user,
|
|
dispatch = _ref.dispatch,
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
var userInfo = user.userInfo;
|
|
var reviewGroupExercise = exercise.reviewGroupExercise;
|
|
var _useState = (0,_react_17_0_2_react.useState)({}),
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
changeScoreData = _useState2[0],
|
|
setChangeScoreData = _useState2[1];
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
showAll = _useState4[0],
|
|
setShowAll = _useState4[1];
|
|
var inputRef = (0,_react_17_0_2_react.useRef)();
|
|
console.log(changeScoreData);
|
|
var dealData = function dealData() {
|
|
var _user$userInfo;
|
|
console.log(params, 222);
|
|
var data = localStorage["".concat(user === null || user === void 0 || (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, "-").concat(params.coursesId, "-").concat(params.exerciseId, "-filter")];
|
|
if (data) {
|
|
data = JSON.parse(data);
|
|
} else {
|
|
data = {};
|
|
}
|
|
if (Object.prototype.toString.call(data) !== '[object Object]') {
|
|
return {};
|
|
}
|
|
;
|
|
return data;
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
var _user$userInfo2;
|
|
if (user !== null && user !== void 0 && (_user$userInfo2 = user.userInfo) !== null && _user$userInfo2 !== void 0 && _user$userInfo2.login) {
|
|
getData();
|
|
}
|
|
}, [user === null || user === void 0 || (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login]);
|
|
var getData = function getData() {
|
|
var data = dealData();
|
|
dispatch({
|
|
type: "exercise/getReviewGroupExercise",
|
|
payload: objectSpread2_default()({
|
|
exerciseId: params.exerciseId
|
|
}, data)
|
|
});
|
|
};
|
|
var saveChangeScore = /*#__PURE__*/function () {
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(item) {
|
|
var data, res;
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
while (1) switch (_context.prev = _context.next) {
|
|
case 0:
|
|
data = dealData();
|
|
_context.next = 3;
|
|
return (0,service_exercise/* putBatchAdjustScore */.LP)(objectSpread2_default()({
|
|
cover_all: true,
|
|
id: item.question_id,
|
|
max_score: changeScoreData[item.q_position]["max"],
|
|
min_score: changeScoreData[item.q_position]["min"],
|
|
comment: changeScoreData["comment"]
|
|
}, data));
|
|
case 3:
|
|
res = _context.sent;
|
|
if (res.status === 0) {
|
|
delete changeScoreData[item.q_position];
|
|
getData();
|
|
message/* default */.ZP.success("批量调分成功");
|
|
}
|
|
case 5:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}, _callee);
|
|
}));
|
|
return function saveChangeScore(_x) {
|
|
return _ref2.apply(this, arguments);
|
|
};
|
|
}();
|
|
var handleChangeScore = function handleChangeScore(item) {
|
|
if (item.question_type > 1) {
|
|
if (changeScoreData[item.q_position]) {
|
|
var _changeScoreData$item, _changeScoreData$item2, _changeScoreData$item3;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
className: "mr10 ml10 inline-block",
|
|
children: ["\u5728\u4EE5\u4E0B\u533A\u95F4\u4E2D\u4E3A\u5B66\u751F\u968F\u673A\u8D4B\u5206\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
placeholder: "\u6700\u4F4E",
|
|
defaultValue: item.user_score,
|
|
max: item.question_score,
|
|
min: 0,
|
|
onChange: function onChange(value) {
|
|
changeScoreData[item.q_position]["min"] = String(value);
|
|
setChangeScoreData(objectSpread2_default()({}, changeScoreData));
|
|
}
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
className: ReviewGroupmodules.cuttOff
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(input_number/* default */.Z, {
|
|
placeholder: "\u6700\u9AD8",
|
|
defaultValue: item.user_score,
|
|
max: item.question_score,
|
|
min: ((_changeScoreData$item = changeScoreData[item.q_position]) === null || _changeScoreData$item === void 0 ? void 0 : _changeScoreData$item["min"]) || 0,
|
|
onChange: function onChange(value) {
|
|
changeScoreData[item.q_position]["max"] = String(value);
|
|
setChangeScoreData(objectSpread2_default()({}, changeScoreData));
|
|
}
|
|
}), "\u5206", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
className: "ml5",
|
|
type: "primary",
|
|
disabled: !((_changeScoreData$item2 = changeScoreData[item.q_position]) !== null && _changeScoreData$item2 !== void 0 && _changeScoreData$item2["min"]) || !((_changeScoreData$item3 = changeScoreData[item.q_position]) !== null && _changeScoreData$item3 !== void 0 && _changeScoreData$item3["max"]),
|
|
onClick: function onClick() {
|
|
return saveChangeScore(item);
|
|
},
|
|
children: "\u786E\u8BA4"
|
|
})]
|
|
});
|
|
} else {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
style: {
|
|
cursor: 'pointer'
|
|
},
|
|
onClick: function onClick() {
|
|
changeScoreData[item.q_position] = {};
|
|
setChangeScoreData(objectSpread2_default()({}, changeScoreData));
|
|
},
|
|
className: "c-blue mr10 ml10",
|
|
children: "\u8C03\u5206"
|
|
});
|
|
}
|
|
}
|
|
};
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: "edu-container",
|
|
ref: inputRef,
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: "animated fadeIn",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: "mt10",
|
|
children: userInfo && /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
|
|
separator: ">",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "".concat(userInfo.first_category_url),
|
|
children: userInfo === null || userInfo === void 0 || (_userInfo$course = userInfo.course) === null || _userInfo$course === void 0 ? void 0 : _userInfo$course.course_name
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise"),
|
|
children: "\u8BD5\u5377\u5217\u8868"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise/").concat(params.exerciseId, "/detail"),
|
|
children: "\u8BD5\u5377\u8BE6\u60C5"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default */.Z.Item, {
|
|
children: reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$ = reviewGroupExercise.exercise_answer_user) === null || _reviewGroupExercise$ === void 0 ? void 0 : _reviewGroupExercise$.user_name
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: [ReviewGroupmodules.title, 'mt20'].join(' '),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
style: {
|
|
width: "100%"
|
|
},
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
to: "/classrooms/".concat(params.coursesId, "/exercise/").concat(params.exerciseId, "/detail"),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ArrowLeftOutlined/* default */.Z, {
|
|
className: "font16 c-black"
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
className: "font20 ml5",
|
|
children: reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$2 = reviewGroupExercise.exercise) === null || _reviewGroupExercise$2 === void 0 ? void 0 : _reviewGroupExercise$2.exercise_name
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(util/* StatusClassroomsTags */.VV, {
|
|
status: [util/* ExerciseStatus */.ju[(_reviewGroupExercise$3 = reviewGroupExercise.exercise) === null || _reviewGroupExercise$3 === void 0 ? void 0 : _reviewGroupExercise$3.exercise_status]]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {})]
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
className: [ReviewGroupmodules.bg, 'pt30', 'pl30', 'pr30', 'pb30', 'mt20'].join(' '),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
gutter: [30, 0],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
className: "bold c-black",
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u8003\u8BD5\u65F6\u957F ", ((_reviewGroupExercise$4 = reviewGroupExercise.exercise) === null || _reviewGroupExercise$4 === void 0 ? void 0 : _reviewGroupExercise$4.time) === -1 ? '未限时' : (_reviewGroupExercise$5 = reviewGroupExercise.exercise) === null || _reviewGroupExercise$5 === void 0 ? void 0 : _reviewGroupExercise$5.time]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "ml20",
|
|
children: ["\u6EE1\u5206 ", (_reviewGroupExercise$6 = reviewGroupExercise.exercise_scores) === null || _reviewGroupExercise$6 === void 0 || (_reviewGroupExercise$6 = _reviewGroupExercise$6.exercise_types) === null || _reviewGroupExercise$6 === void 0 ? void 0 : _reviewGroupExercise$6.q_scores, "\u5206"]
|
|
})]
|
|
})
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
gutter: [30, 0],
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-light-black",
|
|
children: "\u60A8\u6B63\u5728\u5BF9\u4EE5\u4E0B\u5B66\u751F\u8FDB\u884C\u6279\u91CF\u8BC4\u9605\uFF1A"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
children: (_reviewGroupExercise$7 = reviewGroupExercise.exercise_answer_user) === null || _reviewGroupExercise$7 === void 0 ? void 0 : _reviewGroupExercise$7.user_name
|
|
})]
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
gutter: [30, 0],
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 24,
|
|
className: "mt10",
|
|
children: reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$8 = reviewGroupExercise.exercise_users) === null || _reviewGroupExercise$8 === void 0 ? void 0 : _reviewGroupExercise$8.map(function (item, key) {
|
|
if (key < 100) return /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
className: "mr10",
|
|
children: item.user_name
|
|
}, key);
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
span: 24,
|
|
className: "tr",
|
|
children: (reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$9 = reviewGroupExercise.exercise_users) === null || _reviewGroupExercise$9 === void 0 ? void 0 : _reviewGroupExercise$9.length) > 100 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["......\u7B49", reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$10 = reviewGroupExercise.exercise_users) === null || _reviewGroupExercise$10 === void 0 ? void 0 : _reviewGroupExercise$10.length, "\u4EBA"]
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {}), (reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$11 = reviewGroupExercise.exercise_questions) === null || _reviewGroupExercise$11 === void 0 ? void 0 : _reviewGroupExercise$11.some(function (item) {
|
|
return item.question_type !== 4;
|
|
})) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
gutter: [10, 10],
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
className: "font14",
|
|
children: "\u5BA2\u89C2\u9898"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReviewGroupmodules.greenTip,
|
|
children: "\u6B63\u786E"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReviewGroupmodules.redTip,
|
|
children: "\u9519\u8BEF"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReviewGroupmodules.redTip,
|
|
children: "\u90E8\u5206\u5F97\u5206"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: [ReviewGroupmodules.questionIcons, 'mt10'].join(' '),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default */.Z, {
|
|
affix: false,
|
|
onChange: function onChange() {
|
|
return setShowAll(true);
|
|
},
|
|
children: reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$12 = reviewGroupExercise.exercise_questions) === null || _reviewGroupExercise$12 === void 0 ? void 0 : _reviewGroupExercise$12.map(function (item, index) {
|
|
if (item.question_type !== 4) return /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default */.Z.Link, {
|
|
href: "#questionID-".concat(item.q_position),
|
|
title: item.q_position
|
|
});
|
|
})
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
children: ["\u603B\u5206 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-red bold",
|
|
children: (_reviewGroupExercise$13 = reviewGroupExercise.exercise_scores) === null || _reviewGroupExercise$13 === void 0 || (_reviewGroupExercise$13 = _reviewGroupExercise$13.exercise_types) === null || _reviewGroupExercise$13 === void 0 ? void 0 : _reviewGroupExercise$13.q_scores
|
|
}), " \u5206"]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
className: "c-blue tr",
|
|
onClick: function onClick() {
|
|
return setShowAll(!showAll);
|
|
},
|
|
children: [showAll ? "收起答题详情" : "展开查看答题详情", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "iconfont icon-play-square-fill3x ml5"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
gutter: [10, 10],
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
|
|
className: "font14",
|
|
children: "\u4E3B\u89C2\u9898"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReviewGroupmodules.greenTip,
|
|
children: "\u5DF2\u8BC4"
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: ReviewGroupmodules.redTip,
|
|
children: "\u672A\u8BC4"
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
className: [ReviewGroupmodules.questionIcons, 'mt10'].join(' '),
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default */.Z, {
|
|
affix: false,
|
|
children: reviewGroupExercise === null || reviewGroupExercise === void 0 || (_reviewGroupExercise$14 = reviewGroupExercise.exercise_questions) === null || _reviewGroupExercise$14 === void 0 ? void 0 : _reviewGroupExercise$14.map(function (item, index) {
|
|
if (item.question_type === 4) return /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default */.Z.Link, {
|
|
href: "#questionID-".concat(item.q_position),
|
|
title: item.q_position,
|
|
children: " "
|
|
});
|
|
})
|
|
})
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
children: ["\u603B\u5206 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-red bold",
|
|
children: (_reviewGroupExercise$15 = reviewGroupExercise.exercise_scores) === null || _reviewGroupExercise$15 === void 0 || (_reviewGroupExercise$15 = _reviewGroupExercise$15.exercise_types) === null || _reviewGroupExercise$15 === void 0 ? void 0 : _reviewGroupExercise$15.q_mains_scores
|
|
}), " \u5206"]
|
|
})]
|
|
}), (_reviewGroupExercise$16 = reviewGroupExercise.exercise_questions) === null || _reviewGroupExercise$16 === void 0 ? void 0 : _reviewGroupExercise$16.map(function (item, index) {
|
|
var _item$question_choice;
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
id: "questionID-".concat(item.q_position),
|
|
className: "".concat(showAll || item.question_type === 4 ? "" : "hide"),
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
flex: "1",
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "c-blue font14",
|
|
children: [item.q_position, ". ", questionType[item.question_type]]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
className: "c-light-black ml5",
|
|
children: ["(", item.question_score, ")"]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
children: [item.standard_answer_show && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", item.standard_answer_show]
|
|
}), handleChangeScore(item), item.user_score && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
children: ["\u5F97\u5206", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-red",
|
|
children: item.user_score
|
|
}), "\u5206"]
|
|
}), !item.user_score && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
className: "c-red",
|
|
children: "\u672A\u8BC4"
|
|
})]
|
|
})]
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
value: item.question_title
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: (_item$question_choice = item.question_choices) === null || _item$question_choice === void 0 ? void 0 : _item$question_choice.map(function (val, key) {
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default */.ZP, {
|
|
checked: item.user_answer.includes(val.choice_id),
|
|
children: val.choice_text
|
|
})
|
|
});
|
|
})
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(SeeAnswer, {
|
|
data: item
|
|
}), changeScoreData[item.q_position] ? /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.TextArea, {
|
|
onChange: function onChange(e) {
|
|
changeScoreData["comment"] = String(e.target.value);
|
|
setChangeScoreData(objectSpread2_default()({}, changeScoreData));
|
|
},
|
|
placeholder: "\u8BF7\u8F93\u5165\u8BC4\u8BED\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",
|
|
maxLength: 100
|
|
}) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(divider/* default */.Z, {})]
|
|
});
|
|
})]
|
|
})]
|
|
});
|
|
};
|
|
/* harmony default export */ var ReviewGroup = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
var exercise = _ref3.exercise,
|
|
loading = _ref3.loading,
|
|
user = _ref3.user,
|
|
globalSetting = _ref3.globalSetting;
|
|
return {
|
|
exercise: exercise,
|
|
globalSetting: globalSetting,
|
|
user: user,
|
|
loading: loading.effects
|
|
};
|
|
})(ExeriseReview));
|
|
|
|
/***/ }),
|
|
|
|
/***/ 37598:
|
|
/*!*****************************!*\
|
|
!*** ./src/utils/marked.ts ***!
|
|
\*****************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ AL: function() { return /* binding */ resetMathExpressions; },
|
|
/* harmony export */ Iy: function() { return /* binding */ cleanToc; },
|
|
/* harmony export */ Qv: function() { return /* binding */ getTocContent; },
|
|
/* harmony export */ ez: function() { return /* binding */ getMathExpressions; },
|
|
/* harmony export */ jb: function() { return /* binding */ lines; }
|
|
/* harmony export */ });
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js */ 79800);
|
|
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! marked */ 32834);
|
|
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(marked__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! marked/src/helpers */ 11690);
|
|
/* harmony import */ var marked_src_helpers__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
|
|
|
|
|
function indentCodeCompensation(raw, text) {
|
|
var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
|
if (matchIndentToCode === null) {
|
|
return text;
|
|
}
|
|
var indentToCode = matchIndentToCode[1];
|
|
return text.split('\n').map(function (node) {
|
|
var matchIndentInNode = node.match(/^\s+/);
|
|
if (matchIndentInNode === null) {
|
|
return node;
|
|
}
|
|
var _matchIndentInNode = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_0___default()(matchIndentInNode, 1),
|
|
indentInNode = _matchIndentInNode[0];
|
|
if (indentInNode.length >= indentToCode.length) {
|
|
return node.slice(indentToCode.length);
|
|
}
|
|
return node;
|
|
}).join('\n');
|
|
}
|
|
//兼容之前的 ##标题式写法
|
|
var toc = [];
|
|
var ctx = ["<ul>"];
|
|
var renderer = new (marked__WEBPACK_IMPORTED_MODULE_1___default().Renderer)();
|
|
var headingRegex = /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;
|
|
function cleanToc() {
|
|
toc.length = 0;
|
|
ctx = ["<ul>"];
|
|
}
|
|
var lines = {
|
|
overflow: "hidden",
|
|
WebkitBoxOrient: "vertical",
|
|
display: "-webkit-box",
|
|
WebkitLineClamp: 2
|
|
};
|
|
function buildToc(coll, k, level, ctx) {
|
|
if (k >= coll.length || coll[k].level <= level) {
|
|
return k;
|
|
}
|
|
var node = coll[k];
|
|
ctx.push("<li><a href='#" + node.anchor + "'>" + node.text + "</a>");
|
|
k++;
|
|
var childCtx = [];
|
|
k = buildToc(coll, k, node.level, childCtx);
|
|
if (childCtx.length > 0) {
|
|
ctx.push("<ul>");
|
|
childCtx.forEach(function (idm) {
|
|
ctx.push(idm);
|
|
});
|
|
ctx.push("</ul>");
|
|
}
|
|
ctx.push("</li>");
|
|
k = buildToc(coll, k, level, ctx);
|
|
return k;
|
|
}
|
|
function getTocContent() {
|
|
buildToc(toc, 0, 0, ctx);
|
|
ctx.push("</ul>");
|
|
return ctx.join("");
|
|
}
|
|
var tokenizer = {
|
|
heading: function heading(src) {
|
|
var cap = headingRegex.exec(src);
|
|
if (cap) {
|
|
return {
|
|
type: 'heading',
|
|
raw: cap[0],
|
|
depth: cap[1].length,
|
|
text: cap[2]
|
|
};
|
|
}
|
|
},
|
|
fences: function fences(src) {
|
|
var cap = this.rules.block.fences.exec(src);
|
|
if (cap) {
|
|
var raw = cap[0];
|
|
var text = indentCodeCompensation(raw, cap[3] || '');
|
|
var lang = cap[2] ? cap[2].trim() : cap[2];
|
|
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
|
|
var id = next_id();
|
|
var expression = text;
|
|
text = id;
|
|
math_expressions[id] = {
|
|
type: 'block',
|
|
expression: expression
|
|
};
|
|
}
|
|
return {
|
|
type: 'code',
|
|
raw: raw,
|
|
lang: lang,
|
|
text: text
|
|
};
|
|
}
|
|
}
|
|
};
|
|
var latexRegex = /(?:\${2})([^\n`]+?)(?:\${2})/gi;
|
|
var katex_count = 0;
|
|
var next_id = function next_id() {
|
|
return "__special_katext_id_".concat(katex_count++, "__");
|
|
};
|
|
var math_expressions = {};
|
|
function getMathExpressions() {
|
|
return math_expressions;
|
|
}
|
|
function resetMathExpressions() {
|
|
katex_count = 0;
|
|
math_expressions = {};
|
|
}
|
|
function replace_math_with_ids(text) {
|
|
text = text.replace(latexRegex, function (_match, expression) {
|
|
var id = next_id();
|
|
math_expressions[id] = {
|
|
type: 'inline',
|
|
expression: expression
|
|
};
|
|
return id;
|
|
});
|
|
return text;
|
|
}
|
|
var original_listitem = renderer.listitem;
|
|
renderer.listitem = function (text) {
|
|
return original_listitem(replace_math_with_ids(text));
|
|
};
|
|
var original_paragraph = renderer.paragraph;
|
|
renderer.paragraph = function (text) {
|
|
return original_paragraph(replace_math_with_ids(text));
|
|
};
|
|
var original_tablecell = renderer.tablecell;
|
|
renderer.tablecell = function (content, flags) {
|
|
return original_tablecell(replace_math_with_ids(content), flags);
|
|
};
|
|
renderer.code = function (code, infostring, escaped) {
|
|
var lang = (infostring || '').match(/\S*/)[0];
|
|
if (!lang) {
|
|
return '<pre class="prettyprint linenums"><code>' + (escaped ? code : (0,marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__.escape)(code, true)) + '</code></pre>';
|
|
}
|
|
if (['latex', 'katex', 'math'].indexOf(lang) >= 0) {
|
|
return "<p class='editormd-tex'>".concat(code, "</p>");
|
|
} else {
|
|
return "<pre class=\"prettyprint linenums\"><code class=\"language-".concat(infostring, "\">").concat(escaped ? code : (0,marked_src_helpers__WEBPACK_IMPORTED_MODULE_2__.escape)(code, true), "</code></pre>\n");
|
|
}
|
|
};
|
|
renderer.heading = function (text, level, raw) {
|
|
var anchor = this.options.headerPrefix + raw.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g, '-');
|
|
toc.push({
|
|
anchor: anchor,
|
|
level: level,
|
|
text: text
|
|
});
|
|
return '<h' + level + ' id="' + anchor + '">' + text + '</h' + level + '>';
|
|
};
|
|
marked__WEBPACK_IMPORTED_MODULE_1___default().setOptions({
|
|
silent: true,
|
|
gfm: true,
|
|
pedantic: false
|
|
});
|
|
marked__WEBPACK_IMPORTED_MODULE_1___default().use({
|
|
tokenizer: tokenizer,
|
|
renderer: renderer
|
|
});
|
|
/* harmony default export */ __webpack_exports__.ZP = ((marked__WEBPACK_IMPORTED_MODULE_1___default()));
|
|
|
|
/***/ })
|
|
|
|
}]); |