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.
NewEduCoderBuild/p__Classrooms__Lists__Exerc...

3938 lines
198 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self["webpackChunk"] = self["webpackChunk"] || []).push([[14889],{
/***/ 82826:
/*!**********************************************************************************!*\
!*** ./node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js + 1 modules ***!
\**********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ icons_ArrowLeftOutlined; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
var objectSpread2 = __webpack_require__(1413);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons-svg/es/asn/ArrowLeftOutlined.js
// This icon file is generated automatically.
var ArrowLeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "arrow-left", "theme": "outlined" };
/* harmony default export */ var asn_ArrowLeftOutlined = (ArrowLeftOutlined);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/components/AntdIcon.js + 6 modules
var AntdIcon = __webpack_require__(7918);
;// CONCATENATED MODULE: ./node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var ArrowLeftOutlined_ArrowLeftOutlined = function ArrowLeftOutlined(props, ref) {
return /*#__PURE__*/react.createElement(AntdIcon/* default */.Z, (0,objectSpread2/* default */.Z)((0,objectSpread2/* default */.Z)({}, props), {}, {
ref: ref,
icon: asn_ArrowLeftOutlined
}));
};
ArrowLeftOutlined_ArrowLeftOutlined.displayName = 'ArrowLeftOutlined';
/* harmony default export */ var icons_ArrowLeftOutlined = (/*#__PURE__*/react.forwardRef(ArrowLeftOutlined_ArrowLeftOutlined));
/***/ }),
/***/ 68658:
/*!************************************************************************!*\
!*** ./node_modules/@ant-design/icons/es/icons/MinusSquareOutlined.js ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var _ant_design_icons_svg_es_asn_MinusSquareOutlined__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ant-design/icons-svg/es/asn/MinusSquareOutlined */ 70478);
/* harmony import */ var _components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AntdIcon */ 7918);
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var MinusSquareOutlined = function MinusSquareOutlined(props, ref) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({}, props), {}, {
ref: ref,
icon: _ant_design_icons_svg_es_asn_MinusSquareOutlined__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
}));
};
MinusSquareOutlined.displayName = 'MinusSquareOutlined';
/* harmony default export */ __webpack_exports__["Z"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(MinusSquareOutlined));
/***/ }),
/***/ 30723:
/*!***********************************************************************!*\
!*** ./node_modules/@ant-design/icons/es/icons/PlusSquareOutlined.js ***!
\***********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 1413);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var _ant_design_icons_svg_es_asn_PlusSquareOutlined__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ant-design/icons-svg/es/asn/PlusSquareOutlined */ 43114);
/* harmony import */ var _components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AntdIcon */ 7918);
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var PlusSquareOutlined = function PlusSquareOutlined(props, ref) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_AntdIcon__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)({}, props), {}, {
ref: ref,
icon: _ant_design_icons_svg_es_asn_PlusSquareOutlined__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z
}));
};
PlusSquareOutlined.displayName = 'PlusSquareOutlined';
/* harmony default export */ __webpack_exports__["Z"] = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(PlusSquareOutlined));
/***/ }),
/***/ 92523:
/*!***********************************************************!*\
!*** ./src/components/CaptureVideo/index.tsx + 1 modules ***!
\***********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ components_CaptureVideo; }
});
// UNUSED EXPORTS: CaptureVideo
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(17061);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(17156);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
var style = __webpack_require__(14934);
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
var message = __webpack_require__(12461);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(27424);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(89214);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(84519);
// EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
var v4 = __webpack_require__(25934);
// EXTERNAL MODULE: ./src/components/UploadFile/index.tsx
var UploadFile = __webpack_require__(82394);
// EXTERNAL MODULE: ./node_modules/ali-oss/dist/aliyun-oss-sdk.js
var aliyun_oss_sdk = __webpack_require__(56448);
var aliyun_oss_sdk_default = /*#__PURE__*/__webpack_require__.n(aliyun_oss_sdk);
;// CONCATENATED MODULE: ./src/components/CaptureVideo/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var CaptureVideomodules = ({"flex_box_center":"flex_box_center___kVqBh","flex_space_between":"flex_space_between___FMnNq","flex_box_vertical_center":"flex_box_vertical_center___meESe","flex_box_center_end":"flex_box_center_end___KFpOb","flex_box_column":"flex_box_column___GHIK9","video":"video___nn_cD"});
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/components/CaptureVideo/index.tsx
/**
* base64 to file
* @param dataurl base64 content
* @param filename set up a meaningful suffix, or you can set mime type in options
* @returns {File|*}
*/
var dataURLtoFile = function dataURLtoFile(dataurl, filename) {
var arr = dataurl.split(',');
var mime = arr[0].match(/:(.*?);/)[1];
var bstr = atob(arr[1]);
var n = bstr.length;
var u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], {
type: mime
}); // if env support File, also can use this: return new File([u8arr], filename, { type: mime });
};
var CaptureVideo = /*#__PURE__*/(0,react.forwardRef)(function (_ref, ref) {
var time = _ref.time,
number = _ref.number,
supportCamera = _ref.supportCamera,
take_photo = _ref.take_photo,
update = _ref.update;
var video = (0,react.useRef)();
var canvas = (0,react.useRef)();
var params = (0,_umi_production_exports.useParams)();
var _useState = (0,react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
phoneStep = _useState2[0],
setPhoneStep = _useState2[1];
var _useState3 = (0,react.useState)(0),
_useState4 = slicedToArray_default()(_useState3, 2),
status = _useState4[0],
setStatus = _useState4[1]; // 0准备中1开启失败2开启成功,3考试结束
var _useState5 = (0,react.useState)(''),
_useState6 = slicedToArray_default()(_useState5, 2),
src = _useState6[0],
setSrc = _useState6[1];
var _useState7 = (0,react.useState)(),
_useState8 = slicedToArray_default()(_useState7, 2),
interval = _useState8[0],
setInter = _useState8[1];
var _useState9 = (0,react.useState)(0),
_useState10 = slicedToArray_default()(_useState9, 2),
isPause = _useState10[0],
setIsPause = _useState10[1]; //0未开始1开始计时2停止计时
(0,react.useEffect)(function () {
checkMediaDevices();
return function () {
handleStop();
clearTimer();
};
}, []);
(0,react.useEffect)(function () {
// clearTimer()
if (status === 2 && time && number > 0) {
calcPhoto();
setIsPause(1);
// photograph();
}
}, [time]);
(0,react.useEffect)(function () {
if (isPause === 0) return;
if (isPause === 2) {
clearInterval(interval);
} else {
var n = 0;
var id = setInterval(function () {
if (phoneStep.includes(n)) {
handlePhoto();
}
n++;
}, 1000);
setInter(id);
}
return function () {
return clearInterval(interval);
};
}, [isPause]);
(0,react.useImperativeHandle)(ref, function () {
return {
handlePhoto: handlePhoto
};
});
var clearTimer = function clearTimer() {
setIsPause(2);
};
var calcPhoto = function calcPhoto() {
var step = time / number;
var arr = [];
function getRndInteger(min, max) {
return parseInt(Math.floor(Math.random() * (max - min + 1)) + min);
}
new Array(number).fill(0).map(function (item, key) {
if (take_photo) {
arr.push(getRndInteger(step * key, step * (key + 1)));
} else {
if (key == 0) {
arr.push(0);
} else {
arr.push(getRndInteger(step * key, step * (key + 1)));
}
}
});
phoneStep = arr;
setPhoneStep([].concat(arr));
console.log(arr);
};
var checkMediaDevices = function checkMediaDevices() {
if (navigator.mediaDevices === undefined) {
navigator.mediaDevices = {};
}
if (navigator.mediaDevices.getUserMedia === undefined) {
navigator.mediaDevices.getUserMedia = function (constraints) {
var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
if (!getUserMedia) {
return Promise.reject(new Error('getUserMedia is not implemented in this browser'));
}
return new Promise(function (resolve, reject) {
getUserMedia.call(navigator, constraints, resolve, reject);
});
};
}
navigator.mediaDevices.getUserMedia({
video: {
width: 640,
height: 480
}
}).then(function (stream) {
supportCamera && supportCamera(2);
setStatus(2);
if ("srcObject" in video.current) {
video.current.srcObject = stream;
} else {
video.current.src = window.URL.createObjectURL(stream);
}
video.current.onloadedmetadata = function (e) {
video.current.play();
};
video.current.addEventListener('ended', function () {
//结束
console.log("播放结束");
clearTimer();
message/* default.error */.ZP.error({
content: "您已经关闭了摄像头请在10秒钟内恢复摄像头否则将推出考试",
duration: 10,
key: 9998
});
}, false);
})["catch"](function (err) {
setStatus(1);
supportCamera && supportCamera(1);
// 错误信息,以及用户未授权
if (err.message === "Permission denied" || err.name === 'NotAllowedError') {
message/* default.error */.ZP.error('您已拒绝了获取摄像头');
} else {
message/* default.error */.ZP.error('摄像头获取失败,或您已拒绝了获取摄像头');
}
console.log("errname: " + err.name);
console.log("err: " + err.message);
});
};
var handlePhoto = function handlePhoto() {
try {
canvas.current.width = video.current.videoWidth;
canvas.current.height = video.current.videoHeight;
var context = canvas.current.getContext('2d');
context.drawImage(video.current, 0, 0, canvas.current.width, canvas.current.height);
setSrc(canvas.current.toDataURL('image/png'));
uploadFile(canvas.current.toDataURL('image/png'));
} catch (e) {}
};
var handleStop = function handleStop() {
try {
var stream = video.current.srcObject;
var tracks = stream.getTracks();
tracks.forEach(function (track) {
track.stop();
});
video.current.srcObject = null;
} catch (e) {}
};
var uploadFile = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(file) {
var _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6, _res$data7;
var res, name, client, imgfile;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,fetch/* default */.ZP)('/api/buckets/get_upload_token.json', {
method: "get"
});
case 2:
res = _context.sent;
res.data = JSON.parse((0,UploadFile/* decrypt */.pe)(res.data));
name = (0,v4/* default */.Z)();
client = new (aliyun_oss_sdk_default())({
endpoint: res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.end_point,
region: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.region,
accessKeyId: res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.access_key_id,
accessKeySecret: res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.access_key_secret,
bucket: res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.bucket,
stsToken: res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.security_token
});
imgfile = dataURLtoFile(file, name);
client.multipartUpload("".concat(name, ".png"), imgfile, {
timeout: 10 * 1000,
partSize: 10485760,
callback: {
url: res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.callback_url,
host: res === null || res === void 0 ? void 0 : res.data.bucket_host,
body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&login=' + params.login + '&container_id=' + params.categoryId + '&container_type=Exercise'
}
}).then(function (result) {
console.log("result:", result);
})["catch"](function (err) {
console.log("err:", err);
});
case 8:
case "end":
return _context.stop();
}
}, _callee);
}));
return function uploadFile(_x) {
return _ref2.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
children: status !== 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: CaptureVideomodules.video,
id: "screenshot",
children: [status === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u6B63\u5728\u5F00\u542F\u6444\u50CF\u5934..."
}), status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: "\u6444\u50CF\u5934\u5F00\u542F\u5931\u8D25"
}), status === 2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("video", {
width: "288",
ref: video,
autoPlay: true
}), /*#__PURE__*/(0,jsx_runtime.jsx)("canvas", {
style: {
display: "none"
},
ref: canvas
})]
})]
})
});
});
/* harmony default export */ var components_CaptureVideo = (CaptureVideo);
/***/ }),
/***/ 82394:
/*!*********************************************!*\
!*** ./src/components/UploadFile/index.tsx ***!
\*********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "cT": function() { return /* binding */ uploadFile; },
/* harmony export */ "pe": function() { return /* binding */ decrypt; }
/* harmony export */ });
/* unused harmony exports reNameFile, UploadFile */
/* harmony import */ var antd_es_message_style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/es/message/style */ 14934);
/* harmony import */ var antd_es_message__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! antd/es/message */ 12461);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/toConsumableArray.js */ 861);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/slicedToArray.js */ 27424);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js */ 70215);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/objectSpread2.js */ 42122);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js */ 17061);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 17156);
/* harmony import */ var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var antd_es_upload_style__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd/es/upload/style */ 13759);
/* harmony import */ var antd_es_upload__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd/es/upload */ 7426);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ 67294);
/* harmony import */ var _utils_fetch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/fetch */ 84519);
/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! crypto-js */ 81354);
/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! uuid */ 25934);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! umi */ 89214);
/* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ali-oss */ 56448);
/* harmony import */ var ali_oss__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(ali_oss__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ 85893);
var _excluded = ["user", "cancelUpload"];
var Dragger = antd_es_upload__WEBPACK_IMPORTED_MODULE_12__/* ["default"].Dragger */ .Z.Dragger;
var decrypt = function decrypt(word) {
var ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b";
var IV = "5183666c72eec9e4";
var key = crypto_js__WEBPACK_IMPORTED_MODULE_10___default().enc.Utf8.parse(ENC_KEY);
var iv = crypto_js__WEBPACK_IMPORTED_MODULE_10___default().enc.Utf8.parse(IV);
var decrypt = crypto_js__WEBPACK_IMPORTED_MODULE_10___default().AES.decrypt(word, key, {
iv: iv,
mode: (crypto_js__WEBPACK_IMPORTED_MODULE_10___default().mode.CBC)
// padding: CryptoJS.pad.ZeroPadding
});
return decrypt.toString((crypto_js__WEBPACK_IMPORTED_MODULE_10___default().enc.Utf8));
};
var tempCheckpoint;
// 重命名
var reNameFile = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
var _res$data, _res$data2, _res$data3, _res$data4, _res$data5, _res$data6;
var identifier, oldFilename, newFilename, res, client;
return _regeneratorRuntime().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
identifier = _ref.identifier, oldFilename = _ref.oldFilename, newFilename = _ref.newFilename;
_context.next = 3;
return Fetch('/api/buckets/get_upload_token_for_big_files.json', {
method: "get"
});
case 3:
res = _context.sent;
res.data = JSON.parse(decrypt(res.data));
client = new OSS({
endpoint: res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.end_point,
region: res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.region,
accessKeyId: res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.access_key_id,
accessKeySecret: res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.access_key_secret,
bucket: res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.bucket,
stsToken: res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.security_token
});
return _context.abrupt("return", new Promise(function (resolve, reject) {
console.log(11111, "".concat(identifier, "/").concat(oldFilename), "".concat(identifier, "/").concat(newFilename), res.data);
client.copy("/".concat(identifier, "/").concat(oldFilename), "/".concat(identifier, "/").concat(newFilename)).then(function (r) {
console.log('拷贝成功', r);
// client
// .delete(`${identifier}/${oldFilename}`)
// .then(r => console.log(r))
// .catch(e => console.log(e));
})["catch"](function (e) {
console.log(e);
debugger;
});
}));
case 7:
case "end":
return _context.stop();
}
}, _callee);
}));
return function reNameFile(_x) {
return _ref2.apply(this, arguments);
};
}()));
var uploadFile = /*#__PURE__*/function () {
var _ref3 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().mark(function _callee2(file, obj, config) {
var _res$data7, _res$data8, _res$data9, _res$data10, _res$data11, _res$data12;
var res, namearrs, name, client;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
obj.file_name = file.name;
_context2.next = 3;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP)('/api/buckets/get_upload_token.json', {
method: "get"
});
case 3:
res = _context2.sent;
console.log("decrypt(res.data):", decrypt(res.data));
res.data = JSON.parse(decrypt(res.data));
namearrs = file.name.split(".");
namearrs.pop();
name = obj.realFileName ? namearrs.join("") : (0,uuid__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z)(); // const name = file.name
client = new (ali_oss__WEBPACK_IMPORTED_MODULE_13___default())({
endpoint: res === null || res === void 0 ? void 0 : (_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : _res$data7.end_point,
region: res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.region,
accessKeyId: res === null || res === void 0 ? void 0 : (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.access_key_id,
accessKeySecret: res === null || res === void 0 ? void 0 : (_res$data10 = res.data) === null || _res$data10 === void 0 ? void 0 : _res$data10.access_key_secret,
bucket: res === null || res === void 0 ? void 0 : (_res$data11 = res.data) === null || _res$data11 === void 0 ? void 0 : _res$data11.bucket,
stsToken: res === null || res === void 0 ? void 0 : (_res$data12 = res.data) === null || _res$data12 === void 0 ? void 0 : _res$data12.security_token
});
return _context2.abrupt("return", new Promise(function (resolve, reject) {
var _res$data13;
client.multipartUpload("".concat(name), new Blob([file], {
type: file.type
}), _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4___default()({
timeout: 200 * 1000,
partSize: 102400
}, config), {}, {
callback: {
url: res === null || res === void 0 ? void 0 : (_res$data13 = res.data) === null || _res$data13 === void 0 ? void 0 : _res$data13.callback_url,
host: res === null || res === void 0 ? void 0 : res.data.bucket_host,
body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&' + (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_9__/* .parseParams */ .rz)(obj)
// body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&login=' + obj.login + '&container_id=' + obj.container_id + '&container_type='+obj.container_type,
}
})).then(function (result) {
var _result$data;
file.response = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.data;
resolve(result === null || result === void 0 ? void 0 : result.data);
})["catch"](function (err) {
reject(err);
console.log("err:", err);
});
}));
case 11:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function uploadFile(_x2, _x3, _x4) {
return _ref3.apply(this, arguments);
};
}();
var UploadFile = function UploadFile(_ref4) {
var user = _ref4.user,
cancelUpload = _ref4.cancelUpload,
props = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3___default()(_ref4, _excluded);
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)([]),
_useState2 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2___default()(_useState, 2),
fileList = _useState2[0],
setFileList = _useState2[1];
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_8__.useState)(),
_useState4 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_2___default()(_useState3, 2),
client = _useState4[0],
setClient = _useState4[1];
var _props = {
onRemove: function onRemove(e) {
setFileList(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(fileList.filter(function (item) {
return item.name !== e.name;
})));
props.onChange(fileList.filter(function (item) {
return item.name !== e.name;
}));
},
disabled: props.disabled,
multiple: true,
fileList: fileList === null || fileList === void 0 ? void 0 : fileList.map(function (item) {
return item.file;
}),
customRequest: function customRequest() {},
beforeUpload: function () {
var _beforeUpload = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().mark(function _callee3(file) {
var fileSize;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
fileSize = props.maxSize || 1024 * 1024 * 1024 * 1;
if (!fileList.filter(function (item) {
return item.name === file.name;
}).length) {
_context3.next = 4;
break;
}
antd_es_message__WEBPACK_IMPORTED_MODULE_16__/* ["default"].info */ .ZP.info("".concat(file.name, "\u5DF2\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));
return _context3.abrupt("return");
case 4:
if (!((file === null || file === void 0 ? void 0 : file.size) > fileSize)) {
_context3.next = 7;
break;
}
antd_es_message__WEBPACK_IMPORTED_MODULE_16__/* ["default"].info */ .ZP.info("\u6587\u4EF6\u8D85\u8FC7".concat(fileSize / 1024 / 1024 / 1024, "GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"));
return _context3.abrupt("return", false);
case 7:
fileList.push({
name: file.name,
file: file
});
setFileList(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(fileList));
props.onChange(fileList);
return _context3.abrupt("return", false);
case 11:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function beforeUpload(_x5) {
return _beforeUpload.apply(this, arguments);
}
return beforeUpload;
}()
};
var _uploadFiles = /*#__PURE__*/function () {
var _ref5 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().mark(function _callee4(file, obj) {
var _res$data14, _res$data15, _res$data16, _res$data17, _res$data18, _res$data19;
var name, res, namearrs, filename;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
obj.file_name = file.name;
name = file.name;
_context4.next = 4;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .ZP)('/api/buckets/get_upload_token_for_big_files.json', {
method: "get"
});
case 4:
res = _context4.sent;
res.data = JSON.parse(decrypt(res.data));
if (!((res === null || res === void 0 ? void 0 : res.status) !== 0)) {
_context4.next = 12;
break;
}
fileList[fileList.findIndex(function (item) {
return item.name === name;
})]['status'] = 'error';
fileList[fileList.findIndex(function (item) {
return item.name === name;
})]['file']['status'] = 'error';
props.onChange(fileList);
antd_es_message__WEBPACK_IMPORTED_MODULE_16__/* ["default"].warn */ .ZP.warn("上传失败,请重新尝试");
return _context4.abrupt("return");
case 12:
client = new (ali_oss__WEBPACK_IMPORTED_MODULE_13___default())({
endpoint: res === null || res === void 0 ? void 0 : (_res$data14 = res.data) === null || _res$data14 === void 0 ? void 0 : _res$data14.end_point,
region: res === null || res === void 0 ? void 0 : (_res$data15 = res.data) === null || _res$data15 === void 0 ? void 0 : _res$data15.region,
accessKeyId: res === null || res === void 0 ? void 0 : (_res$data16 = res.data) === null || _res$data16 === void 0 ? void 0 : _res$data16.access_key_id,
accessKeySecret: res === null || res === void 0 ? void 0 : (_res$data17 = res.data) === null || _res$data17 === void 0 ? void 0 : _res$data17.access_key_secret,
bucket: res === null || res === void 0 ? void 0 : (_res$data18 = res.data) === null || _res$data18 === void 0 ? void 0 : _res$data18.bucket,
stsToken: res === null || res === void 0 ? void 0 : (_res$data19 = res.data) === null || _res$data19 === void 0 ? void 0 : _res$data19.security_token
});
console.log(file, 'file');
setClient(client);
// const filename = uuidv4()
namearrs = file.name.split(".");
namearrs.pop();
filename = obj.realFileName ? namearrs.join(".") : (0,uuid__WEBPACK_IMPORTED_MODULE_15__/* ["default"] */ .Z)();
return _context4.abrupt("return", new Promise(function (resolve, reject) {
try {
var _res$data20;
client.multipartUpload("".concat(props.identifier, "/").concat(filename).concat(name.indexOf(".") > -1 ? '.' + name.split(".").pop() : ""), new Blob([file.file], {
type: file.file.type
}), {
timeout: 3600 * 1000,
partSize: 1002400,
progress: function progress(p, checkpoint, res) {
try {
console.log("进度", p, checkpoint, res);
var index = fileList.findIndex(function (item) {
return item.name === name;
});
fileList[index]['file']['percent'] = p * 100;
// if (p === 1) {
// fileList[index]['status'] = 'done'
// fileList[index]['file']['status'] = 'done'
// props.onChange(fileList)
// }
fileList[index].tempCheckpoint = checkpoint;
setFileList(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(fileList));
} catch (e) {}
},
checkpoint: fileList[fileList.findIndex(function (item) {
return item.name === name;
})].tempCheckpoint,
callback: {
customValue: {
id: name + ''
},
url: res === null || res === void 0 ? void 0 : (_res$data20 = res.data) === null || _res$data20 === void 0 ? void 0 : _res$data20.callback_url,
host: res === null || res === void 0 ? void 0 : res.data.bucket_host,
body: 'bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&' + (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_9__/* .parseParams */ .rz)(obj)
}
}).then(function (result) {
var _result$data2;
var index = fileList.findIndex(function (item) {
return item.name === name;
});
var status = 'done';
if (((_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.status) === 0) {
var _result$data3;
file.response = (_result$data3 = result.data) === null || _result$data3 === void 0 ? void 0 : _result$data3.data;
var _index = fileList.findIndex(function (item) {
return item.name === name;
});
fileList[_index]['status'] = 'done';
fileList[_index]['file']['status'] = 'done';
} else {
var _result$data4;
antd_es_message__WEBPACK_IMPORTED_MODULE_16__/* ["default"].warn */ .ZP.warn((_result$data4 = result.data) === null || _result$data4 === void 0 ? void 0 : _result$data4.message);
status = 'error';
}
fileList[index]['status'] = status;
fileList[index]['file']['status'] = status;
props.onChange(fileList);
resolve(result === null || result === void 0 ? void 0 : result.data);
})["catch"](function (err) {
fileList[fileList.findIndex(function (item) {
return item.name === name;
})]['status'] = 'error';
fileList[fileList.findIndex(function (item) {
return item.name === name;
})]['file']['status'] = 'error';
antd_es_message__WEBPACK_IMPORTED_MODULE_16__/* ["default"].warn */ .ZP.warn("上传失败,请重新尝试");
setFileList(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_1___default()(fileList));
props.onChange(fileList);
reject(err);
console.log("err:", err);
});
} catch (e) {
debugger;
}
}));
case 19:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return function _uploadFiles(_x6, _x7) {
return _ref5.apply(this, arguments);
};
}();
(0,react__WEBPACK_IMPORTED_MODULE_8__.useEffect)(function () {
if (fileList.every(function (item) {
return item === 'done' || item === 'error';
})) {
props.onComplete(fileList);
}
}, [fileList]);
(0,react__WEBPACK_IMPORTED_MODULE_8__.useEffect)(function () {
if (cancelUpload) {
var _client;
(_client = client) === null || _client === void 0 ? void 0 : _client.cancel();
}
}, [cancelUpload]);
(0,react__WEBPACK_IMPORTED_MODULE_8__.useEffect)(function () {
if (props.uploading) fileList.map( /*#__PURE__*/function () {
var _ref6 = _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_6___default()( /*#__PURE__*/_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().mark(function _callee5(item) {
var _user$userInfo, res;
return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_5___default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
if (!((!item.status || item.status === 'error') && !cancelUpload)) {
_context5.next = 6;
break;
}
item.status = 'uploading';
item.file.status = 'uploading';
_context5.next = 5;
return _uploadFiles(item, {
login: user === null || user === void 0 ? void 0 : (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login,
container_type: props.container_type,
container_id: props.container_id,
description: props.description,
realFileName: props.realFileName
});
case 5:
res = _context5.sent;
case 6:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return function (_x8) {
return _ref6.apply(this, arguments);
};
}());
}, [props.uploading]);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(Dragger, _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4___default()({}, _props), {}, {
height: props.height,
className: props.className,
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("p", {
className: "ant-upload-hint",
children: props.text || '拖拽文件或者点击上传'
})
}));
};
/* harmony default export */ __webpack_exports__["ZP"] = ((0,umi__WEBPACK_IMPORTED_MODULE_11__.connect)(function (_ref7) {
var loading = _ref7.loading,
globalSetting = _ref7.globalSetting,
user = _ref7.user;
return {
globalSetting: globalSetting,
loading: loading.models.competitions,
user: user
};
})(UploadFile));
/***/ }),
/***/ 87746:
/*!*********************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/index.tsx + 7 modules ***!
\*********************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ ImitateAnswer; }
});
// EXTERNAL MODULE: ./node_modules/antd/es/spin/style/index.js + 1 modules
var style = __webpack_require__(22536);
// EXTERNAL MODULE: ./node_modules/antd/es/spin/index.js
var spin = __webpack_require__(11382);
// EXTERNAL MODULE: ./node_modules/antd/es/breadcrumb/style/index.js + 1 modules
var breadcrumb_style = __webpack_require__(63102);
// EXTERNAL MODULE: ./node_modules/antd/es/breadcrumb/index.js + 3 modules
var breadcrumb = __webpack_require__(58492);
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js + 1 modules
var button_style = __webpack_require__(29913);
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
var es_button = __webpack_require__(71577);
// EXTERNAL MODULE: ./node_modules/antd/es/row/style/index.js
var row_style = __webpack_require__(13062);
// EXTERNAL MODULE: ./node_modules/antd/es/row/index.js
var row = __webpack_require__(71230);
// EXTERNAL MODULE: ./node_modules/antd/es/col/style/index.js
var col_style = __webpack_require__(89032);
// EXTERNAL MODULE: ./node_modules/antd/es/col/index.js
var col = __webpack_require__(15746);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/style/index.js + 1 modules
var tooltip_style = __webpack_require__(38390);
// EXTERNAL MODULE: ./node_modules/antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(84908);
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/style/index.js + 1 modules
var checkbox_style = __webpack_require__(82000);
// EXTERNAL MODULE: ./node_modules/antd/es/checkbox/index.js + 2 modules
var es_checkbox = __webpack_require__(32808);
// EXTERNAL MODULE: ./node_modules/antd/es/radio/style/index.js + 1 modules
var radio_style = __webpack_require__(83822);
// EXTERNAL MODULE: ./node_modules/antd/es/radio/index.js + 4 modules
var es_radio = __webpack_require__(29924);
// EXTERNAL MODULE: ./node_modules/antd/es/progress/style/index.js + 1 modules
var progress_style = __webpack_require__(57273);
// EXTERNAL MODULE: ./node_modules/antd/es/progress/index.js + 10 modules
var es_progress = __webpack_require__(97910);
// EXTERNAL MODULE: ./node_modules/antd/es/message/style/index.js + 1 modules
var message_style = __webpack_require__(14934);
// EXTERNAL MODULE: ./node_modules/antd/es/message/index.js + 1 modules
var message = __webpack_require__(12461);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/style/index.js + 1 modules
var modal_style = __webpack_require__(35611);
// EXTERNAL MODULE: ./node_modules/antd/es/modal/index.js + 7 modules
var es_modal = __webpack_require__(85402);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(17061);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(42122);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(17156);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(27424);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
var objectWithoutProperties = __webpack_require__(70215);
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js + 1 modules
var input_style = __webpack_require__(69463);
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 5 modules
var input = __webpack_require__(75008);
// EXTERNAL MODULE: ./node_modules/antd/es/statistic/style/index.js + 1 modules
var statistic_style = __webpack_require__(14558);
// EXTERNAL MODULE: ./node_modules/antd/es/statistic/index.js + 4 modules
var statistic = __webpack_require__(74763);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
var _umi_production_exports = __webpack_require__(89214);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/MinusSquareOutlined.js
var MinusSquareOutlined = __webpack_require__(68658);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/PlusSquareOutlined.js
var PlusSquareOutlined = __webpack_require__(30723);
// EXTERNAL MODULE: ./node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js + 1 modules
var ArrowLeftOutlined = __webpack_require__(82826);
// EXTERNAL MODULE: ./src/components/CaptureVideo/index.tsx + 1 modules
var CaptureVideo = __webpack_require__(92523);
// EXTERNAL MODULE: ./src/components/Exercise/recordScreen.tsx + 3 modules
var recordScreen = __webpack_require__(78806);
// EXTERNAL MODULE: ./node_modules/moment/moment.js
var moment = __webpack_require__(30381);
var moment_default = /*#__PURE__*/__webpack_require__.n(moment);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var ImitateAnswermodules = ({"flex_box_center":"flex_box_center___MzHUI","flex_space_between":"flex_space_between___ZPKmx","flex_box_vertical_center":"flex_box_vertical_center___MNo4n","flex_box_center_end":"flex_box_center_end___stoyX","flex_box_column":"flex_box_column___HR6oq","bg":"bg___MN8xj","title":"title___h5yRx","questionIcons":"questionIcons___kiVRR","green":"green___PIOSW","orange":"orange___aGI_B","greenTip":"greenTip___bShpb","redTip":"redTip___wCm4Z","orangeTip":"orangeTip___HRBLJ","pollDesc":"pollDesc___SxQ7V","answered":"answered___e5zk4","unanswer":"unanswer___dEmC8","anchor":"anchor___xdS4e","answerFlag":"answerFlag____R2kw","flagActive":"flagActive___hkk6X","flagHalf":"flagHalf___ZgZyz","answerStudentFlag":"answerStudentFlag___RlIwt","answerStudentActive":"answerStudentActive___pQpEA","questionItem":"questionItem___Yg7y3","itemType":"itemType___zMAIQ","itemFlag":"itemFlag___KI4Jb","answerWrap":"answerWrap___CETMI","answerSubjective":"answerSubjective____A1OC","otherInput":"otherInput___hanjt","submitButton":"submitButton___ATddm","randomFlag":"randomFlag___mId_V","answerTrue":"answerTrue___QzQ9o","answerFalse":"answerFalse____K4Me","answerHalf":"answerHalf___gnzWI","renderHtml":"renderHtml___dDhM4","simpleText":"simpleText___kJ0Kc","answerYes":"answerYes___btoYt","answerNo":"answerNo___aNG_f","answerInfo":"answerInfo___af0Ma","answerSheet":"answerSheet___ojXFi","active":"active___KmAlt","countDown":"countDown___W4ClT","red":"red___RSej4","fold":"fold___pujAY","cardList":"cardList___Bd4OZ","iframe":"iframe___kQjBw"});
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(29427);
// EXTERNAL MODULE: ./src/components/Exercise/ip.tsx
var Exercise_ip = __webpack_require__(79443);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(7);
// EXTERNAL MODULE: ./src/utils/fullscreen.ts
var fullscreen = __webpack_require__(15994);
// EXTERNAL MODULE: ./src/service/exercise.ts
var exercise = __webpack_require__(51412);
// EXTERNAL MODULE: ./src/service/shixuns.ts
var shixuns = __webpack_require__(56088);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(12768);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 10 modules
var markdown_editor = __webpack_require__(55373);
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(85893);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Simple.tsx
var Simple = function Simple(_ref) {
var _answerData$exercise, _item$user_answer, _item$user_answer2, _item$user_answer4, _item$standard_answer;
var item = _ref.item,
answerData = _ref.answerData,
_ref$onBlur = _ref.onBlur,
_onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur;
var _useState = (0,react.useState)(),
_useState2 = slicedToArray_default()(_useState, 2),
value = _useState2[0],
setValue = _useState2[1];
var _useState3 = (0,react.useState)(),
_useState4 = slicedToArray_default()(_useState3, 2),
isShow = _useState4[0],
setIsShow = _useState4[1];
var _useState5 = (0,react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
showEditor = _useState6[0],
setShowEditor = _useState6[1];
(0,react.useEffect)(function () {
setIsShow(item === null || item === void 0 ? void 0 : item.a_flag);
}, [item === null || item === void 0 ? void 0 : item.a_flag]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [(answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise = answerData.exercise) === null || _answerData$exercise === void 0 ? void 0 : _answerData$exercise.commit_status) === 1 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "mt10 mb0",
children: "\u6211\u7684\u7B54\u6848\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImitateAnswermodules.simpleText,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item === null || item === void 0 ? void 0 : (_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer[0]
})
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: item.user_score && (item.user_score === item.question_score ? "c-green" : "c-red"),
children: showEditor ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
height: 150,
isFocus: true,
defaultValue: item === null || item === void 0 ? void 0 : (_item$user_answer2 = item.user_answer) === null || _item$user_answer2 === void 0 ? void 0 : _item$user_answer2[0],
id: item === null || item === void 0 ? void 0 : item.question_id,
onChange: function onChange(value) {
return setValue(value);
},
onBlur: function onBlur() {
return _onBlur(value);
}
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
var _item$user_answer3;
if (!item.repeat_answer && (item === null || item === void 0 ? void 0 : (_item$user_answer3 = item.user_answer) === null || _item$user_answer3 === void 0 ? void 0 : _item$user_answer3.length) > 0) {
return;
}
setShowEditor(true);
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
disabled: !item.repeat_answer && (item === null || item === void 0 ? void 0 : (_item$user_answer4 = item.user_answer) === null || _item$user_answer4 === void 0 ? void 0 : _item$user_answer4.length) > 0 && !item.israp,
size: "large",
className: "current",
placeholder: "\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54",
readOnly: true
})
})
}), (item === null || item === void 0 ? void 0 : item.standard_answer) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "mt10 mb0",
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
border: "1px solid #eee",
background: "#f5f5f5",
borderRadius: 4,
padding: 5
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item === null || item === void 0 ? void 0 : (_item$standard_answer = item.standard_answer) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer[0]
})
})]
})]
});
};
/* harmony default export */ var components_Simple = (Simple);
// EXTERNAL MODULE: ./node_modules/antd/es/table/style/index.js + 1 modules
var table_style = __webpack_require__(71854);
// EXTERNAL MODULE: ./node_modules/antd/es/table/index.js + 58 modules
var table = __webpack_require__(67250);
// EXTERNAL MODULE: ./node_modules/antd/es/anchor/style/index.js + 1 modules
var anchor_style = __webpack_require__(74131);
// EXTERNAL MODULE: ./node_modules/antd/es/anchor/index.js + 3 modules
var es_anchor = __webpack_require__(37802);
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
var monaco_editor = __webpack_require__(8691);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var componentsmodules = ({"flex_box_center":"flex_box_center___NzoJU","flex_space_between":"flex_space_between___Hwix8","flex_box_vertical_center":"flex_box_vertical_center___IjC7Y","flex_box_center_end":"flex_box_center_end___HmCsd","flex_box_column":"flex_box_column___hOf25","shixunWrp":"shixunWrp___yZiPI"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Shixun.tsx
var Shixun = function Shixun(_ref) {
var _answerData$exercise, _answerData$exercise2, _answerData$exercise3, _item$shixun;
var item = _ref.item,
answerData = _ref.answerData;
var _useState = (0,react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
data = _useState2[0],
setData = _useState2[1];
var _useState3 = (0,react.useState)([]),
_useState4 = slicedToArray_default()(_useState3, 2),
challengeData = _useState4[0],
setChallengeData = _useState4[1];
(0,react.useEffect)(function () {
var _item$shixun_details;
if (!(item !== null && item !== void 0 && (_item$shixun_details = item.shixun_details) !== null && _item$shixun_details !== void 0 && _item$shixun_details.length)) {
return;
}
var shixun = [];
var challenge = [];
for (var i = 0; i < (item === null || item === void 0 ? void 0 : (_item$shixun_details2 = item.shixun_details) === null || _item$shixun_details2 === void 0 ? void 0 : _item$shixun_details2.length); i++) {
var _item$shixun_details2, _item$shixun_details7, _item$shixun_details8;
for (var j = 0; j < (item === null || item === void 0 ? void 0 : item.shixun_details[i].stage_list.length); j++) {
var _item$shixun_details3, _item$shixun_details4, _item$shixun_details5, _item$shixun_details6;
var shixunItem = item === null || item === void 0 ? void 0 : item.shixun_details[i].stage_list[j];
shixun.push(objectSpread2_default()(objectSpread2_default()({}, shixunItem), {
operation: item === null || item === void 0 ? void 0 : (_item$shixun_details3 = item.shixun_details) === null || _item$shixun_details3 === void 0 ? void 0 : (_item$shixun_details4 = _item$shixun_details3[i]) === null || _item$shixun_details4 === void 0 ? void 0 : (_item$shixun_details5 = _item$shixun_details4.shixun_detail) === null || _item$shixun_details5 === void 0 ? void 0 : (_item$shixun_details6 = _item$shixun_details5[0]) === null || _item$shixun_details6 === void 0 ? void 0 : _item$shixun_details6.game_identifier
}));
}
if (item !== null && item !== void 0 && (_item$shixun_details7 = item.shixun_details) !== null && _item$shixun_details7 !== void 0 && (_item$shixun_details8 = _item$shixun_details7[i]) !== null && _item$shixun_details8 !== void 0 && _item$shixun_details8.shixun_detail) {
var _item$shixun_details9, _item$shixun_details10, _item$shixun_details11;
challenge.push(item === null || item === void 0 ? void 0 : (_item$shixun_details9 = item.shixun_details) === null || _item$shixun_details9 === void 0 ? void 0 : (_item$shixun_details10 = _item$shixun_details9[i]) === null || _item$shixun_details10 === void 0 ? void 0 : (_item$shixun_details11 = _item$shixun_details10.shixun_detail) === null || _item$shixun_details11 === void 0 ? void 0 : _item$shixun_details11[0]);
}
}
setChallengeData(challenge);
setData(shixun);
}, [item === null || item === void 0 ? void 0 : item.shixun_details]);
var columns = [{
title: "关卡",
dataIndex: "position",
key: "position",
align: 'center'
}, {
title: "任务名称",
dataIndex: "name",
key: "name",
align: 'center',
render: function render(name) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "overflowHidden1",
style: {
maxWidth: "400px"
},
title: name && name.length > 25 ? name : "",
children: name
});
}
}, {
title: "评测次数",
dataIndex: "evaluate_count",
key: "evaluate_count",
align: 'center',
render: function render(testCount, item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item.evaluate_count ? item.evaluate_count : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "color-grey-9",
children: "--"
})
});
}
}, {
title: "完成时间",
key: "endTime",
dataIndex: "endTime",
align: 'center',
render: function render(endTime, item) {
var timeOver = false;
if (item.finished_time && answerData !== null && answerData !== void 0 && answerData.exercise && answerData !== null && answerData !== void 0 && answerData.exercise_answer_user) {
// issue#29511 exercise.time -1没有设置答题的时间限制则比较完成时间和试卷截至时间
if ((answerData === null || answerData === void 0 ? void 0 : answerData.exercise.time) === -1) {
timeOver = moment_default()(answerData === null || answerData === void 0 ? void 0 : answerData.exercise.end_time).isBefore(item.finished_time);
} else {
timeOver = moment_default()(answerData === null || answerData === void 0 ? void 0 : answerData.exercise_answer_user.start_at).add(answerData === null || answerData === void 0 ? void 0 : answerData.exercise.time, "m").isBefore(item.finished_time);
}
}
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [item.finished_time || /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: "--"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-orange-ff9 ",
children: timeOver ? "(已超时)" : ""
})]
});
}
}, {
title: "耗时",
dataIndex: "time_consuming",
key: "time_consuming",
align: 'center',
render: function render(time, item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item.time_consuming || /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "color-grey-9",
children: "--"
})
});
}
}, {
title: "查看答案",
dataIndex: "view_answer",
key: "view_answer",
align: 'center',
render: function render(exp, item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: item.view_answer ? "已查看" : "未查看"
});
}
},
// {
// title: "经验值",
// dataIndex: "experience",
// key: "experience",
// align: 'center',
// render: (exp: any, item: any) => {
// return (
// <span>
// <span className="c-green">{item.myself_experience}</span>/
// {item.experience}
// </span>
// );
// },
// },
{
title: "操作",
dataIndex: "operation",
key: "operation",
align: 'center',
render: function render(value, data, index) {
return value ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default */.Z, {
affix: false,
className: "mt10",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default.Link */.Z.Link, {
href: "#challenge_".concat(item === null || item === void 0 ? void 0 : item.question_id).concat(index),
title: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#0152d9'
},
children: "\u67E5\u770B"
})
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-grey-999",
children: "--"
});
}
}];
var outputColumns = [{
title: '评测次数',
dataIndex: 'key',
width: "127px",
key: 'key',
align: 'center',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: record.key
});
}
}, {
title: '详细信息',
dataIndex: 'error_msg',
key: 'error_msg',
align: 'center',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: record.error_msg ? record.error_msg : "--"
});
}
}];
var options = {
selectOnLineNumbers: true,
readOnly: true,
minimap: {
enabled: false
},
scrollBeyondLastLine: false
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt15 mb15",
children: [(answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise = answerData.exercise) === null || _answerData$exercise === void 0 ? void 0 : _answerData$exercise.commit_status) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: item.shixun.map(function (val, key) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: "font16",
gutter: [0, 20],
style: {
marginTop: 10
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [val.challenge_name, " (", val.challenge_score, "\u5206)"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "100px",
className: "tr",
children: [val.answer_status === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 tag-style-border border-orange c-orange ",
children: "\u672A\u5B8C\u6210"
}), val.answer_status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font12 tag-style-border border-green c-green ",
children: "\u5DF2\u5B8C\u6210"
})]
})]
});
})
}), (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise2 = answerData.exercise) === null || _answerData$exercise2 === void 0 ? void 0 : _answerData$exercise2.commit_status) !== 0 || (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise3 = answerData.exercise) === null || _answerData$exercise3 === void 0 ? void 0 : _answerData$exercise3.user_exercise_status) !== 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [!!(data !== null && data !== void 0 && data.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "font16 c-grey-666",
children: "\u9636\u6BB5\u6210\u7EE9"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
columns: columns,
dataSource: data,
pagination: false
})]
}), !!(challengeData !== null && challengeData !== void 0 && challengeData.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
className: "font16 c-grey-666 mt10",
children: "\u5B9E\u8BAD\u8BE6\u60C5"
}), challengeData === null || challengeData === void 0 ? void 0 : challengeData.map(function (chanllenge, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
id: "challenge_".concat(item === null || item === void 0 ? void 0 : item.question_id).concat(index),
className: "mt5",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font16 mr15",
children: [" \u7B2C", chanllenge.position, "\u5173"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
className: "current c-black font16",
to: "/tasks/".concat(chanllenge.game_identifier),
children: chanllenge.name
})]
}), (chanllenge === null || chanllenge === void 0 ? void 0 : chanllenge.st) === 0 && chanllenge.passed_code && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: componentsmodules.shixunWrp,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("h2", {
children: ["\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-light-black",
children: chanllenge.path
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
height: 300,
language: "python",
theme: "default",
value: chanllenge.passed_code,
options: options
})]
})]
});
})]
})]
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: "c-grey-999 mt20 mb20",
value: item === null || item === void 0 ? void 0 : item.question_title
}), item === null || item === void 0 ? void 0 : (_item$shixun = item.shixun) === null || _item$shixun === void 0 ? void 0 : _item$shixun.map(function (shixun, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
className: "font16 c-grey-666 mb5",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "mr20",
children: ["\u7B2C", shixun === null || shixun === void 0 ? void 0 : shixun.challenge_position, "\u5173 ", shixun === null || shixun === void 0 ? void 0 : shixun.challenge_name]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [shixun === null || shixun === void 0 ? void 0 : shixun.challenge_score, "\u5206"]
})]
}, index);
})]
})]
});
};
/* harmony default export */ var components_Shixun = (Shixun);
// EXTERNAL MODULE: ./node_modules/js-base64/base64.js
var base64 = __webpack_require__(19575);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Program.tsx
var Program = function Program(_ref) {
var item = _ref.item,
answerData = _ref.answerData;
var _useState = (0,react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
data = _useState2[0],
setData = _useState2[1];
(0,react.useEffect)(function () {
var _item$evaluate_codes;
if ((item === null || item === void 0 ? void 0 : (_item$evaluate_codes = item.evaluate_codes) === null || _item$evaluate_codes === void 0 ? void 0 : _item$evaluate_codes.length) > 0) {
var _item$evaluate_codes2;
setData(item === null || item === void 0 ? void 0 : (_item$evaluate_codes2 = item.evaluate_codes) === null || _item$evaluate_codes2 === void 0 ? void 0 : _item$evaluate_codes2.map(function (code, index) {
return {
key: index + 1,
error_msg: code !== null && code !== void 0 && code.error_msg ? base64.Base64.decode(code === null || code === void 0 ? void 0 : code.error_msg) : ''
};
}));
} else {
setData([{
key: "--",
error_msg: "--"
}]);
}
}, [item === null || item === void 0 ? void 0 : item.evaluate_codes]);
var columns = [{
title: '评测次数',
dataIndex: 'key',
width: "127px",
key: 'key',
align: 'center',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: record.key
});
}
}, {
title: '详细信息',
dataIndex: 'error_msg',
key: 'error_msg',
align: 'center',
render: function render(text, record) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: record.error_msg ? record.error_msg : "--"
});
}
}];
var options = {
selectOnLineNumbers: true,
readOnly: true,
minimap: {
enabled: false
},
scrollBeyondLastLine: false
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt15 mb15",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item === null || item === void 0 ? void 0 : item.description
})
}), !!(item !== null && item !== void 0 && item.user_answer.length) && (item === null || item === void 0 ? void 0 : item.passed_code) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: componentsmodules.shixunWrp,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
children: "\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
style: {
border: '1px solid #ccc'
},
height: 300,
language: "python",
theme: "vs-light",
value: item !== null && item !== void 0 && item.passed_code ? base64.Base64.decode(item === null || item === void 0 ? void 0 : item.passed_code) : "",
options: options
})]
})]
});
};
/* harmony default export */ var components_Program = (Program);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(861);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Fill.tsx
var TextArea = input/* default.TextArea */.Z.TextArea;
var Fill = function Fill(_ref) {
var _item$standard_answer, _item$standard_answer2;
var item = _ref.item,
answerData = _ref.answerData,
_ref$onBlur = _ref.onBlur,
_onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur;
var _useState = (0,react.useState)([]),
_useState2 = slicedToArray_default()(_useState, 2),
userAnswer = _useState2[0],
setUserAnswer = _useState2[1];
(0,react.useEffect)(function () {
var data = [];
var _loop = function _loop(i) {
var _item$user_answer;
var param = (item === null || item === void 0 ? void 0 : (_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer.find(function (e) {
return e.choice_id === i + 1;
})) || {
choice_id: i + 1,
answer_text: ''
};
data.push(objectSpread2_default()({}, param));
};
for (var i = 0; i < (item === null || item === void 0 ? void 0 : item.multi_count); i++) {
_loop(i);
}
setUserAnswer(data);
}, [item === null || item === void 0 ? void 0 : item.user_answer]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [userAnswer === null || userAnswer === void 0 ? void 0 : userAnswer.map(function (answer, index) {
var _item$user_answer2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "mt10",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u6211\u7684\u7B54\u6848\uFF08\u586B\u7A7A", index + 1, "\uFF09:"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
autoSize: true,
rows: 4,
disabled: !item.repeat_answer && (item === null || item === void 0 ? void 0 : (_item$user_answer2 = item.user_answer) === null || _item$user_answer2 === void 0 ? void 0 : _item$user_answer2.length) > 0 && !item.israp || !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
value: answer === null || answer === void 0 ? void 0 : answer.answer_text,
onChange: function onChange(e) {
userAnswer[index].answer_text = e.target.value;
setUserAnswer(toConsumableArray_default()(userAnswer));
},
onBlur: function onBlur(e) {
return _onBlur(answer === null || answer === void 0 ? void 0 : answer.answer_text, index + 1, userAnswer);
},
className: "overflow_hidden ".concat(item.user_score && (item.user_score === item.question_score ? "c-green" : "c-red"))
})
})]
});
}), !!(item !== null && item !== void 0 && (_item$standard_answer = item.standard_answer) !== null && _item$standard_answer !== void 0 && _item$standard_answer.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: item === null || item === void 0 ? void 0 : (_item$standard_answer2 = item.standard_answer) === null || _item$standard_answer2 === void 0 ? void 0 : _item$standard_answer2.map(function (answer, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A", index + 1, "\uFF09:"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
autoSize: true,
disabled: true,
value: answer === null || answer === void 0 ? void 0 : answer.answer_text[0]
})
})]
});
})
})]
});
};
/* harmony default export */ var components_Fill = (Fill);
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 31 modules
var ImagesIcon = __webpack_require__(44190);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/ErrCheckIpTip.tsx
var ErrCheckIpTip_TextArea = input/* default.TextArea */.Z.TextArea;
var ErrCheckIpTip_Fill = function Fill(_ref) {
var data = _ref.data;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc mt80",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
width: "486",
src: ImagesIcon/* errIcon */.BV
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), data.status === -1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "c-grey-999 mt60",
children: "\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"
}), data.status === -2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: " c-grey-999 mt60",
children: ["\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-red",
children: data.ip
}), "\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
className: "mt40 pl20 pr20",
type: "primary",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
href: "/",
children: "\u56DE\u5230\u9996\u9875"
})
})]
});
};
/* harmony default export */ var ErrCheckIpTip = (ErrCheckIpTip_Fill);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(59758);
// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
var lodash = __webpack_require__(96486);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/index.tsx
var _excluded = ["globalSetting", "loading", "user", "dispatch"];
var Countdown = statistic/* default.Countdown */.Z.Countdown;
var ImitateAnswer_TextArea = input/* default.TextArea */.Z.TextArea;
var 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'];
var statusMapping = {
1: "未发布",
2: "已发布",
3: "已截止"
};
var answerFlagMapping = {
1: ImitateAnswermodules.flagActive,
2: ImitateAnswermodules.flagHalf
};
var scoreStatusMapping = {
0: 'c-red-ee4',
1: 'c-green'
};
var mapping = (/* unused pure expression or super */ null && (["单选题", "多选题", "判断题", "填空题", "简答题", "实训题", "编程题"]));
var Answer = function Answer(_ref) {
var _answerData$exercise4, _user$userInfo, _user$userInfo$course, _user$userInfo2, _user$userInfo3, _answerData$exercise17, _answerData$exercise18, _answerData$user_scor, _answerData$exercise19, _answerData$exercise20, _answerData$exercise21, _answerData$exercise22, _answerData$exercise23, _answerData$exercise24, _answerData$question_3, _answerData$question_4, _answerData$exercise_20, _answerData$question_5, _answerData$question_6, _answerData$exercise_21, _answerData$exercise_22, _answerData$exercise_23, _answerData$exercise_24, _answerData$exercise_25, _answerData$exercise_26, _answerData$exercise_27, _answerData$exercise_28, _answerData$exercise_33, _answerData$exercise_34, _answerData$exercise_35, _answerData$exercise_36;
var 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 _useState = (0,react.useState)({}),
_useState2 = slicedToArray_default()(_useState, 2),
answerData = _useState2[0],
setAnswerData = _useState2[1];
var _useState3 = (0,react.useState)({}),
_useState4 = slicedToArray_default()(_useState3, 2),
answerCheckData = _useState4[0],
setAnswerCheckData = _useState4[1];
var _useState5 = (0,react.useState)({}),
_useState6 = slicedToArray_default()(_useState5, 2),
hideAnswerCard = _useState6[0],
setHideAnswerCard = _useState6[1];
var _useState7 = (0,react.useState)(false),
_useState8 = slicedToArray_default()(_useState7, 2),
isSpin = _useState8[0],
setIsSpin = _useState8[1];
var _useState9 = (0,react.useState)(true),
_useState10 = slicedToArray_default()(_useState9, 2),
showAnswerCard = _useState10[0],
setShowAnswerCard = _useState10[1];
var _useState11 = (0,react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
showCamera = _useState12[0],
setShowCamera = _useState12[1];
var _useState13 = (0,react.useState)(false),
_useState14 = slicedToArray_default()(_useState13, 2),
openFullScreen = _useState14[0],
setOpenFullScreen = _useState14[1];
var _useState15 = (0,react.useState)(),
_useState16 = slicedToArray_default()(_useState15, 2),
time = _useState16[0],
setTime = _useState16[1];
var _useState17 = (0,react.useState)(0),
_useState18 = slicedToArray_default()(_useState17, 2),
submitProgress = _useState18[0],
setSubmitProgress = _useState18[1];
var _useState19 = (0,react.useState)(''),
_useState20 = slicedToArray_default()(_useState19, 2),
iframeUrl = _useState20[0],
setIframeUrl = _useState20[1];
var _useState21 = (0,react.useState)('none'),
_useState22 = slicedToArray_default()(_useState21, 2),
iframeBlock = _useState22[0],
setIframeBlock = _useState22[1];
var _useState23 = (0,react.useState)(''),
_useState24 = slicedToArray_default()(_useState23, 2),
countDownColor = _useState24[0],
setCountDownColor = _useState24[1];
var _useState25 = (0,react.useState)({
status: 0
}),
_useState26 = slicedToArray_default()(_useState25, 2),
checkStatus = _useState26[0],
setCheckStatus = _useState26[1]; //0ip合法,-1ip不在范围,-2已绑定其他ip
var iframe = (0,react.useRef)();
var _useState27 = (0,react.useState)(0),
_useState28 = slicedToArray_default()(_useState27, 2),
oneindex = _useState28[0],
setoneindex = _useState28[1]; //大题下标
var _useState29 = (0,react.useState)(0),
_useState30 = slicedToArray_default()(_useState29, 2),
twoindex = _useState30[0],
settwoindex = _useState30[1]; //小题下标
var _useState31 = (0,react.useState)(false),
_useState32 = slicedToArray_default()(_useState31, 2),
isShowmodal = _useState32[0],
setisshowmodal = _useState32[1];
var _useState33 = (0,react.useState)(false),
_useState34 = slicedToArray_default()(_useState33, 2),
ischecked = _useState34[0],
setischecked = _useState34[1];
var _useState35 = (0,react.useState)(),
_useState36 = slicedToArray_default()(_useState35, 2),
type = _useState36[0],
settype = _useState36[1];
var _useState37 = (0,react.useState)(),
_useState38 = slicedToArray_default()(_useState37, 2),
indexitems = _useState38[0],
setindexitems = _useState38[1];
(0,react.useEffect)(function () {
if ((0,authority/* isAdmin */.GJ)() || (0,authority/* isCommonAdminOrCreator */.EO)()) {
initData();
} else {
// history.replace('/403')
}
window.addEventListener('message', handleMessage);
return function () {
window.removeEventListener('message', handleMessage);
window.removeEventListener("beforeunload", onBeforeunload);
if (location.pathname.indexOf("/detail") > -1) (0,fullscreen/* exitFull */.BU)();
};
}, [params.categoryId, user.userInfo.login]);
var handleMessage = function handleMessage(data) {
if (data.data === 'backExercise') {
setIframeBlock("none");
setIframeUrl("");
initData();
}
};
var checkCamera = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var _res$data;
var res, _res$data2, _res$data3, _res$data4, ip, _res$data5, _res$data6, _res$data7, _res$data8, _res$data9;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return dispatch({
type: "exercise/getExerciseUserInfo",
payload: objectSpread2_default()({}, params)
});
case 2:
res = _context.sent;
setAnswerCheckData(objectSpread2_default()({}, res.data));
if (!((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.ip_limit) !== 'no')) {
_context.next = 11;
break;
}
if (!((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.ip_limit) === 'inner')) {
_context.next = 9;
break;
}
_context.next = 8;
return (0,Exercise_ip/* findLocalIp */.y)({
ip_limit: res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.ip_limit
});
case 8:
ip = _context.sent;
case 9:
_context.next = 11;
return (0,util/* checkLocalOrPublicIp */.oi)({
exerciseId: params.categoryId,
ip: ip,
errmsgHide: true,
ip_limit: res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.ip_limit
})["catch"](function (e) {
setCheckStatus(e);
});
case 11:
if (!((res === null || res === void 0 ? void 0 : res.status) == 0)) {
_context.next = 18;
break;
}
if (!((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.used_screen_num) > (res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.screen_num) && res !== null && res !== void 0 && (_res$data7 = res.data) !== null && _res$data7 !== void 0 && _res$data7.screen_open)) {
_context.next = 15;
break;
}
handleSubmitAnswer();
return _context.abrupt("return", false);
case 15:
setShowCamera(res === null || res === void 0 ? void 0 : res.data.check_camera);
setOpenFullScreen(res === null || res === void 0 ? void 0 : (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.screen_open);
if (!(res !== null && res !== void 0 && (_res$data9 = res.data) !== null && _res$data9 !== void 0 && _res$data9.check_camera)) {
initData();
}
case 18:
case "end":
return _context.stop();
}
}, _callee);
}));
return function checkCamera() {
return _ref2.apply(this, arguments);
};
}();
var onBeforeunload = function onBeforeunload(e) {
var confirmationMessage = "确定离开此页面吗?此页数据可能会丢失";
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
};
var initData = /*#__PURE__*/function () {
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var _res;
var res, _res2, _res3, _res3$exercise_scores;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setIsSpin(true);
_context2.next = 3;
return (0,exercise/* startSimulateAnswer */._F)(objectSpread2_default()({}, params))["catch"](function () {
return setIsSpin(false);
});
case 3:
res = _context2.sent;
((_res = res) === null || _res === void 0 ? void 0 : _res.exercise) && (res.exercise.user_exercise_status = 1);
// } else {
// // res = await getExerciseStartAnswer({ ...params }).catch(() => setIsSpin(false));
// // if (res.exercise?.commit_status > 0) {
// // window.removeEventListener("beforeunload", onBeforeunload)
// // }
// // if (res?.exercise?.left_time) {
// // setTimeout(() => {
// // setCountDownColor(styles.red);
// // }, (res?.exercise?.left_time - 300 > 0 ? res?.exercise?.left_time - 300 : 0) * 1000);
// // }
// }
setIsSpin(false);
if (res) {
res.exercise_types = ((_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.exercise_types) || ((_res3 = res) === null || _res3 === void 0 ? void 0 : (_res3$exercise_scores = _res3.exercise_scores) === null || _res3$exercise_scores === void 0 ? void 0 : _res3$exercise_scores.exercise_types);
setAnswerData(res);
}
case 7:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return function initData() {
return _ref3.apply(this, arguments);
};
}();
(0,react.useEffect)(function () {
var _answerData$exercise, _answerData$exercise2, _answerData$exercise3;
if (((_answerData$exercise = answerData.exercise) === null || _answerData$exercise === void 0 ? void 0 : _answerData$exercise.time) === 0) handleSubmitAnswer(); //自动任务失败进入后时间为0自动提交试卷
((_answerData$exercise2 = answerData.exercise) === null || _answerData$exercise2 === void 0 ? void 0 : _answerData$exercise2.time) && setTime(Date.now() + (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise3 = answerData.exercise) === null || _answerData$exercise3 === void 0 ? void 0 : _answerData$exercise3.time) * 1000 * 60);
}, [(_answerData$exercise4 = answerData.exercise) === null || _answerData$exercise4 === void 0 ? void 0 : _answerData$exercise4.time]);
var handleBackToRedo = function handleBackToRedo() {
var _answerData$exercise5;
if ((answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise5 = answerData.exercise) === null || _answerData$exercise5 === void 0 ? void 0 : _answerData$exercise5.exercise_status) === 3) {
es_modal/* default.confirm */.Z.confirm({
width: 530,
title: '提示',
centered: true,
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font16",
children: ["\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C"]
})
});
} else {
es_modal/* default.confirm */.Z.confirm({
width: 530,
title: '提示',
centered: true,
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font16",
children: ["\u5B66\u751F\u5C06\u5F97\u5230\u4E00\u6B21\u91CD\u65B0\u7B54\u9898\u7684\u673A\u4F1A\uFF0C\u73B0\u6709\u7684\u7B54\u9898\u60C5\u51B5\u5C06\u88AB\u6E05\u7A7A", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"]
}),
onOk: function () {
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
var _answerData$exercise_;
var res;
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
_context3.next = 2;
return (0,exercise/* redoExercise */.q6)({
categoryId: params.categoryId,
user_ids: [answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_ = answerData.exercise_answer_user) === null || _answerData$exercise_ === void 0 ? void 0 : _answerData$exercise_.user_id]
});
case 2:
res = _context3.sent;
if (res) {
message/* default.info */.ZP.info(res === null || res === void 0 ? void 0 : res.message);
handleToDetail();
}
case 4:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function onOk() {
return _onOk.apply(this, arguments);
}
return onOk;
}()
});
}
};
var handleToDetail = function handleToDetail() {
initData();
// location.href = (`/classrooms/${params.coursesId}/exercise/${params.categoryId}/detail`);
};
// 自动交卷
var handleFinishTime = /*#__PURE__*/function () {
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
var res, _time;
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
_context5.next = 2;
return (0,exercise/* submitSimulateExerciseAnswer */.kp)({
categoryId: params.categoryId,
commit_method: 2
});
case 2:
res = _context5.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
es_modal/* default.info */.Z.info({
width: 530,
title: '提示',
centered: true,
okText: '确定',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font16",
children: ["\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"]
}),
onOk: function () {
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
handleToDetail();
case 1:
case "end":
return _context4.stop();
}
}, _callee4);
}));
function onOk() {
return _onOk2.apply(this, arguments);
}
return onOk;
}()
});
message/* default.info */.ZP.info(res === null || res === void 0 ? void 0 : res.message);
}
if ((res === null || res === void 0 ? void 0 : res.status) === -3) {
_time = parseInt(res === null || res === void 0 ? void 0 : res.message);
answerData.exercise.time = _time;
setAnswerData(objectSpread2_default()({}, answerData));
}
case 5:
case "end":
return _context5.stop();
}
}, _callee5);
}));
return function handleFinishTime() {
return _ref4.apply(this, arguments);
};
}();
var goShixun = /*#__PURE__*/function () {
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6(item) {
var res;
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return (0,shixuns/* execShixun */.Ir)({
id: item.shixun_identifier
});
case 2:
res = _context6.sent;
if (res !== null && res !== void 0 && res.game_identifier) {
setIframeUrl("/tasks/".concat(res.game_identifier, "?type=exercises&exercisesId=").concat(params.categoryId, "&coursesId=").concat(params.coursesId, "&login=").concat(params.login, "&questionId=").concat(item.question_id));
setIframeBlock("block");
// props.history.push(`/tasks/${res.game_identifier}?type=exercises&exercisesId=${params.categoryId}&coursesId=${params.coursesId}&login=${params.login}&questionId=${item.question_id}`)
}
if ((res === null || res === void 0 ? void 0 : res.status) === -3) {
(0,util/* bindPhone */.eF)();
} else if ((res === null || res === void 0 ? void 0 : res.status) === 2) {
handleResetGame(res === null || res === void 0 ? void 0 : res.message, item.question_id);
} else if ((res === null || res === void 0 ? void 0 : res.status) === 3) {
handleInBeta(res === null || res === void 0 ? void 0 : res.message);
}
case 5:
case "end":
return _context6.stop();
}
}, _callee6);
}));
return function goShixun(_x) {
return _ref5.apply(this, arguments);
};
}();
var handleResetGame = function handleResetGame(url, question_id) {
var _url;
url = (_url = url) !== null && _url !== void 0 && _url.includes('.json') ? url : "".concat(url, ".json");
es_modal/* default.confirm */.Z.confirm({
centered: true,
title: '提示',
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc font16",
children: "\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"
}),
onOk: function () {
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
var res, execRes;
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
_context7.next = 2;
return (0,exercise/* resetMyGame */.$Q)({
url: url
});
case 2:
res = _context7.sent;
if (res) {
_context7.next = 5;
break;
}
return _context7.abrupt("return");
case 5:
message/* default.success */.ZP.success("重置成功,正在进入实训!");
_context7.next = 8;
return (0,shixuns/* execShixun */.Ir)({
id: res.shixun_identifier
});
case 8:
execRes = _context7.sent;
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
_context7.next = 12;
break;
}
goShixun({
shixun_identifier: execRes === null || execRes === void 0 ? void 0 : execRes.game_identifier,
question_id: question_id
});
// openNewWindow(`/tasks/${execRes.game_identifier}`);
return _context7.abrupt("return");
case 12:
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message, question_id);
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
}
case 13:
case "end":
return _context7.stop();
}
}, _callee7);
}));
function onOk() {
return _onOk3.apply(this, arguments);
}
return onOk;
}()
});
};
var handleInBeta = function handleInBeta(message) {
es_modal/* default.confirm */.Z.confirm({
centered: true,
title: '提示',
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font16",
children: ["\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01"]
})
});
};
var handleJoinShixun = function handleJoinShixun(item) {
if (item.redo) {
es_modal/* default.info */.Z.info({
width: 530,
title: '提示',
centered: true,
okText: '确定',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc font16",
children: "\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"
}),
onOk: function () {
var _onOk4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
var res, newQuestions, index, newItem;
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
_context8.next = 2;
return (0,exercise/* resetMyGame */.$Q)({
id: item.myshixun_identifier,
url: item.url
});
case 2:
res = _context8.sent;
if (res) {
newQuestions = (0,lodash.cloneDeep)(answerData === null || answerData === void 0 ? void 0 : answerData.exercise_question_types);
index = newQuestions === null || newQuestions === void 0 ? void 0 : newQuestions.findIndex(function (e) {
return e.question_type === 5;
});
newQuestions[index].items.find(function (er) {
return er.question_id === item.question_id;
}).redo = false;
newQuestions[index].items.find(function (er) {
return er.question_id === item.question_id;
}).shixun_identifier = res.shixun_identifier;
answerData.exercise_question_types = newQuestions;
setAnswerData(answerData);
newItem = objectSpread2_default()(objectSpread2_default()({}, item), {}, {
shixun_identifier: res.shixun_identifier
});
goShixun(newItem);
}
case 4:
case "end":
return _context8.stop();
}
}, _callee8);
}));
function onOk() {
return _onOk4.apply(this, arguments);
}
return onOk;
}()
});
} else {
goShixun(item);
}
};
var handleJoinProgram = /*#__PURE__*/function () {
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(item) {
var res;
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
if (!item.hack_identifier) {
_context9.next = 5;
break;
}
_context9.next = 3;
return (0,exercise/* startProgram */.nF)({
id: item.hack_identifier
});
case 3:
res = _context9.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setIframeUrl("/myproblems/".concat(res.identifier, "?type=exercises&exercisesId=").concat(params.categoryId, "&coursesId=").concat(params.coursesId, "&login=").concat(params.login, "&questionId=").concat(item.question_id));
setIframeBlock("block");
// props.history.push(`/myproblems/${res.identifier}?type=exercises&exercisesId=${params.categoryId}&coursesId=${params.coursesId}&login=${params.login}&questionId=${item.question_id}`)
}
case 5:
case "end":
return _context9.stop();
}
}, _callee9);
}));
return function handleJoinProgram(_x2) {
return _ref6.apply(this, arguments);
};
}();
var handleSave = /*#__PURE__*/function () {
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10(questionId, exercise_choice_id, answer_text, callBack) {
var ip, res;
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
if (questionId) {
_context10.next = 3;
break;
}
console.error("handleSave no questionId params");
return _context10.abrupt("return");
case 3:
_context10.next = 5;
return (0,exercise/* updateExerciseAnswers */.oX)({
questionId: questionId,
exercise_choice_id: exercise_choice_id,
answer_text: answer_text
});
case 5:
res = _context10.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
callBack && callBack();
}
case 7:
case "end":
return _context10.stop();
}
}, _callee10);
}));
return function handleSave(_x3, _x4, _x5, _x6) {
return _ref7.apply(this, arguments);
};
}();
var handleVerifySave = /*#__PURE__*/function () {
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13(isSave) {
var res, tip;
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
case 0:
_context13.next = 2;
return (0,exercise/* simulateBeginCommit */.WL)({
id: params.categoryId
});
case 2:
res = _context13.sent;
if (res) {
_context13.next = 5;
break;
}
return _context13.abrupt("return");
case 5:
if (res.question_undo !== 0 || res.oj_undo !== 0) {
tip = '';
if (res.question_undo !== 0 && res.oj_undo !== 0) {
tip = "\u6709 ".concat(res.question_undo, " \u9898\u672A\u5B8C\u6210\uFF0C\u5305\u542B ").concat(res.oj_undo, " \u4E2A\u7F16\u7A0B\u9898");
} else if (res.question_undo !== 0 && res.oj_undo === 0) {
tip = "\u6709 ".concat(res.question_undo, " \u9898\u672A\u5B8C\u6210");
} else if (res.question_undo === 0 && res.oj_undo !== 0) {
tip = "\u6709 ".concat(res.oj_undo, " \u7F16\u7A0B\u9898\u672A\u5B8C\u6210");
}
es_modal/* default.confirm */.Z.confirm({
width: 530,
title: '提示',
centered: true,
okText: '确定',
cancelText: '取消',
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tc font16",
children: [tip, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), isSave ? "\u5728".concat(moment_default()(res.end_time).format("YYYY-MM-DD HH:mm"), "\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898") : "\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"]
}),
onOk: function () {
var _onOk5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11() {
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
case 0:
if (isSave) {
handleToDetail();
} else {
handleSubmitAnswer();
}
case 1:
case "end":
return _context11.stop();
}
}, _callee11);
}));
function onOk() {
return _onOk5.apply(this, arguments);
}
return onOk;
}()
});
} else {
es_modal/* default.info */.Z.info({
width: 530,
title: '提示',
centered: true,
okText: '知道啦',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc font16",
children: isSave ? "\u5728".concat(moment_default()(res.end_time).format("YYYY-MM-DD HH:mm"), "\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898") : "\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"
}),
onOk: function () {
var _onOk6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
if (isSave) {
handleToDetail();
} else {
handleSubmitAnswer();
}
case 1:
case "end":
return _context12.stop();
}
}, _callee12);
}));
function onOk() {
return _onOk6.apply(this, arguments);
}
return onOk;
}()
});
}
case 6:
case "end":
return _context13.stop();
}
}, _callee13);
}));
return function handleVerifySave(_x7) {
return _ref8.apply(this, arguments);
};
}();
var submitProgressContent = function submitProgressContent(progress) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_progress/* default */.Z, {
strokeColor: {
from: '#108ee9',
to: '#87d068'
},
status: "active",
percent: progress
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "c-grey-c tc mt10 mb20",
children: "\u6B63\u5728\u5224\u5206\u4E2D\u2026"
})]
});
};
var submitProgressLoading = function submitProgressLoading() {
var progress = 0;
var modal = es_modal/* default.info */.Z.info({
title: "交卷中",
icon: null,
className: "modal-footer-none",
content: submitProgressContent(progress)
});
var interval = setInterval(function () {
if (progress <= 100) {
progress += 2;
modal.update({
content: submitProgressContent(progress)
});
} else {
modal.destroy();
clearInterval(interval);
}
}, 50);
};
var handleSubmitAnswer = /*#__PURE__*/function () {
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
var res;
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
case 0:
submitProgressLoading();
_context14.next = 3;
return (0,exercise/* submitSimulateExerciseAnswer */.kp)({
categoryId: params.categoryId,
commit_method: 1
});
case 3:
res = _context14.sent;
(0,fullscreen/* exitFull */.BU)();
dispatch({
type: "exercise/setActionTabs",
payload: objectSpread2_default()({}, {
removeEventListenerExitScreen: true
})
});
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
message/* default.success */.ZP.success(res === null || res === void 0 ? void 0 : res.message);
setShowCamera(false);
setTimeout(function () {
es_modal/* default.info */.Z.info({
title: "交卷成功!",
okText: "确定",
onOk: function onOk() {
handleToDetail();
}
});
}, 3000);
}
case 7:
case "end":
return _context14.stop();
}
}, _callee14);
}));
return function handleSubmitAnswer() {
return _ref9.apply(this, arguments);
};
}();
var handleChangeSingle = /*#__PURE__*/function () {
var _ref10 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15(value, id, key, item) {
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
case 0:
handleSave(id, value, null, function () {
//题目选中
// const newQuestions = cloneDeep(answerData?.exercise_question_types);
// const index = newQuestions?.findIndex((e: any) => e.question_type === key)
// newQuestions[index].items.find((item: any) => item.question_id === id).user_answer[0] = value;
// answerData.exercise_question_types = newQuestions;
//答题卡选中
answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = value ? 1 : 0;
item.user_answer = [];
item.user_answer.push(value);
if (!item.repeat_answer) {
item.israp = true;
}
setAnswerData(objectSpread2_default()({}, answerData));
});
case 1:
case "end":
return _context15.stop();
}
}, _callee15);
}));
return function handleChangeSingle(_x8, _x9, _x10, _x11) {
return _ref10.apply(this, arguments);
};
}();
var handleChangeSingles = /*#__PURE__*/function () {
var _ref11 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16(value, id, key, item, items) {
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
case 0:
handleSave(item.question_id, value, null, function () {
var _items$sub_exercise_q, _items$sub_exercise_q2, _items$sub_exercise_q3;
//题目选中
// const newQuestions = cloneDeep(answerData?.exercise_question_types);
// const index = newQuestions?.findIndex((e: any) => e.question_type === key)
// newQuestions[index].items.find((item: any) => item.question_id === id).user_answer[0] = value;
// answerData.exercise_question_types = newQuestions;
//答题卡选中
// console.log(answerData,id);
item.user_answer = [];
item.user_answer.push(value);
// let items=answerData?.exercise_question_types?.find((item:any)=>item.question_type === 7)?.items?.find((items:any)=>items.question_id===id)
var answer = items === null || items === void 0 ? void 0 : (_items$sub_exercise_q = items.sub_exercise_questions) === null || _items$sub_exercise_q === void 0 ? void 0 : _items$sub_exercise_q.filter(function (item) {
var _item$user_answer;
return ((_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer.length) === 0;
});
answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = (answer === null || answer === void 0 ? void 0 : answer.length) === (items === null || items === void 0 ? void 0 : (_items$sub_exercise_q2 = items.sub_exercise_questions) === null || _items$sub_exercise_q2 === void 0 ? void 0 : _items$sub_exercise_q2.length) ? 0 : (answer === null || answer === void 0 ? void 0 : answer.length) > 0 && (answer === null || answer === void 0 ? void 0 : answer.length) < (items === null || items === void 0 ? void 0 : (_items$sub_exercise_q3 = items.sub_exercise_questions) === null || _items$sub_exercise_q3 === void 0 ? void 0 : _items$sub_exercise_q3.length) ? 2 : 1;
setAnswerData(objectSpread2_default()({}, answerData));
// initData();
});
case 1:
case "end":
return _context16.stop();
}
}, _callee16);
}));
return function handleChangeSingles(_x12, _x13, _x14, _x15, _x16) {
return _ref11.apply(this, arguments);
};
}();
var handleChangeMultiple = function handleChangeMultiple(value, id, item) {
handleSave(id, value, null, function () {
item.user_answer = value;
if (!item.repeat_answer) {
item.israp = true;
}
answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = value !== null && value !== void 0 && value.length ? 1 : 0;
setAnswerData(objectSpread2_default()({}, answerData));
});
};
var handleBlurFill = function handleBlurFill(value, index, id, param, item) {
handleSave(id, index, value, function () {
answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = param.every(function (k) {
return !!k.answer_text;
}) ? 1 : answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = param.some(function (k) {
return !!k.answer_text;
}) ? 2 : 0;
// item.user_answer=value;
var answers = {
choice_id: index,
answer_text: value
};
if (item.user_answer.filter(function (item) {
return item.choice_id != index;
})) {
item.user_answer.splice(index - 1, 1, answers);
} else {
item.user_answer.push(answers);
}
if (!item.repeat_answer) {
item.israp = true;
}
// item.user_answer.filter((item:any)=>item.choice_id!=index)
setAnswerData(objectSpread2_default()({}, answerData));
});
};
var handleBlurSimple = function handleBlurSimple(value, id, item) {
handleSave(id, null, value, function () {
answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = value ? 1 : 0;
// item.user_answer=value;
item.user_answer = [];
item.user_answer.push(value);
if (!item.repeat_answer) {
item.israp = true;
}
setAnswerData(objectSpread2_default()({}, answerData));
});
};
var renderSingle = function renderSingle(item, key) {
var _item$user_answer2, _item$question_choice, _answerData$exercise6, _answerData$exercise7, _answerData$exercise8, _item$standard_answer;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
disabled: !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
defaultValue: item === null || item === void 0 ? void 0 : (_item$user_answer2 = item.user_answer) === null || _item$user_answer2 === void 0 ? void 0 : _item$user_answer2[0],
onChange: function onChange(e) {
return handleChangeSingle(e.target.value, item === null || item === void 0 ? void 0 : item.question_id, key, item);
},
className: item.user_score && "edu-radio-".concat(item.user_score === item.question_score ? "green" : "red"),
children: item === null || item === void 0 ? void 0 : (_item$question_choice = item.question_choices) === null || _item$question_choice === void 0 ? void 0 : _item$question_choice.map(function (answer, index) {
var _item$user_answer3;
var isJudge = item.question_type == 2;
var prefix = isJudge ? '' : "".concat(tagList[index], ".");
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImitateAnswermodules.answerWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
disabled: !item.repeat_answer && (item === null || item === void 0 ? void 0 : (_item$user_answer3 = item.user_answer) === null || _item$user_answer3 === void 0 ? void 0 : _item$user_answer3.length) > 0 && !item.israp,
value: answer === null || answer === void 0 ? void 0 : answer.choice_id,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "mr3",
children: prefix
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
style: {
width: 740
},
className: ImitateAnswermodules.renderHtml,
value: answer === null || answer === void 0 ? void 0 : answer.choice_text
})]
})
}, index);
})
}), (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise6 = answerData.exercise) === null || _answerData$exercise6 === void 0 ? void 0 : _answerData$exercise6.answer_open) && ((answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise7 = answerData.exercise) === null || _answerData$exercise7 === void 0 ? void 0 : _answerData$exercise7.exercise_status) == 3 || (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise8 = answerData.exercise) === null || _answerData$exercise8 === void 0 ? void 0 : _answerData$exercise8.user_exercise_status) == 1) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", item === null || item === void 0 ? void 0 : (_item$standard_answer = item.standard_answer) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer.map(function (answer, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: tagList[Number(answer) - 1]
});
})]
})]
});
};
var renderSingles = function renderSingles(items, keys, i) {
var _items$sub_exercise_q4;
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: items === null || items === void 0 ? void 0 : (_items$sub_exercise_q4 = items.sub_exercise_questions) === null || _items$sub_exercise_q4 === void 0 ? void 0 : _items$sub_exercise_q4.map(function (item, key) {
var _item$user_answer4, _item$question_choice2, _answerData$exercise9, _answerData$exercise10, _answerData$exercise11, _item$standard_answer2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
marginTop: 20,
userSelect: "none"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
flexShrink: 0
},
className: "font18",
children: [i + 1 + '.' + (key + 1), "\uFF08\u5355\u9009\u9898\uFF09"]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item === null || item === void 0 ? void 0 : item.question_title
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
flexShrink: 0
},
className: "font16",
children: ["\uFF08", item === null || item === void 0 ? void 0 : item.question_score, "\u5206\uFF09"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
disabled: !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
defaultValue: item === null || item === void 0 ? void 0 : (_item$user_answer4 = item.user_answer) === null || _item$user_answer4 === void 0 ? void 0 : _item$user_answer4[0],
onChange: function onChange(e) {
return handleChangeSingles(e.target.value, items === null || items === void 0 ? void 0 : items.question_id, key, item, items);
},
className: item.user_score && "edu-radio-".concat(item.user_score === item.question_score ? "green" : "red"),
children: item === null || item === void 0 ? void 0 : (_item$question_choice2 = item.question_choices) === null || _item$question_choice2 === void 0 ? void 0 : _item$question_choice2.map(function (answer, index) {
var _item$user_answer5;
var isJudge = item.question_type == 2;
var prefix = isJudge ? '' : "".concat(tagList[index], ".");
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImitateAnswermodules.answerWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
disabled: !item.repeat_answer && (item === null || item === void 0 ? void 0 : (_item$user_answer5 = item.user_answer) === null || _item$user_answer5 === void 0 ? void 0 : _item$user_answer5.length) > 0,
value: answer === null || answer === void 0 ? void 0 : answer.choice_id,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "mr3",
children: prefix
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
style: {
width: 734
},
className: ImitateAnswermodules.renderHtml,
value: answer === null || answer === void 0 ? void 0 : answer.choice_text
})]
})
}, index);
})
}), (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise9 = answerData.exercise) === null || _answerData$exercise9 === void 0 ? void 0 : _answerData$exercise9.answer_open) && ((answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise10 = answerData.exercise) === null || _answerData$exercise10 === void 0 ? void 0 : _answerData$exercise10.exercise_status) == 3 || (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise11 = answerData.exercise) === null || _answerData$exercise11 === void 0 ? void 0 : _answerData$exercise11.user_exercise_status) == 1) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", item === null || item === void 0 ? void 0 : (_item$standard_answer2 = item.standard_answer) === null || _item$standard_answer2 === void 0 ? void 0 : _item$standard_answer2.map(function (answer, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: tagList[Number(answer) - 1]
});
})]
})]
});
})
});
};
var renderMultiple = function renderMultiple(item, key) {
var _item$question_choice3, _answerData$exercise12, _answerData$exercise13, _item$standard_answer3;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default.Group */.Z.Group, {
disabled: !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
defaultValue: item === null || item === void 0 ? void 0 : item.user_answer,
onChange: function onChange(value) {
return handleChangeMultiple(value, item === null || item === void 0 ? void 0 : item.question_id, item);
},
className: item.user_score && "edu-checkbox-".concat(item.user_score === item.question_score ? "green" : "red"),
children: item === null || item === void 0 ? void 0 : (_item$question_choice3 = item.question_choices) === null || _item$question_choice3 === void 0 ? void 0 : _item$question_choice3.map(function (answer, index) {
var _item$user_answer6;
var prefix = "".concat(tagList[index], ".");
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImitateAnswermodules.answerWrap,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
disabled: !item.repeat_answer && (item === null || item === void 0 ? void 0 : (_item$user_answer6 = item.user_answer) === null || _item$user_answer6 === void 0 ? void 0 : _item$user_answer6.length) > 0 && !item.israp,
value: answer === null || answer === void 0 ? void 0 : answer.choice_id,
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "mr3",
children: prefix
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
className: ImitateAnswermodules.renderHtml,
value: answer === null || answer === void 0 ? void 0 : answer.choice_text
})]
})
});
})
}), (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise12 = answerData.exercise) === null || _answerData$exercise12 === void 0 ? void 0 : _answerData$exercise12.answer_open) && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise13 = answerData.exercise) === null || _answerData$exercise13 === void 0 ? void 0 : _answerData$exercise13.exercise_status) == 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", item === null || item === void 0 ? void 0 : (_item$standard_answer3 = item.standard_answer) === null || _item$standard_answer3 === void 0 ? void 0 : _item$standard_answer3.map(function (answer, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
children: tagList[Number(answer) - 1]
});
})]
})]
});
};
var renderFill = function renderFill(item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Fill, {
item: item,
answerData: answerData,
onBlur: function onBlur(value, index, userAnswer) {
return handleBlurFill(value, index, item === null || item === void 0 ? void 0 : item.question_id, userAnswer, item);
}
});
};
// 简答题
var renderSimple = function renderSimple(item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Simple, {
item: item,
answerData: answerData,
onBlur: function onBlur(value) {
return handleBlurSimple(value, item === null || item === void 0 ? void 0 : item.question_id, item);
}
});
};
var renderShixun = function renderShixun(item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Shixun, {
item: item,
answerData: answerData
});
};
var renderProgram = function renderProgram(item, key) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Program, {
item: item,
answerData: answerData
});
};
var renderAnswerCard = function renderAnswerCard(title, key, index) {
var _answerData$exercise_2, _obj$items;
var obj = answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_2 = answerData.exercise_question_types) === null || _answerData$exercise_2 === void 0 ? void 0 : _answerData$exercise_2.find(function (item) {
return item.question_type === key;
});
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("h1", {
className: "font14 current",
onClick: function onClick() {
hideAnswerCard[key] = !hideAnswerCard[key];
setHideAnswerCard(objectSpread2_default()({}, hideAnswerCard));
},
children: [!hideAnswerCard[key] && /*#__PURE__*/(0,jsx_runtime.jsx)(MinusSquareOutlined/* default */.Z, {}), hideAnswerCard[key] && /*#__PURE__*/(0,jsx_runtime.jsx)(PlusSquareOutlined/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml5 c-grey-666",
children: title
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("ul", {
className: ImitateAnswermodules.answerSheet,
children: !hideAnswerCard[key] && (obj === null || obj === void 0 ? void 0 : (_obj$items = obj.items) === null || _obj$items === void 0 ? void 0 : _obj$items.map(function (item, k) {
if (item.question_type === key) {
var _answerData$question_, _answerData$question_2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
onClick: function onClick() {
var _answerData$exercise14;
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
setAnswerData(objectSpread2_default()({}, answerData));
if (!ischecked && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise14 = answerData.exercise) === null || _answerData$exercise14 === void 0 ? void 0 : _answerData$exercise14.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
var _answerData$exercise_3, _answerData$exercise_4, _answerData$exercise_5, _answerData$exercise_6;
if (!((_answerData$exercise_3 = answerData.exercise_question_types) !== null && _answerData$exercise_3 !== void 0 && (_answerData$exercise_4 = _answerData$exercise_3[oneindex]) !== null && _answerData$exercise_4 !== void 0 && (_answerData$exercise_5 = _answerData$exercise_4.items) !== null && _answerData$exercise_5 !== void 0 && (_answerData$exercise_6 = _answerData$exercise_5[twoindex]) !== null && _answerData$exercise_6 !== void 0 && _answerData$exercise_6.repeat_answer)) {
setisshowmodal(true);
settype(3);
setindexitems({
oneindex: index,
twoindex: k
});
return;
}
}
setoneindex(index);
settwoindex(k);
// initData();
var anchorName = "Anchor_".concat(key, "_").concat(k);
var anchorElement = document.getElementById(anchorName);
if (anchorElement) {
setTimeout(function () {
return anchorElement.scrollIntoView({
block: "start",
behavior: "smooth"
});
});
}
},
className: (answerData === null || answerData === void 0 ? void 0 : (_answerData$question_ = answerData.question_status) === null || _answerData$question_ === void 0 ? void 0 : _answerData$question_.some(function (val) {
return val.ques_id === item.question_id && (val === null || val === void 0 ? void 0 : val.ques_status) === 1;
})) && ImitateAnswermodules.active,
children: [k + 1, (answerData === null || answerData === void 0 ? void 0 : (_answerData$question_2 = answerData.question_status) === null || _answerData$question_2 === void 0 ? void 0 : _answerData$question_2.some(function (val) {
return val.ques_id === item.question_id && (val === null || val === void 0 ? void 0 : val.ques_status) === 2;
})) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
height: 3,
background: '#0152d9',
position: 'absolute',
width: 26,
bottom: 0
}
})]
}, k);
}
}))
}, key)]
});
};
var renderQuestion = function renderQuestion(item, i) {
var _item$sub_exercise_qu, _item$schools, _item$answer_comments, _item$answer_comments2, _answerData$exercise15, _answerData$exercise16;
var title = (item === null || item === void 0 ? void 0 : item.question_type) == 5 ? item === null || item === void 0 ? void 0 : item.shixun_name : item === null || item === void 0 ? void 0 : item.question_title;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImitateAnswermodules.questionItem,
id: "Anchor_".concat(item === null || item === void 0 ? void 0 : item.question_type, "_").concat(i),
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: 'flex',
marginTop: 20,
userSelect: "none"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
flexShrink: 0
},
className: "font18",
children: [i + 1, "."]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
value: item === null || item === void 0 ? void 0 : item.question_title
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
style: {
flexShrink: 0
},
className: "font16",
children: ["\uFF08", (item === null || item === void 0 ? void 0 : item.question_type) === 7 ? "\u5171".concat(item === null || item === void 0 ? void 0 : (_item$sub_exercise_qu = item.sub_exercise_questions) === null || _item$sub_exercise_qu === void 0 ? void 0 : _item$sub_exercise_qu.length, "\u5C0F\u9898\uFF0C") : '', item === null || item === void 0 ? void 0 : item.question_score, "\u5206\uFF09"]
}), !(item !== null && item !== void 0 && item.repeat_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#FA6400 ',
marginLeft: 10,
fontSize: 16
},
children: "\u6CE8\u610F\uFF1A\u8BE5\u9898\u4E0D\u5141\u8BB8\u91CD\u590D\u7B54\u9898"
}), !!(item !== null && item !== void 0 && (_item$schools = item.schools) !== null && _item$schools !== void 0 && _item$schools.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: "\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-zhidinggongkai1 line24 font18 c-orange"
})
})]
}),
// 单选题
(item === null || item === void 0 ? void 0 : item.question_type) == 0 && renderSingle(item, item === null || item === void 0 ? void 0 : item.question_type),
// 判断题
(item === null || item === void 0 ? void 0 : item.question_type) == 2 && renderSingle(item, item === null || item === void 0 ? void 0 : item.question_type),
// 多选题
(item === null || item === void 0 ? void 0 : item.question_type) == 1 && renderMultiple(item, item === null || item === void 0 ? void 0 : item.question_type),
// 填空题
(item === null || item === void 0 ? void 0 : item.question_type) == 3 && renderFill(item, item === null || item === void 0 ? void 0 : item.question_type),
// 简答题
(item === null || item === void 0 ? void 0 : item.question_type) == 4 && renderSimple(item, item === null || item === void 0 ? void 0 : item.question_type),
// 实训题
(item === null || item === void 0 ? void 0 : item.question_type) == 5 && renderShixun(item, item === null || item === void 0 ? void 0 : item.question_type),
// 编程题
(item === null || item === void 0 ? void 0 : item.question_type) == 6 && renderProgram(item, item === null || item === void 0 ? void 0 : item.question_type),
// 组合题
(item === null || item === void 0 ? void 0 : item.question_type) == 7 && renderSingles(item, item === null || item === void 0 ? void 0 : item.question_type, i)
// renderProgram(item, item?.question_type)
, !!(item !== null && item !== void 0 && (_item$answer_comments = item.answer_comments) !== null && _item$answer_comments !== void 0 && _item$answer_comments.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "mt30",
children: item === null || item === void 0 ? void 0 : (_item$answer_comments2 = item.answer_comments) === null || _item$answer_comments2 === void 0 ? void 0 : _item$answer_comments2.map(function (v, k) {
var _v$user, _v$user2;
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
gutter: [0, 10],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "50px",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
src: env/* default.API_SERVER */.Z.API_SERVER + '/images/' + ((_v$user = v.user) === null || _v$user === void 0 ? void 0 : _v$user.image_url),
width: "40",
style: {
borderRadius: 40
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
flex: "1",
children: [v.updated_at, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), (_v$user2 = v.user) === null || _v$user2 === void 0 ? void 0 : _v$user2.name]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
className: "c-grey-c",
children: [v.shixun_chanllge_position && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u7B2C", v.shixun_chanllge_position, "\u5173"]
}), item.question_type !== 4 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u539F\u59CB\u5F97\u5206", v.origin_score, "\u5206 \uFF0C"]
}), " \u4FEE\u6B63\u4E3A", v.score, "\u5206"]
})]
}), v.comment && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
align: "middle",
gutter: [0, 10],
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "50px"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ImitateAnswer_TextArea, {
autoSize: true,
value: v.comment,
disabled: true
})
})]
})]
});
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: ImitateAnswermodules.itemType,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [(item === null || item === void 0 ? void 0 : item.question_type) < 3 && (item === null || item === void 0 ? void 0 : item.standard_answer_show) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font16 ml20",
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", item === null || item === void 0 ? void 0 : item.standard_answer_show]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 ml20",
children: (item === null || item === void 0 ? void 0 : item.user_score) !== null && (item === null || item === void 0 ? void 0 : item.user_score) >= 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: scoreStatusMapping[Number(item === null || item === void 0 ? void 0 : item.answer_status)] || 'c-orange-ff9',
children: item === null || item === void 0 ? void 0 : item.user_score
}), " \u5206"]
})
}),
// 实训题 ,答题
(item === null || item === void 0 ? void 0 : item.question_type) == 5 && !((_answerData$exercise15 = answerData.exercise) !== null && _answerData$exercise15 !== void 0 && _answerData$exercise15.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
type: "primary",
className: "font14 ml20",
onClick: function onClick() {
return handleJoinShixun(item);
},
children: "\u8FDB\u5165\u7B54\u9898"
}),
// 编程题 ,答题
(item === null || item === void 0 ? void 0 : item.question_type) == 6 && !((_answerData$exercise16 = answerData.exercise) !== null && _answerData$exercise16 !== void 0 && _answerData$exercise16.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
type: "primary",
className: "font14 ml20",
onClick: function onClick() {
return handleJoinProgram(item);
},
children: "\u8FDB\u5165\u7B54\u9898"
})]
})]
})
})]
});
};
var renderCardList = function renderCardList(item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [item.question_type === 0 && renderAnswerCard('单选题', 0, index), item.question_type === 1 && renderAnswerCard('多选题', 1, index), item.question_type === 2 && renderAnswerCard('判断题', 2, index), item.question_type === 3 && renderAnswerCard('填空题', 3, index), item.question_type === 4 && renderAnswerCard('简答题', 4, index), item.question_type === 5 && renderAnswerCard('实训题', 5, index), item.question_type === 6 && renderAnswerCard('编程题', 6, index), item.question_type === 7 && renderAnswerCard('组合题', 7, index)]
});
};
//转换中文
var toChinesNum = function toChinesNum(num) {
var changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; //changeNum[0] = "零"
var unit = ["", "十", "百", "千", "万"];
num = parseInt(num);
var getWan = function getWan(temp) {
var strArr = temp.toString().split("").reverse();
var newNum = "";
for (var i = 0; i < strArr.length; i++) {
newNum = (i == 0 && strArr[i] == 0 ? "" : i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i])) + newNum;
}
return newNum;
};
var overWan = Math.floor(num / 10000);
var noWan = num % 10000;
if (noWan.toString().length < 4) noWan = "0" + noWan;
return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
};
var renderClassifyQuestion = function renderClassifyQuestion() {
var _answerData$exercise_7, _answerData$exercise_8, _answerData$exercise_9, _answerData$exercise_10, _answerData$exercise_11, _answerData$exercise_12, _answerData$exercise_13, _answerData$exercise_14, _answerData$exercise_15, _answerData$exercise_16, _answerData$exercise_17, _answerData$exercise_18, _answerData$exercise_19;
// const dom = answerData?.exercise_question_types?.map((er: any, index: number) => {
// return <Fragment key={index}>
// <div className="pt20">
// <span className="font16 c-light-primary">{toChinesNum(index + 1)}、{er.name}</span>
// <span className="c-grey-999">(共{er.count}题;共{er.score}分)</span>
// </div>
// {er.items?.map(function (item: any, i: number) {
// return <Fragment key={i}>
// {renderQuestion(item, i)}
// </Fragment>
// })
// }
// </Fragment>
return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "pt20",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "font16 c-light-primary",
children: [toChinesNum(oneindex + 1), "\u3001", answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_7 = answerData.exercise_question_types) === null || _answerData$exercise_7 === void 0 ? void 0 : (_answerData$exercise_8 = _answerData$exercise_7[oneindex]) === null || _answerData$exercise_8 === void 0 ? void 0 : _answerData$exercise_8.name]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "c-grey-999",
children: ["\uFF08\u5171", answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_9 = answerData.exercise_question_types) === null || _answerData$exercise_9 === void 0 ? void 0 : (_answerData$exercise_10 = _answerData$exercise_9[oneindex]) === null || _answerData$exercise_10 === void 0 ? void 0 : _answerData$exercise_10.count, "\u9898\uFF1B", (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_11 = answerData.exercise_question_types) === null || _answerData$exercise_11 === void 0 ? void 0 : (_answerData$exercise_12 = _answerData$exercise_11[oneindex]) === null || _answerData$exercise_12 === void 0 ? void 0 : _answerData$exercise_12.question_type) === 7 ? "\u5305\u542B".concat(answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_13 = answerData.exercise_question_types) === null || _answerData$exercise_13 === void 0 ? void 0 : (_answerData$exercise_14 = _answerData$exercise_13[oneindex]) === null || _answerData$exercise_14 === void 0 ? void 0 : _answerData$exercise_14.sub_questions_count, "\u5C0F\u9898") : '', " \u5171", answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_15 = answerData.exercise_question_types) === null || _answerData$exercise_15 === void 0 ? void 0 : (_answerData$exercise_16 = _answerData$exercise_15[oneindex]) === null || _answerData$exercise_16 === void 0 ? void 0 : _answerData$exercise_16.score, "\u5206\uFF09"]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
children: renderQuestion(answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_17 = answerData.exercise_question_types) === null || _answerData$exercise_17 === void 0 ? void 0 : (_answerData$exercise_18 = _answerData$exercise_17[oneindex]) === null || _answerData$exercise_18 === void 0 ? void 0 : (_answerData$exercise_19 = _answerData$exercise_18.items) === null || _answerData$exercise_19 === void 0 ? void 0 : _answerData$exercise_19[twoindex], twoindex)
}, twoindex)]
}, oneindex);
};
return /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
size: "large",
spinning: isSpin,
children: [openFullScreen && /*#__PURE__*/(0,jsx_runtime.jsx)(recordScreen/* default */.Z, {
iframe: iframe
}), /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
style: {
display: iframeBlock
},
id: "iframeShixuns",
className: ImitateAnswermodules.iframe,
src: iframeUrl,
ref: iframe,
frameBorder: "0"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "edu-container",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: "animated fadeIn",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "mt10",
children: [globalSetting.showHeaderFooter && params.coursesId !== 'coursesId' && /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
separator: ">",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/exercise"),
children: (_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : (_user$userInfo$course = _user$userInfo.course) === null || _user$userInfo$course === void 0 ? void 0 : _user$userInfo$course.course_name
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/exercise"),
children: "\u8BD5\u5377"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/classrooms/".concat(params.coursesId, "/exercise/").concat(params.categoryId, "/detail"),
children: "\u8BD5\u5377\u8BE6\u60C5"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
children: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.real_name
})]
}), globalSetting.showHeaderFooter && params.coursesId === 'coursesId' && /*#__PURE__*/(0,jsx_runtime.jsxs)(breadcrumb/* default */.Z, {
separator: ">",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: "/paperlibrary",
children: "\u8BD5\u5377\u5E93"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(breadcrumb/* default.Item */.Z.Item, {
children: (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.real_name
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: [ImitateAnswermodules.title, 'mt10'].join(' '),
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
style: {
width: "100%"
},
align: "middle",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImitateAnswermodules.title,
children: [(globalSetting === null || globalSetting === void 0 ? void 0 : globalSetting.showHeaderFooter) && /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
to: params.coursesId === 'coursesId' ? "/paperlibrary" : "/classrooms/".concat(params.coursesId, "/exercise/").concat(params.categoryId, "/detail"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ArrowLeftOutlined/* default */.Z, {
className: "font16 c-black"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("strong", {
className: "font24 ml5",
children: answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise17 = answerData.exercise) === null || _answerData$exercise17 === void 0 ? void 0 : _answerData$exercise17.exercise_name
}), (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise18 = answerData.exercise) === null || _answerData$exercise18 === void 0 ? void 0 : _answerData$exercise18.is_random) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: ImitateAnswermodules.randomFlag,
children: "\u968F\u673A"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(util/* StatusClassroomsTags */.VV, {
status: [util/* ExerciseStatus.99 */.ju[99]]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
style: {
display: 'flex'
},
children: [(answerData === null || answerData === void 0 ? void 0 : (_answerData$user_scor = answerData.user_score) === null || _answerData$user_scor === void 0 ? void 0 : _answerData$user_scor.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6A21\u62DF\u8003\u8BD5\u603B\u5F97\u5206\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-red",
children: answerData === null || answerData === void 0 ? void 0 : answerData.user_score
}), " \u5206"]
}), !!(answerData !== null && answerData !== void 0 && (_answerData$exercise19 = answerData.exercise) !== null && _answerData$exercise19 !== void 0 && _answerData$exercise19.time) && !(answerData !== null && answerData !== void 0 && (_answerData$exercise20 = answerData.exercise) !== null && _answerData$exercise20 !== void 0 && _answerData$exercise20.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "".concat(ImitateAnswermodules.countDown, " ").concat(countDownColor),
children: ["\u5269\u4F59\u65F6\u95F4:", /*#__PURE__*/(0,jsx_runtime.jsx)(Countdown, {
value: time,
onFinish: handleFinishTime
})]
}), !(answerData !== null && answerData !== void 0 && (_answerData$exercise21 = answerData.exercise) !== null && _answerData$exercise21 !== void 0 && _answerData$exercise21.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
className: ImitateAnswermodules.submitButton,
style: {
marginLeft: 20
},
type: "primary",
onClick: function onClick() {
return handleVerifySave(false);
},
children: "\u4EA4\u5377"
})]
})]
})
})]
}), checkStatus.status === 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
className: "mt10",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: showAnswerCard ? "316px" : "16px",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
style: {
position: "sticky",
top: 0,
zIndex: 1
},
children: [showCamera && /*#__PURE__*/(0,jsx_runtime.jsx)(CaptureVideo/* default */.Z, {
number: (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise22 = answerData.exercise) === null || _answerData$exercise22 === void 0 ? void 0 : _answerData$exercise22.photo_count) - (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise23 = answerData.exercise) === null || _answerData$exercise23 === void 0 ? void 0 : _answerData$exercise23.take_photo),
time: (_answerData$exercise24 = answerData.exercise) === null || _answerData$exercise24 === void 0 ? void 0 : _answerData$exercise24.left_time,
update: initData,
supportCamera: function supportCamera(type) {
if (type === 2) {
initData();
setOpenFullScreen(answerCheckData === null || answerCheckData === void 0 ? void 0 : answerCheckData.screen_open);
// window.onblur = function () {
// if (IsFull()) {
// exitFull()
// }
// };
} else if (type === 1) {
setTimeout(function () {
return props.history.push("/");
}, 3000);
}
}
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "relative",
style: {
minHeight: 236
},
children: [showAnswerCard && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
className: "bg-white p16",
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 8,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "font16 blod",
children: "\u7B54\u9898\u5361"
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 16,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "tr",
style: {
display: 'flex',
alignItems: 'center',
justifyContent: 'end'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: ImitateAnswermodules.answerYes
}), "\u5DF2\u7B54", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
width: 13,
height: 13,
display: 'flex',
flexDirection: 'column-reverse'
},
className: "".concat(ImitateAnswermodules.answerNo, " ml10"),
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
height: '10%',
background: '#0152d9'
}
})
}), "\u90E8\u5206\u7B54\u9898", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "".concat(ImitateAnswermodules.answerNo, " ml10")
}), "\u672A\u7B54"]
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: ImitateAnswermodules.answerInfo,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 12,
children: "\u7B54\u9898\u8FDB\u5EA6"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
span: 12,
className: "tr c-blue",
children: [answerData === null || answerData === void 0 ? void 0 : (_answerData$question_3 = answerData.question_status) === null || _answerData$question_3 === void 0 ? void 0 : (_answerData$question_4 = _answerData$question_3.filter(function (val) {
return (val === null || val === void 0 ? void 0 : val.ques_status) === 1;
})) === null || _answerData$question_4 === void 0 ? void 0 : _answerData$question_4.length, " / ", answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_20 = answerData.exercise_types) === null || _answerData$exercise_20 === void 0 ? void 0 : _answerData$exercise_20.q_counts]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
span: 24,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_progress/* default */.Z, {
trailColor: "#c3ced2",
percent: (answerData === null || answerData === void 0 ? void 0 : (_answerData$question_5 = answerData.question_status) === null || _answerData$question_5 === void 0 ? void 0 : (_answerData$question_6 = _answerData$question_5.filter(function (val) {
return (val === null || val === void 0 ? void 0 : val.ques_status) === 1;
})) === null || _answerData$question_6 === void 0 ? void 0 : _answerData$question_6.length) / (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_21 = answerData.exercise_types) === null || _answerData$exercise_21 === void 0 ? void 0 : _answerData$exercise_21.q_counts) * 100,
showInfo: false
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "c-grey-333",
children: ["\u5171 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue-4ca",
children: (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_22 = answerData.exercise_types) === null || _answerData$exercise_22 === void 0 ? void 0 : _answerData$exercise_22.q_counts) || (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_23 = answerData.exercise_scores) === null || _answerData$exercise_23 === void 0 ? void 0 : (_answerData$exercise_24 = _answerData$exercise_23.exercise_types) === null || _answerData$exercise_24 === void 0 ? void 0 : _answerData$exercise_24.q_counts)
}), " \u9898\uFF1A"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "c-grey-333",
children: ["\u6EE1\u5206 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "c-blue-4ca",
children: (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_25 = answerData.exercise_types) === null || _answerData$exercise_25 === void 0 ? void 0 : _answerData$exercise_25.q_scores) || (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_26 = answerData.exercise_scores) === null || _answerData$exercise_26 === void 0 ? void 0 : (_answerData$exercise_27 = _answerData$exercise_26.exercise_types) === null || _answerData$exercise_27 === void 0 ? void 0 : _answerData$exercise_27.q_scores)
}), " \u5206"]
})]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: ImitateAnswermodules.cardList,
children: answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_28 = answerData.exercise_question_types) === null || _answerData$exercise_28 === void 0 ? void 0 : _answerData$exercise_28.map(function (er, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
children: renderCardList(er, index)
}, er.question_type);
})
})
})
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: ImitateAnswermodules.fold,
onClick: function onClick() {
return setShowAnswerCard(!showAnswerCard);
},
children: [showAnswerCard && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-zuojiantou iconfont c-grey-c"
}), !showAnswerCard && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "icon-youjiantou iconfont c-grey-c"
})]
})]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
className: [ImitateAnswermodules.bg, 'pl30', 'pr30', 'pb30', 'mb50', 'ml20'].join(' '),
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
maxHeight: 600,
overflow: 'hidden auto'
},
children: renderClassifyQuestion()
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: 60,
textAlign: 'center'
},
children: [(oneindex != 0 || twoindex != 0) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
className: "".concat(ImitateAnswermodules.submitButton, " mr10"),
type: "default",
onClick: function onClick() {
var _answerData$exercise25;
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
setAnswerData(objectSpread2_default()({}, answerData));
if (!ischecked && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise25 = answerData.exercise) === null || _answerData$exercise25 === void 0 ? void 0 : _answerData$exercise25.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
var _answerData$exercise_29, _answerData$exercise_30, _answerData$exercise_31, _answerData$exercise_32;
if (!((_answerData$exercise_29 = answerData.exercise_question_types) !== null && _answerData$exercise_29 !== void 0 && (_answerData$exercise_30 = _answerData$exercise_29[oneindex]) !== null && _answerData$exercise_30 !== void 0 && (_answerData$exercise_31 = _answerData$exercise_30.items) !== null && _answerData$exercise_31 !== void 0 && (_answerData$exercise_32 = _answerData$exercise_31[twoindex]) !== null && _answerData$exercise_32 !== void 0 && _answerData$exercise_32.repeat_answer)) {
setisshowmodal(true);
settype(1);
return;
}
}
if (twoindex === 0) {
oneindex -= 1;
twoindex = answerData.exercise_question_types[oneindex].items.length - 1;
} else {
twoindex -= 1;
}
setoneindex(oneindex);
settwoindex(twoindex);
// initData();
},
children: "\u4E0A\u4E00\u9898"
}), !(oneindex === (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_33 = answerData.exercise_question_types) === null || _answerData$exercise_33 === void 0 ? void 0 : _answerData$exercise_33.length) - 1 && twoindex === (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise_34 = answerData.exercise_question_types) === null || _answerData$exercise_34 === void 0 ? void 0 : (_answerData$exercise_35 = _answerData$exercise_34[oneindex]) === null || _answerData$exercise_35 === void 0 ? void 0 : (_answerData$exercise_36 = _answerData$exercise_35.items) === null || _answerData$exercise_36 === void 0 ? void 0 : _answerData$exercise_36.length) - 1) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
className: ImitateAnswermodules.submitButton,
type: "primary",
onClick: function onClick() {
var _answerData$exercise26;
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
setAnswerData(objectSpread2_default()({}, answerData));
if (!ischecked && (answerData === null || answerData === void 0 ? void 0 : (_answerData$exercise26 = answerData.exercise) === null || _answerData$exercise26 === void 0 ? void 0 : _answerData$exercise26.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
var _answerData$exercise_37, _answerData$exercise_38, _answerData$exercise_39, _answerData$exercise_40;
if (!((_answerData$exercise_37 = answerData.exercise_question_types) !== null && _answerData$exercise_37 !== void 0 && (_answerData$exercise_38 = _answerData$exercise_37[oneindex]) !== null && _answerData$exercise_38 !== void 0 && (_answerData$exercise_39 = _answerData$exercise_38.items) !== null && _answerData$exercise_39 !== void 0 && (_answerData$exercise_40 = _answerData$exercise_39[twoindex]) !== null && _answerData$exercise_40 !== void 0 && _answerData$exercise_40.repeat_answer)) {
setisshowmodal(true);
settype(2);
return;
}
}
if (answerData.exercise_question_types[oneindex].items.length - 1 === twoindex) {
oneindex = oneindex + 1;
twoindex = 0;
} else {
twoindex = twoindex + 1;
}
setoneindex(oneindex);
settwoindex(twoindex);
// initData();
},
children: "\u4E0B\u4E00\u9898"
})]
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
title: "\u6CE8\u610F",
open: isShowmodal,
onCancel: function onCancel() {
return setisshowmodal(false);
},
footer: false,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
style: {
marginBottom: 0
},
children: "\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
marginTop: 60,
display: 'flex',
justifyContent: 'space-between'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
checked: ischecked,
onChange: function onChange(e) {
setischecked(e.target.checked);
},
children: "\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
if (!answerData.exercise_question_types[oneindex].items[twoindex].israp) {
if (answerData.exercise_question_types[oneindex].items[twoindex].israp === '') {
answerData.exercise_question_types[oneindex].items[twoindex].israp = true;
setAnswerData(objectSpread2_default()({}, answerData));
}
} else {
answerData.exercise_question_types[oneindex].items[twoindex].israp = true;
setAnswerData(objectSpread2_default()({}, answerData));
}
},
children: "\u6211\u518D\u60F3\u60F3"
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.Z, {
onClick: function onClick() {
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
setAnswerData(objectSpread2_default()({}, answerData));
if (type === 1) {
if (twoindex === 0) {
oneindex -= 1;
twoindex = answerData.exercise_question_types[oneindex].items.length - 1;
} else {
twoindex -= 1;
}
console.log(answerData.exercise_question_types[oneindex].items[twoindex], '-----');
setoneindex(oneindex);
settwoindex(twoindex);
} else if (type === 2) {
if (answerData.exercise_question_types[oneindex].items.length - 1 === twoindex) {
oneindex = oneindex + 1;
twoindex = 0;
} else {
twoindex = twoindex + 1;
}
setoneindex(oneindex);
settwoindex(twoindex);
} else {
setoneindex(indexitems.oneindex);
settwoindex(indexitems.twoindex);
}
// initData();
setisshowmodal(false);
},
type: "primary",
style: {
marginLeft: 30
},
children: "\u786E\u8BA4"
})]
})]
})]
})
})]
}), checkStatus.status !== 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(ErrCheckIpTip, {
data: checkStatus
})]
})]
});
};
/* harmony default export */ var ImitateAnswer = ((0,_umi_production_exports.connect)(function (_ref12) {
var loading = _ref12.loading,
user = _ref12.user,
globalSetting = _ref12.globalSetting;
return {
globalSetting: globalSetting,
user: user,
loading: loading.effects
};
})(Answer));
/***/ }),
/***/ 58492:
/*!**************************************************************!*\
!*** ./node_modules/antd/es/breadcrumb/index.js + 3 modules ***!
\**************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"Z": function() { return /* binding */ breadcrumb; }
});
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__(4942);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(87462);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
var toConsumableArray = __webpack_require__(74902);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(94184);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: ./node_modules/rc-util/es/Children/toArray.js
var toArray = __webpack_require__(50344);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./node_modules/antd/es/config-provider/context.js
var context = __webpack_require__(53124);
// EXTERNAL MODULE: ./node_modules/antd/es/menu/index.js + 5 modules
var menu = __webpack_require__(66516);
// EXTERNAL MODULE: ./node_modules/antd/es/_util/reactNode.js
var reactNode = __webpack_require__(96159);
// EXTERNAL MODULE: ./node_modules/antd/node_modules/@ant-design/icons/es/icons/DownOutlined.js
var DownOutlined = __webpack_require__(13622);
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/dropdown.js + 1 modules
var dropdown = __webpack_require__(18562);
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbItem.js
var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
var BreadcrumbItem = function BreadcrumbItem(props) {
var customizePrefixCls = props.prefixCls,
_props$separator = props.separator,
separator = _props$separator === void 0 ? '/' : _props$separator,
children = props.children,
menu = props.menu,
overlay = props.overlay,
dropdownProps = props.dropdownProps,
restProps = __rest(props, ["prefixCls", "separator", "children", "menu", "overlay", "dropdownProps"]);
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
getPrefixCls = _React$useContext.getPrefixCls;
var prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
// Warning for deprecated usage
if (false) {}
/** If overlay is have Wrap a Dropdown */
var renderBreadcrumbNode = function renderBreadcrumbNode(breadcrumbItem) {
if (menu || overlay) {
return /*#__PURE__*/react.createElement(dropdown/* default */.Z, (0,esm_extends/* default */.Z)({
menu: menu,
overlay: overlay,
placement: "bottom"
}, dropdownProps), /*#__PURE__*/react.createElement("span", {
className: "".concat(prefixCls, "-overlay-link")
}, breadcrumbItem, /*#__PURE__*/react.createElement(DownOutlined/* default */.Z, null)));
}
return breadcrumbItem;
};
var link;
if ('href' in restProps) {
link = /*#__PURE__*/react.createElement("a", (0,esm_extends/* default */.Z)({
className: "".concat(prefixCls, "-link")
}, restProps), children);
} else {
link = /*#__PURE__*/react.createElement("span", (0,esm_extends/* default */.Z)({
className: "".concat(prefixCls, "-link")
}, restProps), children);
}
// wrap to dropDown
link = renderBreadcrumbNode(link);
if (children !== undefined && children !== null) {
return /*#__PURE__*/react.createElement("li", null, link, separator && /*#__PURE__*/react.createElement("span", {
className: "".concat(prefixCls, "-separator")
}, separator));
}
return null;
};
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
/* harmony default export */ var breadcrumb_BreadcrumbItem = (BreadcrumbItem);
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/BreadcrumbSeparator.js
var BreadcrumbSeparator = function BreadcrumbSeparator(_ref) {
var children = _ref.children;
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
getPrefixCls = _React$useContext.getPrefixCls;
var prefixCls = getPrefixCls('breadcrumb');
return /*#__PURE__*/react.createElement("span", {
className: "".concat(prefixCls, "-separator")
}, children || '/');
};
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
/* harmony default export */ var breadcrumb_BreadcrumbSeparator = (BreadcrumbSeparator);
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/Breadcrumb.js
var Breadcrumb_rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
function getBreadcrumbName(route, params) {
if (!route.breadcrumbName) {
return null;
}
var paramsKeys = Object.keys(params).join('|');
var name = route.breadcrumbName.replace(new RegExp(":(".concat(paramsKeys, ")"), 'g'), function (replacement, key) {
return params[key] || replacement;
});
return name;
}
function defaultItemRender(route, params, routes, paths) {
var isLastItem = routes.indexOf(route) === routes.length - 1;
var name = getBreadcrumbName(route, params);
return isLastItem ? /*#__PURE__*/react.createElement("span", null, name) : /*#__PURE__*/react.createElement("a", {
href: "#/".concat(paths.join('/'))
}, name);
}
var getPath = function getPath(path, params) {
path = (path || '').replace(/^\//, '');
Object.keys(params).forEach(function (key) {
path = path.replace(":".concat(key), params[key]);
});
return path;
};
var addChildPath = function addChildPath(paths, childPath, params) {
var originalPaths = (0,toConsumableArray/* default */.Z)(paths);
var path = getPath(childPath || '', params);
if (path) {
originalPaths.push(path);
}
return originalPaths;
};
var Breadcrumb = function Breadcrumb(_a) {
var customizePrefixCls = _a.prefixCls,
_a$separator = _a.separator,
separator = _a$separator === void 0 ? '/' : _a$separator,
style = _a.style,
className = _a.className,
routes = _a.routes,
children = _a.children,
_a$itemRender = _a.itemRender,
itemRender = _a$itemRender === void 0 ? defaultItemRender : _a$itemRender,
_a$params = _a.params,
params = _a$params === void 0 ? {} : _a$params,
restProps = Breadcrumb_rest(_a, ["prefixCls", "separator", "style", "className", "routes", "children", "itemRender", "params"]);
var _React$useContext = react.useContext(context/* ConfigContext */.E_),
getPrefixCls = _React$useContext.getPrefixCls,
direction = _React$useContext.direction;
var crumbs;
var prefixCls = getPrefixCls('breadcrumb', customizePrefixCls);
if (routes && routes.length > 0) {
// generated by route
var paths = [];
crumbs = routes.map(function (route) {
var path = getPath(route.path, params);
if (path) {
paths.push(path);
}
// generated overlay by route.children
var overlay;
if (route.children && route.children.length) {
overlay = /*#__PURE__*/react.createElement(menu/* default */.Z, {
items: route.children.map(function (child) {
return {
key: child.path || child.breadcrumbName,
label: itemRender(child, params, routes, addChildPath(paths, child.path, params))
};
})
});
}
var itemProps = {
separator: separator
};
if (overlay) {
itemProps.overlay = overlay;
}
return /*#__PURE__*/react.createElement(breadcrumb_BreadcrumbItem, (0,esm_extends/* default */.Z)({}, itemProps, {
key: path || route.breadcrumbName
}), itemRender(route, params, routes, paths));
});
} else if (children) {
crumbs = (0,toArray/* default */.Z)(children).map(function (element, index) {
if (!element) {
return element;
}
false ? 0 : void 0;
return (0,reactNode/* cloneElement */.Tm)(element, {
separator: separator,
key: index
});
});
}
var breadcrumbClassName = classnames_default()(prefixCls, (0,defineProperty/* default */.Z)({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'), className);
return /*#__PURE__*/react.createElement("nav", (0,esm_extends/* default */.Z)({
className: breadcrumbClassName,
style: style
}, restProps), /*#__PURE__*/react.createElement("ol", null, crumbs));
};
Breadcrumb.Item = breadcrumb_BreadcrumbItem;
Breadcrumb.Separator = breadcrumb_BreadcrumbSeparator;
/* harmony default export */ var breadcrumb_Breadcrumb = (Breadcrumb);
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/index.js
/* harmony default export */ var breadcrumb = (breadcrumb_Breadcrumb);
/***/ }),
/***/ 63102:
/*!********************************************************************!*\
!*** ./node_modules/antd/es/breadcrumb/style/index.js + 1 modules ***!
\********************************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
"use strict";
// EXTERNAL MODULE: ./node_modules/antd/es/style/default.less
var style_default = __webpack_require__(43146);
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/style/index.less
// extracted by mini-css-extract-plugin
// EXTERNAL MODULE: ./node_modules/antd/es/dropdown/style/index.js + 1 modules
var style = __webpack_require__(68018);
// EXTERNAL MODULE: ./node_modules/antd/es/menu/style/index.js + 1 modules
var menu_style = __webpack_require__(83736);
;// CONCATENATED MODULE: ./node_modules/antd/es/breadcrumb/style/index.js
// style dependencies
/***/ }),
/***/ 19575:
/*!******************************************!*\
!*** ./node_modules/js-base64/base64.js ***!
\******************************************/
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
* base64.js
*
* Licensed under the BSD 3-Clause License.
* http://opensource.org/licenses/BSD-3-Clause
*
* References:
* http://en.wikipedia.org/wiki/Base64
*/
;(function (global, factory) {
true
? module.exports = factory(global)
: 0
}((
typeof self !== 'undefined' ? self
: typeof window !== 'undefined' ? window
: typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g
: this
), function(global) {
'use strict';
// existing version for noConflict()
global = global || {};
var _Base64 = global.Base64;
var version = "2.6.4";
// constants
var b64chars
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var b64tab = function(bin) {
var t = {};
for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
return t;
}(b64chars);
var fromCharCode = String.fromCharCode;
// encoder stuff
var cb_utob = function(c) {
if (c.length < 2) {
var cc = c.charCodeAt(0);
return cc < 0x80 ? c
: cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
+ fromCharCode(0x80 | (cc & 0x3f)))
: (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ fromCharCode(0x80 | ( cc & 0x3f)));
} else {
var cc = 0x10000
+ (c.charCodeAt(0) - 0xD800) * 0x400
+ (c.charCodeAt(1) - 0xDC00);
return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
+ fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ fromCharCode(0x80 | ( cc & 0x3f)));
}
};
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
var utob = function(u) {
return u.replace(re_utob, cb_utob);
};
var cb_encode = function(ccc) {
var padlen = [0, 2, 1][ccc.length % 3],
ord = ccc.charCodeAt(0) << 16
| ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
| ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
chars = [
b64chars.charAt( ord >>> 18),
b64chars.charAt((ord >>> 12) & 63),
padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
];
return chars.join('');
};
var btoa = global.btoa && typeof global.btoa == 'function'
? function(b){ return global.btoa(b) } : function(b) {
if (b.match(/[^\x00-\xFF]/)) throw new RangeError(
'The string contains invalid characters.'
);
return b.replace(/[\s\S]{1,3}/g, cb_encode);
};
var _encode = function(u) {
return btoa(utob(String(u)));
};
var mkUriSafe = function (b64) {
return b64.replace(/[+\/]/g, function(m0) {
return m0 == '+' ? '-' : '_';
}).replace(/=/g, '');
};
var encode = function(u, urisafe) {
return urisafe ? mkUriSafe(_encode(u)) : _encode(u);
};
var encodeURI = function(u) { return encode(u, true) };
var fromUint8Array;
if (global.Uint8Array) fromUint8Array = function(a, urisafe) {
// return btoa(fromCharCode.apply(null, a));
var b64 = '';
for (var i = 0, l = a.length; i < l; i += 3) {
var a0 = a[i], a1 = a[i+1], a2 = a[i+2];
var ord = a0 << 16 | a1 << 8 | a2;
b64 += b64chars.charAt( ord >>> 18)
+ b64chars.charAt((ord >>> 12) & 63)
+ ( typeof a1 != 'undefined'
? b64chars.charAt((ord >>> 6) & 63) : '=')
+ ( typeof a2 != 'undefined'
? b64chars.charAt( ord & 63) : '=');
}
return urisafe ? mkUriSafe(b64) : b64;
};
// decoder stuff
var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
var cb_btou = function(cccc) {
switch(cccc.length) {
case 4:
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
| ((0x3f & cccc.charCodeAt(1)) << 12)
| ((0x3f & cccc.charCodeAt(2)) << 6)
| (0x3f & cccc.charCodeAt(3)),
offset = cp - 0x10000;
return (fromCharCode((offset >>> 10) + 0xD800)
+ fromCharCode((offset & 0x3FF) + 0xDC00));
case 3:
return fromCharCode(
((0x0f & cccc.charCodeAt(0)) << 12)
| ((0x3f & cccc.charCodeAt(1)) << 6)
| (0x3f & cccc.charCodeAt(2))
);
default:
return fromCharCode(
((0x1f & cccc.charCodeAt(0)) << 6)
| (0x3f & cccc.charCodeAt(1))
);
}
};
var btou = function(b) {
return b.replace(re_btou, cb_btou);
};
var cb_decode = function(cccc) {
var len = cccc.length,
padlen = len % 4,
n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
| (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
| (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
| (len > 3 ? b64tab[cccc.charAt(3)] : 0),
chars = [
fromCharCode( n >>> 16),
fromCharCode((n >>> 8) & 0xff),
fromCharCode( n & 0xff)
];
chars.length -= [0, 0, 2, 1][padlen];
return chars.join('');
};
var _atob = global.atob && typeof global.atob == 'function'
? function(a){ return global.atob(a) } : function(a){
return a.replace(/\S{1,4}/g, cb_decode);
};
var atob = function(a) {
return _atob(String(a).replace(/[^A-Za-z0-9\+\/]/g, ''));
};
var _decode = function(a) { return btou(_atob(a)) };
var _fromURI = function(a) {
return String(a).replace(/[-_]/g, function(m0) {
return m0 == '-' ? '+' : '/'
}).replace(/[^A-Za-z0-9\+\/]/g, '');
};
var decode = function(a){
return _decode(_fromURI(a));
};
var toUint8Array;
if (global.Uint8Array) toUint8Array = function(a) {
return Uint8Array.from(atob(_fromURI(a)), function(c) {
return c.charCodeAt(0);
});
};
var noConflict = function() {
var Base64 = global.Base64;
global.Base64 = _Base64;
return Base64;
};
// export Base64
global.Base64 = {
VERSION: version,
atob: atob,
btoa: btoa,
fromBase64: decode,
toBase64: encode,
utob: utob,
encode: encode,
encodeURI: encodeURI,
btou: btou,
decode: decode,
noConflict: noConflict,
fromUint8Array: fromUint8Array,
toUint8Array: toUint8Array
};
// if ES5 is available, make Base64.extendString() available
if (typeof Object.defineProperty === 'function') {
var noEnum = function(v){
return {value:v,enumerable:false,writable:true,configurable:true};
};
global.Base64.extendString = function () {
Object.defineProperty(
String.prototype, 'fromBase64', noEnum(function () {
return decode(this)
}));
Object.defineProperty(
String.prototype, 'toBase64', noEnum(function (urisafe) {
return encode(this, urisafe)
}));
Object.defineProperty(
String.prototype, 'toBase64URI', noEnum(function () {
return encode(this, true)
}));
};
}
//
// export Base64 to the namespace
//
if (global['Meteor']) { // Meteor.js
Base64 = global.Base64;
}
// module.exports and AMD are mutually exclusive.
// module.exports has precedence.
if ( true && module.exports) {
module.exports.Base64 = global.Base64;
}
else if (true) {
// AMD. Register as an anonymous module.
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function(){ return global.Base64 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
// that's it!
return {Base64: global.Base64}
}));
/***/ }),
/***/ 42480:
/*!************************!*\
!*** crypto (ignored) ***!
\************************/
/***/ (function() {
/* (ignored) */
/***/ })
}]);