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...

3079 lines
191 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[4105],{
/***/ 74352:
/*!**********************************************!*\
!*** ./src/components/AsyncButton/index.tsx ***!
\**********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Z: function() { return /* binding */ AsyncButton; }
/* harmony export */ });
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const AsyncButton = (_a) => {
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
const [btnLoading, setBtnLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .ZP, __spreadProps(__spreadValues({}, props), { loading: btnLoading, onClick: (e) => __async(void 0, null, function* () {
try {
setBtnLoading(true);
yield props.onClick(e);
setBtnLoading(false);
} catch (error) {
console.error(error);
setBtnLoading(false);
}
}) }), children);
};
/***/ }),
/***/ 43939:
/*!****************************************!*\
!*** ./src/components/Hooks/index.tsx ***!
\****************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ y: function() { return /* binding */ useDisableAction; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
const useDisableAction = (disable) => {
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (disable) {
const handleKeyDown = (event) => {
if (event.key === "F12") {
event.preventDefault();
console.log("F12\u88AB\u7981\u7528");
}
};
const handleContextmenu = (event) => {
event.preventDefault();
};
document.addEventListener("keydown", handleKeyDown);
document.addEventListener("contextmenu", handleContextmenu);
return () => {
document.removeEventListener("keydown", handleKeyDown);
document.removeEventListener("contextmenu", handleContextmenu);
};
}
}, [disable]);
};
/***/ }),
/***/ 98578:
/*!***************************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Exercise/Answer/index.tsx + 14 modules ***!
\***************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Exercise_Answer; }
});
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
var _umi_production_exports = __webpack_require__(23175);
// EXTERNAL MODULE: ./node_modules/_qrcode.react@1.0.0@qrcode.react/lib/index.js
var lib = __webpack_require__(15845);
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/index.js + 5 modules
var statistic = __webpack_require__(31797);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
var es_form = __webpack_require__(78241);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
var es_modal = __webpack_require__(43418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules
var input = __webpack_require__(1056);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
var message = __webpack_require__(8591);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/progress/index.js + 13 modules
var es_progress = __webpack_require__(93948);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
var row = __webpack_require__(95237);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
var col = __webpack_require__(43604);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/radio/index.js + 5 modules
var es_radio = __webpack_require__(5112);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
var es_checkbox = __webpack_require__(24905);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/alert/index.js + 3 modules
var es_alert = __webpack_require__(46400);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
var es_button = __webpack_require__(3113);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/MinusSquareOutlined.js + 1 modules
var MinusSquareOutlined = __webpack_require__(31307);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusSquareOutlined.js + 1 modules
var PlusSquareOutlined = __webpack_require__(56159);
// EXTERNAL MODULE: ./src/components/CaptureVideo/index.tsx + 1 modules
var CaptureVideo = __webpack_require__(3809);
// EXTERNAL MODULE: ./src/components/Exercise/recordScreen.tsx + 3 modules
var recordScreen = __webpack_require__(65211);
// EXTERNAL MODULE: ./src/utils/util.tsx
var util = __webpack_require__(19234);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(94754);
;// CONCATENATED MODULE: ./src/components/ReactCaptureScreens/index.tsx
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const ReactCaptureScreens = ({
id,
startRecording,
startScreenshot,
onBack,
onSuccuss,
timeInSeconds = [1, 6, 11, 16, 21, 26, 31, 41, 51, 61, 71, 81, 91, 101, 111, 121, 151, 181, 211, 241, 271, 361, 421, 481, 541, 601, 661]
}) => {
const stream = (0,_react_17_0_2_react.useRef)(null);
const video = (0,_react_17_0_2_react.useRef)(null);
const canvas = (0,_react_17_0_2_react.useRef)(null);
const timer = (0,_react_17_0_2_react.useRef)(null);
const openActionRecord = (0,_react_17_0_2_react.useRef)(true);
const exerciseAbnormityId = (0,_react_17_0_2_react.useRef)("");
const [time, setTime] = (0,_react_17_0_2_react.useState)(null);
(0,_react_17_0_2_react.useEffect)(() => {
if (startRecording) {
startLp();
} else {
stopLp();
}
}, [startRecording]);
(0,_react_17_0_2_react.useEffect)(() => {
if (startScreenshot) {
setTime(0);
} else {
clearTimeout(timer.current);
setTime(null);
exerciseAbnormityId.current = "";
}
}, [startScreenshot]);
(0,_react_17_0_2_react.useEffect)(() => {
if (typeof time === "number") {
if (timeInSeconds == null ? void 0 : timeInSeconds.includes(time)) {
captureScreenshot();
}
if (time <= 720) {
timer.current = setTimeout(() => {
setTime(time + 1);
}, 1e3);
}
}
return () => {
clearTimeout(timer.current);
};
}, [time]);
const handleGoBack = (str = "\u672A\u5171\u4EAB\u6574\u4E2A\u5C4F\u5E55\uFF0C\u7981\u6B62\u4F5C\u7B54\uFF01") => __async(void 0, null, function* () {
message/* default */.ZP.warning(str);
setTimeout(() => {
onBack();
}, 1e3);
});
const startLp = () => __async(void 0, null, function* () {
var _a, _b, _c, _d, _e, _f, _g;
if (!(0,util/* isChrome */.i7)()) {
handleGoBack("\u8BF7\u4F7F\u7528\u8C37\u6B4C\u6D4F\u89C8\u5668\u7B54\u9898");
return;
}
if (stream.current) {
message/* default */.ZP.warning("\u6B63\u5728\u5F55\u5236\u4E2D");
return;
}
openActionRecord.current = true;
try {
const mediaStream = yield navigator.mediaDevices.getDisplayMedia({ video: { displaySurface: "monitor" } });
stream.current = mediaStream;
const displaySurface = (_d = (_c = (_b = (_a = stream.current) == null ? void 0 : _a.getVideoTracks()) == null ? void 0 : _b[0]) == null ? void 0 : _c.getSettings()) == null ? void 0 : _d.displaySurface;
if (displaySurface !== "monitor") {
stopLp();
handleGoBack();
return;
}
if ("srcObject" in video.current) {
video.current.srcObject = stream.current;
} else {
video.current.src = URL.createObjectURL(stream.current);
}
yield new Promise((resolve) => {
video.current.addEventListener("loadedmetadata", () => {
resolve();
});
});
(_g = (_f = (_e = stream.current) == null ? void 0 : _e.getVideoTracks()) == null ? void 0 : _f[0]) == null ? void 0 : _g.addEventListener("ended", function() {
if (openActionRecord.current) {
handleGoBack();
}
});
video.current.play();
onSuccuss();
} catch (error) {
handleGoBack("\u5C4F\u5E55\u5F55\u5236\u529F\u80FD\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u540E\u518D\u5171\u4EAB\u6574\u4E2A\u5C4F\u5E55\uFF0C\u5426\u5219\u65E0\u6CD5\u4F5C\u7B54");
}
});
const stopLp = () => {
var _a;
openActionRecord.current = false;
const tracks = (_a = stream.current) == null ? void 0 : _a.getTracks();
tracks == null ? void 0 : tracks.forEach((track) => {
track.stop();
});
stream.current = null;
};
const dataURLToBlob = (dataURL) => {
const base64String = dataURL.split(",")[1];
const mimeString = dataURL.split(",")[0].split(":")[1].split(";")[0];
const byteCharacters = [...atob(base64String)];
const byteArray = new Uint8Array(byteCharacters.map((char) => char.charCodeAt(0)));
return new Blob([byteArray], { type: mimeString });
};
const getDataId = () => __async(void 0, null, function* () {
const res = yield (0,fetch/* default */.ZP)(`/api/exercises/${id}/exercise_user_screens.json`, {
method: "post"
});
if (res.status === 0) {
exerciseAbnormityId.current = res.exercise_abnormity_id;
setTime(0);
}
});
const captureScreenshot = () => __async(void 0, null, function* () {
const ctx = canvas.current.getContext("2d");
canvas.current.width = video.current.videoWidth;
canvas.current.height = video.current.videoHeight;
ctx.drawImage(video.current, 0, 0, canvas.current.width, canvas.current.height);
const dataURL = canvas.current.toDataURL("image/jpeg");
const blob = dataURLToBlob(dataURL);
const file = new File([blob], "canvas_image.jpg", { type: "image/jpeg" });
const formData = new FormData();
formData.append("file", file);
const res = yield (0,fetch/* default */.ZP)(`/api/exercises/${id}/exercise_user_screens/check.json`, {
method: "get"
});
if ((res == null ? void 0 : res.status) === 0) {
const fileItem = yield (0,fetch/* default */.ZP)(`/api/attachments.json`, {
method: "post",
body: formData
}, true);
if (!!(fileItem == null ? void 0 : fileItem.id)) {
const save = yield (0,fetch/* default */.ZP)(`/api/exercises/${id}/exercise_user_screens.json`, {
method: "post",
body: {
attachment_id: fileItem == null ? void 0 : fileItem.id,
exercise_abnormity_id: exerciseAbnormityId.current
}
});
if (save.status === 0) {
exerciseAbnormityId.current = save.exercise_abnormity_id;
}
}
}
});
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("video", { ref: video, muted: true, className: "hide" }), /* @__PURE__ */ _react_17_0_2_react.createElement("canvas", { id: "canvas", ref: canvas, className: "hide" }));
};
/* harmony default export */ var components_ReactCaptureScreens = (ReactCaptureScreens);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(9498);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Answermodules = ({"flex_box_center":"flex_box_center___ariLt","flex_space_between":"flex_space_between___MC6sH","flex_box_vertical_center":"flex_box_vertical_center___tJHfy","flex_box_center_end":"flex_box_center_end___AfB_t","flex_box_column":"flex_box_column___xX4Fj","bg":"bg___nHBEZ","wrapper":"wrapper___TZKl8","exerciseAlert":"exerciseAlert___QUMwm","title":"title___rj6Q0","content":"content___Te7Wz","baseMargin":"baseMargin___BRmsh","noWrap":"noWrap___X6AS3","singleItem":"singleItem___GkaDR","questionIcons":"questionIcons___XoGYC","green":"green___iIYnV","orange":"orange___EIhiL","greenTip":"greenTip___WwiUh","redTip":"redTip___aWSt4","orangeTip":"orangeTip___j5g_H","pollDesc":"pollDesc___yDT2Q","answered":"answered___d2hE7","unanswer":"unanswer___AdOhE","anchor":"anchor___z3CaP","answerFlag":"answerFlag___wwTKa","flagActive":"flagActive___piG3D","flagHalf":"flagHalf___E29dd","answerStudentFlag":"answerStudentFlag___HRVt8","answerStudentActive":"answerStudentActive___kM6r4","questionItem":"questionItem___q6Hgu","questionScore":"questionScore___RW5tm","itemType":"itemType___pPqzT","itemFlag":"itemFlag___j5TSr","answerWrap":"answerWrap___G9dnn","answerSubjective":"answerSubjective___LRVKJ","otherInput":"otherInput___SxNAw","submitButton":"submitButton___zPo7H","randomFlag":"randomFlag___TOZ2H","answerTrue":"answerTrue___fgIW0","answerFalse":"answerFalse___gAQD8","answerHalf":"answerHalf___h40sX","renderHtml":"renderHtml___UerV1","simpleText":"simpleText___ZKx7o","answerYes":"answerYes___AA0oM","answerNo":"answerNo___gMGLy","answerInfo":"answerInfo___tB4Wz","answerProgress":"answerProgress___CbmXy","answerSheetWrap":"answerSheetWrap___aPipx","answerSheetQuestionTitle":"answerSheetQuestionTitle___P18Ss","answerSheet":"answerSheet___yhxK1","answerSheetItem":"answerSheetItem___DIH2V","qindex":"qindex___XuKA8","markIcon":"markIcon___ZTkqb","active":"active___WSsrt","partialActive":"partialActive___K6lsa","selected":"selected___grFyM","countDown":"countDown___OzcWL","cnText":"cnText___TvFjV","red":"red___Mge1h","refreshBtn":"refreshBtn___lK1MX","fold":"fold___id0EJ","cardList":"cardList___xKhMX","withQrcode":"withQrcode___qphZK","iframe":"iframe___pMMQx","eduTip":"eduTip___hXWhK","eduQrcode":"eduQrcode____qxcx","eduVideo":"eduVideo___mufWJ","eduUsername":"eduUsername___tiufh","startAnswer":"startAnswer___AA7n5","eduSubmit":"eduSubmit___UPIsJ","eduTitle":"eduTitle___jCJrO","wrpAnswer":"wrpAnswer___AVK1Y","simpleMd":"simpleMd___ZGbXj","videomodal":"videomodal___bYarH","mainPart":"mainPart___Fqvw7","userInfoText":"userInfoText___nqL8p","answerSheetBottom":"answerSheetBottom___yXf5u","tooltipWrap":"tooltipWrap___AxG9B","leftPart":"leftPart___P4Ook","rightPart":"rightPart___De4P3","questionPart":"questionPart___GTq66","questionTypeTitle":"questionTypeTitle___r6Fo9","questionTypeInfo":"questionTypeInfo___JfpWv","toIframeBtn":"toIframeBtn___gRKtn","bottom":"bottom___coSlv","markBtn":"markBtn___ZCLGF","changeButton":"changeButton___sBTjl","prevBtn":"prevBtn___lgCPG","analysisWrap":"analysisWrap___JoCnb","greyBg":"greyBg___vgesc","fixHeader":"fixHeader___RoNxE","exerciseTitle":"exerciseTitle___Dtp56","commitModal":"commitModal___zqvNA","commitItem":"commitItem___mjYF6","commitInfoLabel":"commitInfoLabel___KtIjW","commitInfoValue":"commitInfoValue___DCyRn","cameraHeader":"cameraHeader___Pqhwb","dottedLineWrapper":"dottedLineWrapper___ONO9c","leftHalfCircle":"leftHalfCircle___RNJN7","dottedLine":"dottedLine___qWy4W","rightHalfCircle":"rightHalfCircle___s3_hr","orangeNum":"orangeNum___IYnup","teachAnalysis":"teachAnalysis___FH6fk","teachAnalysisModal":"teachAnalysisModal___RcKVp"});
// EXTERNAL MODULE: ./src/components/Exercise/ip.tsx
var Exercise_ip = __webpack_require__(3474);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(69740);
// EXTERNAL MODULE: ./src/utils/fullscreen.ts
var fullscreen = __webpack_require__(73141);
// EXTERNAL MODULE: ./src/service/exercise.ts
var service_exercise = __webpack_require__(32801);
// EXTERNAL MODULE: ./src/service/shixuns.ts
var shixuns = __webpack_require__(50083);
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx + 1 modules
var RenderHtml = __webpack_require__(51618);
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 14 modules
var markdown_editor = __webpack_require__(45707);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/Simple.tsx
const scoreStatusMapping = {
0: "c-red-ee4",
1: "c-green"
};
const Simple = ({
item,
answerData,
isEducation,
sign,
onBlur = () => {
}
}) => {
var _a, _b, _c, _d, _e, _f;
const value = (0,_react_17_0_2_react.useRef)("");
const [isShow, setIsShow] = (0,_react_17_0_2_react.useState)();
const [isFocus, setIsFocus] = (0,_react_17_0_2_react.useState)(false);
const [showEditor, setShowEditor] = (0,_react_17_0_2_react.useState)(isEducation || false);
const timeRef = (0,_react_17_0_2_react.useRef)();
const countDown = () => {
clearInterval(timeRef.current);
timeRef.current = setInterval(() => {
if (isFocus)
onBlur(value.current, true);
}, 10 * 1e3);
};
const onBeforeunload = (e) => {
onBlur(value.current);
let confirmationMessage = "\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
};
(0,_react_17_0_2_react.useEffect)(() => {
console.log("isFocus:", isFocus);
if (isFocus) {
countDown();
} else {
}
}, [isFocus]);
(0,_react_17_0_2_react.useEffect)(() => {
setIsShow(item == null ? void 0 : item.a_flag);
}, [item == null ? void 0 : item.a_flag]);
(0,_react_17_0_2_react.useEffect)(() => {
return () => {
clearInterval(timeRef.current);
};
}, []);
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ((_a = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a.user_exercise_status) === 1 ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, "\u6211\u7684\u7B54\u6848"), ((0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_b = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b.user_exercise_status) > 0 && ((_c = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _c.open_score)) && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "end", className: "mb20", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14", style: { color: "#6A7283" } }, "\u5F97\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 ml10" }, (item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: scoreStatusMapping[Number(item == null ? void 0 : item.answer_status)] || "c-orange-ff9" }, item == null ? void 0 : item.user_score), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: 5, color: "#6A7283" } }, "\u5206")), !(item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u672A\u8BC4"))))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.simpleText }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_d = item == null ? void 0 : item.user_answer) == null ? void 0 : _d[0] }))) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: item.user_score && (item.user_score === item.question_score ? "c-green" : "c-red") }, showEditor ? /* @__PURE__ */ _react_17_0_2_react.createElement(
markdown_editor/* default */.Z,
{
watch: true,
isFocus: true,
defaultValue: (_e = item == null ? void 0 : item.user_answer) == null ? void 0 : _e[0],
id: item == null ? void 0 : item.question_id,
className: "mt20",
onChange: (v) => {
value.current = v;
setIsFocus(true);
},
onBlur: () => {
setTimeout(() => {
onBlur(value.current);
}, 200);
clearInterval(timeRef.current);
setIsFocus(false);
}
}
) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => {
var _a2;
if (!item.repeat_answer && ((_a2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _a2.length) > 0 && item.ques_status !== 0) {
message/* default */.ZP.warning("\u8BE5\u9898\u4E0D\u5141\u8BB8\u518D\u4FEE\u6539\u7B54\u6848");
return;
}
sign.current = true;
setShowEditor(true);
}, className: Answermodules.startAnswer }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-blue" }, "\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54"))), (0,authority/* isStudent */.dE)() && (item == null ? void 0 : item.standard_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.analysisWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.greyBg }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u7B54\u6848\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_f = item == null ? void 0 : item.standard_answer) == null ? void 0 : _f[0] }))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u89E3\u6790\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: Answermodules.renderHtml, value: item == null ? void 0 : item.analysis })))));
};
/* harmony default export */ var components_Simple = (Simple);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/select/index.js
var es_select = __webpack_require__(57809);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/Simple2.tsx
const Simple2_Simple = ({
item,
answerData,
isEducation,
onBlur = () => {
}
}) => {
var _a, _b, _c, _d;
const value = (0,_react_17_0_2_react.useRef)("");
const [isShow, setIsShow] = (0,_react_17_0_2_react.useState)();
const [isFull, setIsFull] = (0,_react_17_0_2_react.useState)(false);
const [isFocus, setIsFocus] = (0,_react_17_0_2_react.useState)(false);
const [showEditor, setShowEditor] = (0,_react_17_0_2_react.useState)(isEducation || false);
const [update, setUpdate] = (0,_react_17_0_2_react.useState)(0);
const title = (0,_react_17_0_2_react.useRef)(item.kp_content || "");
const type = (0,_react_17_0_2_react.useRef)(item.kp_clazz);
const timeRef = (0,_react_17_0_2_react.useRef)();
const totalNum = (0,_react_17_0_2_react.useMemo)(() => {
var _a2, _b2;
return (_b2 = (_a2 = value.current) == null ? void 0 : _a2.replace(/[\n|\r|\t]/g, "")) == null ? void 0 : _b2.length;
}, [value.current]);
const countDown = () => {
clearInterval(timeRef.current);
timeRef.current = setInterval(() => {
if (isFocus)
onBlur(value.current, title.current, type.current);
}, 30 * 1e3);
};
(0,_react_17_0_2_react.useEffect)(() => {
console.log("isFocus:", isFocus);
countDown();
}, [isFocus]);
(0,_react_17_0_2_react.useEffect)(() => {
setIsShow(item == null ? void 0 : item.a_flag);
}, [item == null ? void 0 : item.a_flag]);
(0,_react_17_0_2_react.useEffect)(() => {
return () => {
clearInterval(timeRef.current);
};
}, []);
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ((_a = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a.user_exercise_status) === 1 ? /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt30" }, /* @__PURE__ */ _react_17_0_2_react.createElement("strong", null, "\u4F5C\u6587\u9898\u76EE\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement(
input["default"],
{
disabled: true,
className: "mt10",
value: title.current,
onChange: (e) => {
title.current = e.target.value;
setUpdate(update + 1);
},
onBlur: () => {
onBlur(value.current, title.current, type.current);
setIsFocus(false);
}
}
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt30" }, /* @__PURE__ */ _react_17_0_2_react.createElement("strong", null, "\u4F5C\u54C1\u7C7B\u578B\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement(
es_select["default"],
{
disabled: true,
className: "mt10 w100",
placeholder: "\u8BF7\u9009\u62E9\u4F5C\u54C1\u7C7B\u578B",
value: type.current,
onChange: (value2) => {
type.current = value2;
setUpdate(update + 1);
},
onBlur: () => {
onBlur(value.current, title.current, type.current);
setIsFocus(false);
}
},
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: 1, value: "\u79D1\u666E" }, "\u79D1\u666E"),
/* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: 2, value: "\u79D1\u5E7B" }, "\u79D1\u5E7B")
)), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "mt10 mb0" }, "\u4F5C\u54C1\u5185\u5BB9\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.simpleText }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_b = item == null ? void 0 : item.user_answer) == null ? void 0 : _b[0] }))) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt30" }, /* @__PURE__ */ _react_17_0_2_react.createElement("strong", null, "\u4F5C\u6587\u9898\u76EE\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement(input["default"], { className: "mt10", maxLength: 60, onBlur: () => onBlur(value.current, title.current, type.current), placeholder: "\u8BF7\u8F93\u5165\u4F5C\u6587\u9898\u76EE(\u6700\u591A60\u4E2A\u5B57)", value: title.current, onChange: (e) => {
title.current = e.target.value;
setUpdate(update + 1);
} })), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt30" }, /* @__PURE__ */ _react_17_0_2_react.createElement("strong", null, "\u4F5C\u6587\u7C7B\u578B\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"], { className: "mt10 w100", placeholder: "\u8BF7\u9009\u62E9\u4F5C\u54C1\u7C7B\u578B", value: type.current, onChange: (value2) => {
type.current = value2;
onBlur(value2.current, title.current, type.current);
setUpdate(update + 1);
} }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: 1, value: "\u79D1\u666E" }, "\u79D1\u666E"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_select["default"].Option, { key: 2, value: "\u79D1\u5E7B" }, "\u79D1\u5E7B"))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt30 mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: item.user_score && (item.user_score === item.question_score ? "c-green" : "c-red") }, /* @__PURE__ */ _react_17_0_2_react.createElement("strong", null, "\u4F5C\u6587\u5185\u5BB9\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt10 relative" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-blue", style: { position: isFull ? "fixed" : "absolute", top: isFull ? 61 : 4, left: 10, zIndex: 106 } }, "\u5DF2\u8F93\u5165", totalNum, "\u5B57"), showEditor ? /* @__PURE__ */ _react_17_0_2_react.createElement(
markdown_editor/* default */.Z,
{
className: Answermodules.simpleMd,
disablePaste: true,
hidetoolBar: isEducation,
height: isEducation ? "60vh" : 150,
isFocus: true,
defaultValue: (_c = item == null ? void 0 : item.user_answer) == null ? void 0 : _c[0],
id: item == null ? void 0 : item.question_id,
onFullScreen: (status) => setIsFull(status),
onChange: (v) => {
value.current = v;
setIsFocus(true);
setUpdate(update + 1);
},
onBlur: () => {
onBlur(value.current, title.current, type.current);
setIsFocus(false);
}
}
) : /* @__PURE__ */ _react_17_0_2_react.createElement("div", { onClick: () => setShowEditor(true), className: Answermodules.startAnswer }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-blue" }, "\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54")))))), (0,authority/* isStudent */.dE)() && (item == null ? void 0 : item.standard_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "mt10 mb0" }, "\u53C2\u8003\u7B54\u6848\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { border: "1px solid #eee", background: "#f5f5f5", borderRadius: 4, padding: 5 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (_d = item == null ? void 0 : item.standard_answer) == null ? void 0 : _d[0] }))));
};
/* harmony default export */ var Simple2 = (Simple2_Simple);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/anchor/index.js + 4 modules
var es_anchor = __webpack_require__(79817);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/table/index.js + 85 modules
var table = __webpack_require__(72315);
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 4 modules
var monaco_editor = __webpack_require__(72179);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/UserScore/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var UserScoremodules = ({"score":"score___mcGn7","wrap":"wrap___h11sQ"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/UserScore/index.tsx
const UserScore = ({ score }) => {
return score ? /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: UserScoremodules.wrap }, "\u5F97\u5206", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${UserScoremodules.score} ml10 mr5` }, score), "\u5206") : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u672A\u8BC4");
};
/* harmony default export */ var components_UserScore = (UserScore);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var componentsmodules = ({"flex_box_center":"flex_box_center___xK64P","flex_space_between":"flex_space_between___BNBCA","flex_box_vertical_center":"flex_box_vertical_center___ConJK","flex_box_center_end":"flex_box_center_end___L08sz","flex_box_column":"flex_box_column___hvk0E","shixunWrp":"shixunWrp___FTFC6","fill":"fill___H_Qd6","index":"index___PaSVJ","success":"success___fz_F7","fail":"fail___ftXSv","fillInput":"fillInput___q_sSb","shixunWrapper":"shixunWrapper___toGqF","score":"score___AsYGZ","name":"name___hawfX","programWrapper":"programWrapper___zVQPT","desc":"desc___MFIu5","content":"content___QuE41","analysisWrap":"analysisWrap___qGPzJ","greyBg":"greyBg___FIDIB"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/Shixun.tsx
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
const Shixun_scoreStatusMapping = {
0: "c-red-ee4",
1: "c-green"
};
const Shixun = ({
item,
answerData,
exerciseId,
coursesId
}) => {
var _a, _b, _c, _d, _e;
const [data, setData] = (0,_react_17_0_2_react.useState)([]);
const [challengeData, setChallengeData] = (0,_react_17_0_2_react.useState)([]);
(0,_react_17_0_2_react.useEffect)(() => {
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m;
if (!((_a2 = item == null ? void 0 : item.shixun_details) == null ? void 0 : _a2.length)) {
return;
}
let shixun = [];
let challenge = [];
for (let i = 0; i < ((_b2 = item == null ? void 0 : item.shixun_details) == null ? void 0 : _b2.length); i++) {
for (let j = 0; j < (item == null ? void 0 : item.shixun_details[i].stage_list.length); j++) {
let shixunItem = item == null ? void 0 : item.shixun_details[i].stage_list[j];
shixun.push(__spreadValues(__spreadValues({}, shixunItem), {
operation: (_f = (_e2 = (_d2 = (_c2 = item == null ? void 0 : item.shixun_details) == null ? void 0 : _c2[i]) == null ? void 0 : _d2.shixun_detail) == null ? void 0 : _e2[0]) == null ? void 0 : _f.game_identifier,
is_jupyter: item == null ? void 0 : item.is_jupyter,
is_jupyter_lab: item == null ? void 0 : item.is_jupyter_lab
}));
}
if ((_h = (_g = item == null ? void 0 : item.shixun_details) == null ? void 0 : _g[i]) == null ? void 0 : _h.shixun_detail) {
const finishedChallenge = (_k = (_j = (_i = item == null ? void 0 : item.shixun_details) == null ? void 0 : _i[i]) == null ? void 0 : _j.shixun_detail) == null ? void 0 : _k[0];
const userScore = (_m = (_l = item == null ? void 0 : item.shixun_details[i].stage_list) == null ? void 0 : _l.find((stageListItem) => (stageListItem == null ? void 0 : stageListItem.game_identifier) === (finishedChallenge == null ? void 0 : finishedChallenge.game_identifier))) == null ? void 0 : _m.user_score;
challenge.push(__spreadProps(__spreadValues({}, finishedChallenge), { user_score: userScore }));
}
}
setChallengeData(challenge);
setData(shixun);
}, [item == null ? void 0 : item.shixun_details]);
const columns = [
{
title: "\u5173\u5361",
dataIndex: "position",
key: "position",
align: "center"
},
{
title: "\u4EFB\u52A1\u540D\u79F0",
dataIndex: "name",
key: "name",
align: "center",
render: (name) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(
"span",
{
className: "overflowHidden1",
style: { maxWidth: "400px" },
title: name && name.length > 25 ? name : ""
},
name
);
}
},
{
title: "\u8BC4\u6D4B\u6B21\u6570",
dataIndex: "evaluate_count",
key: "evaluate_count",
align: "center",
render: (testCount, item2) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item2.evaluate_count ? item2.evaluate_count : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "color-grey-9" }, "--"));
}
},
{
title: "\u5B8C\u6210\u65F6\u95F4",
key: "endTime",
dataIndex: "endTime",
align: "center",
render: (endTime, item2) => {
let timeOver = false;
if (item2.finished_time && (answerData == null ? void 0 : answerData.exercise) && (answerData == null ? void 0 : answerData.exercise_answer_user)) {
if ((answerData == null ? void 0 : answerData.exercise.time) === -1) {
timeOver = dayjs_min_default()(answerData == null ? void 0 : answerData.exercise.end_time).isBefore(item2.finished_time);
} else {
timeOver = dayjs_min_default()(answerData == null ? void 0 : answerData.exercise_answer_user.start_at).add(answerData == null ? void 0 : answerData.exercise.time, "m").isBefore(item2.finished_time);
}
}
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item2.finished_time || /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999" }, "--"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-orange-ff9 " }, timeOver ? "\uFF08\u5DF2\u8D85\u65F6\uFF09" : ""));
}
},
{
title: "\u8017\u65F6",
dataIndex: "time_consuming",
key: "time_consuming",
align: "center",
render: (time, item2) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item2.time_consuming || /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "color-grey-9" }, "--"));
}
},
{
title: "\u67E5\u770B\u7B54\u6848",
dataIndex: "view_answer",
key: "view_answer",
align: "center",
render: (exp, item2) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, item2.view_answer ? "\u5DF2\u67E5\u770B" : "\u672A\u67E5\u770B");
}
},
{
title: "\u5F97\u5206",
dataIndex: "user_score",
key: "user_score",
align: "center",
render: (score) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#FA6400" } }, score, "\u5206")
},
{
title: "\u64CD\u4F5C",
dataIndex: "operation",
key: "operation",
align: "center",
render: (value, data2, index) => {
return value && (!data2.is_jupyter && !data2.is_jupyter_lab) ? /* @__PURE__ */ _react_17_0_2_react.createElement(es_anchor["default"], { affix: false, className: "mt10" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
es_anchor["default"].Link,
{
href: `#challenge_${item == null ? void 0 : item.question_id}${index}`,
title: /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#0152d9", fontSize: 14 } }, "\u67E5\u770B")
}
)) : /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-999" }, "--");
}
}
];
console.log(challengeData);
const options = {
selectOnLineNumbers: true,
readOnly: true,
minimap: {
enabled: false
},
scrollBeyondLastLine: false
};
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, ((_a = item == null ? void 0 : item.shixun) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: componentsmodules.shixunWrapper }, (_b = item == null ? void 0 : item.shixun) == null ? void 0 : _b.map(function(val, key) {
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: componentsmodules.score }, "(", val.challenge_score, "\u5206)"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: componentsmodules.name }, val.challenge_name, " ")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, !val.answer_status && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14", style: { color: "#FA6400" } }, "\u672A\u5B8C\u6210"), !!val.answer_status && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14", style: { color: "#37AD83" } }, "\u5DF2\u5B8C\u6210")));
})), ((_c = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _c.student_commit_status) !== 0 || ((_d = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d.user_exercise_status) !== 0 ? /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, !!(data == null ? void 0 : data.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", className: "mb10", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "font14 c-grey-666" }, "\u9636\u6BB5\u6210\u7EE9"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_UserScore, { score: item == null ? void 0 : item.user_score }))), /* @__PURE__ */ _react_17_0_2_react.createElement(
table["default"],
{
columns,
dataSource: data,
pagination: false
}
)), !!(challengeData == null ? void 0 : challengeData.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "font16 c-grey-666 mt10" }, "\u5B9E\u8BAD\u8BE6\u60C5"), challengeData == null ? void 0 : challengeData.map((chanllenge, index) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { id: `challenge_${item == null ? void 0 : item.question_id}${index}`, className: "mt5" }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 mr15" }, " \u7B2C", chanllenge.position, "\u5173"), /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Link, { className: "current c-black font14", target: "_blank", to: `/tasks/${coursesId}/${exerciseId}/${chanllenge.game_identifier}/exercise` }, chanllenge.name), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: { marginLeft: "auto" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(components_UserScore, { score: chanllenge.user_score }))), (chanllenge == null ? void 0 : chanllenge.st) === 0 && chanllenge.passed_code && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: componentsmodules.shixunWrp }, /* @__PURE__ */ _react_17_0_2_react.createElement("h2", null, "\u7B2C\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__ */ _react_17_0_2_react.createElement("span", { className: "c-light-black" }, chanllenge.path)), /* @__PURE__ */ _react_17_0_2_react.createElement(
monaco_editor/* default */.ZP,
{
height: 300,
language: "python",
theme: "default",
value: chanllenge.passed_code,
options
}
)));
}))) : /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, (0,authority/* isStudent */.dE)() && /* @__PURE__ */ _react_17_0_2_react.createElement(
RenderHtml/* default */.Z,
{
className: "c-grey-999 mt20 mb20",
value: item == null ? void 0 : item.question_title
}
), (_e = item == null ? void 0 : item.shixun) == null ? void 0 : _e.map((shixun, index) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "font16 c-grey-666 mb5", key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "mr20" }, "\u7B2C", shixun == null ? void 0 : shixun.challenge_position, "\u5173 ", shixun == null ? void 0 : shixun.challenge_name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, shixun == null ? void 0 : shixun.challenge_score, "\u5206"));
})));
};
/* harmony default export */ var components_Shixun = (Shixun);
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
var base64 = __webpack_require__(24334);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/Program.tsx
const Program_scoreStatusMapping = {
0: "c-red-ee4",
1: "c-green"
};
const Program = ({
item,
answerData
}) => {
var _a, _b, _c;
const [data, setData] = (0,_react_17_0_2_react.useState)([]);
(0,_react_17_0_2_react.useEffect)(() => {
var _a2, _b2;
if (((_a2 = item == null ? void 0 : item.evaluate_codes) == null ? void 0 : _a2.length) > 0) {
setData((_b2 = item == null ? void 0 : item.evaluate_codes) == null ? void 0 : _b2.map((code, index) => {
return {
key: index + 1,
error_msg: (code == null ? void 0 : code.error_msg) ? base64.Base64.decode(code == null ? void 0 : code.error_msg) : ""
};
}));
} else {
setData([{ key: "--", error_msg: "--" }]);
}
}, [item == null ? void 0 : item.evaluate_codes]);
const columns = [{
title: "\u8BC4\u6D4B\u6B21\u6570",
dataIndex: "key",
width: "127px",
key: "key",
align: "center",
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, record.key)
}, {
title: "\u8BE6\u7EC6\u4FE1\u606F",
dataIndex: "error_msg",
key: "error_msg",
align: "center",
render: (text, record) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, record.error_msg ? record.error_msg : "--")
}];
const options = {
selectOnLineNumbers: true,
readOnly: true,
minimap: {
enabled: false
},
scrollBeyondLastLine: false
};
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${componentsmodules.programWrapper}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: componentsmodules.desc }, "\u9898\u76EE\u63CF\u8FF0"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: componentsmodules.content }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item == null ? void 0 : item.description })), ((_a = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a.user_exercise_status) === 1 && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between", className: "mt40" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: {
fontSize: 14,
color: "#666666"
} }, "\u6211\u7684\u7B54\u6848"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(components_UserScore, { score: item == null ? void 0 : item.user_score }))), (item == null ? void 0 : item.passed_code) && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: componentsmodules.shixunWrp }, /* @__PURE__ */ _react_17_0_2_react.createElement("h3", null, "\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__ */ _react_17_0_2_react.createElement(
monaco_editor/* default */.ZP,
{
style: { border: "1px solid #ccc" },
height: 300,
language: "python",
theme: "vs-light",
value: (item == null ? void 0 : item.passed_code) ? base64.Base64.decode(item == null ? void 0 : item.passed_code) : "",
options
}
)), ((_b = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b.user_exercise_status) === 1 && ((_c = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _c.answer_open) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { background: "#F6F7F9" }, className: "mt30" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { padding: "20px", fontSize: "16px", display: "flex" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { whiteSpace: "nowrap" } }, "\u3010\u89E3\u6790\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (item == null ? void 0 : item.analysis) || "\u6682\u65E0\u89E3\u6790" }))));
};
/* harmony default export */ var components_Program = (Program);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/Fill.tsx
var Fill_defProp = Object.defineProperty;
var Fill_getOwnPropSymbols = Object.getOwnPropertySymbols;
var Fill_hasOwnProp = Object.prototype.hasOwnProperty;
var Fill_propIsEnum = Object.prototype.propertyIsEnumerable;
var Fill_defNormalProp = (obj, key, value) => key in obj ? Fill_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var Fill_spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (Fill_hasOwnProp.call(b, prop))
Fill_defNormalProp(a, prop, b[prop]);
if (Fill_getOwnPropSymbols)
for (var prop of Fill_getOwnPropSymbols(b)) {
if (Fill_propIsEnum.call(b, prop))
Fill_defNormalProp(a, prop, b[prop]);
}
return a;
};
var Fill_async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const { TextArea } = input["default"];
const Fill_scoreStatusMapping = {
0: "c-red-ee4",
1: "c-green"
};
const Fill = ({
sign,
item,
answerData,
onBlur = () => {
}
}) => {
var _a, _b, _c, _d;
const [userAnswer, setUserAnswer] = (0,_react_17_0_2_react.useState)([]);
const [saveStatusArr, setSaveStatusArr] = (0,_react_17_0_2_react.useState)([]);
const currentData = (0,_react_17_0_2_react.useRef)();
(0,_react_17_0_2_react.useEffect)(() => {
var _a2;
const data = [];
for (let i = 0; i < (item == null ? void 0 : item.multi_count); i++) {
const param = ((_a2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _a2.find((e) => e.choice_id === i + 1)) || {
choice_id: i + 1,
answer_text: ""
};
data.push(Fill_spreadValues({}, param));
}
currentData.current = data;
setUserAnswer(data);
}, [item == null ? void 0 : item.user_answer]);
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, userAnswer == null ? void 0 : userAnswer.map((answer, index) => {
var _a2, _b2, _c2, _d2;
return /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { key: index, className: `${componentsmodules.baseMargin} ${componentsmodules.fill}`, align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: componentsmodules.index }, "\u586B\u7A7A\u9879", index + 1), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "430px", className: "ml20 mr20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
input["default"],
{
placeholder: "\u8BF7\u8F93\u5165\u7B54\u6848",
disabled: !item.repeat_answer && ((_a2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _a2.length) > 0 && item.ques_status !== 0 || !!(answerData == null ? void 0 : answerData.exercise.commit_status),
value: answer == null ? void 0 : answer.answer_text,
onChange: (e) => {
userAnswer[index].answer_text = e.target.value;
setUserAnswer([...userAnswer]);
},
onFocus: () => {
sign.current = true;
},
onBlur: (e) => {
setTimeout(() => Fill_async(void 0, null, function* () {
const res = yield onBlur(answer == null ? void 0 : answer.answer_text, index + 1, userAnswer);
if (!res.status) {
const newArr = saveStatusArr.slice();
newArr[index] = { status: "success", errorText: "" };
setSaveStatusArr(newArr);
} else {
const newArr = saveStatusArr.slice();
newArr[index] = { status: "fail", errorText: res.message };
setSaveStatusArr(newArr);
}
}), 200);
},
className: `${item.user_score && (item.user_score === item.question_score ? "c-green" : "c-red")} ${componentsmodules.fillInput}`
}
)), ((_b2 = saveStatusArr[index]) == null ? void 0 : _b2.status) === "success" && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
"i",
{
style: { marginRight: 8 },
className: `iconfont icon-chenggong1 ${componentsmodules.success}`
}
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: componentsmodules.success }, "\u4FDD\u5B58\u6210\u529F"))), ((_c2 = saveStatusArr[index]) == null ? void 0 : _c2.status) === "fail" && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
"i",
{
style: { marginRight: 8 },
className: `iconfont icon-tishi7 ${componentsmodules.fail}`
}
), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: componentsmodules.fail }, (_d2 = saveStatusArr[index]) == null ? void 0 : _d2.errorText))));
}), ((0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_a = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a.user_exercise_status) > 0 && ((_b = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b.open_score)) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "end", className: "mb20", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14", style: { color: "#6A7283" } }, "\u5F97\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 ml10" }, (item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Fill_scoreStatusMapping[Number(item == null ? void 0 : item.answer_status)] || "c-orange-ff9" }, item == null ? void 0 : item.user_score), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: 5, color: "#6A7283" } }, "\u5206")), !(item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u672A\u8BC4"))), !!((_c = item == null ? void 0 : item.standard_answer) == null ? void 0 : _c.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: componentsmodules.analysisWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: componentsmodules.greyBg }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u7B54\u6848\u3011"), (_d = item == null ? void 0 : item.standard_answer) == null ? void 0 : _d.map((answer, index) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { key: index, className: "mr40" }, "\u586B\u7A7A\u9879", index + 1, ":", answer == null ? void 0 : answer.answer_text[0]);
})), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u89E3\u6790\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: componentsmodules.renderHtml, value: item == null ? void 0 : item.analysis })))));
};
/* harmony default export */ var components_Fill = (Fill);
// EXTERNAL MODULE: ./src/components/QuestionEditor/Buttonloading.tsx
var Buttonloading = __webpack_require__(19547);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/BFill.tsx
var BFill_defProp = Object.defineProperty;
var BFill_defProps = Object.defineProperties;
var BFill_getOwnPropDescs = Object.getOwnPropertyDescriptors;
var BFill_getOwnPropSymbols = Object.getOwnPropertySymbols;
var BFill_hasOwnProp = Object.prototype.hasOwnProperty;
var BFill_propIsEnum = Object.prototype.propertyIsEnumerable;
var BFill_defNormalProp = (obj, key, value) => key in obj ? BFill_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var BFill_spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (BFill_hasOwnProp.call(b, prop))
BFill_defNormalProp(a, prop, b[prop]);
if (BFill_getOwnPropSymbols)
for (var prop of BFill_getOwnPropSymbols(b)) {
if (BFill_propIsEnum.call(b, prop))
BFill_defNormalProp(a, prop, b[prop]);
}
return a;
};
var BFill_spreadProps = (a, b) => BFill_defProps(a, BFill_getOwnPropDescs(b));
var BFill_async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const { TextArea: BFill_TextArea } = input["default"];
const BFill = ({
item,
answerData,
onBlur = () => {
},
onDebug = () => {
}
}) => {
var _a, _b, _c;
let [userAnswer, setUserAnswer] = (0,_react_17_0_2_react.useState)([]);
(0,_react_17_0_2_react.useEffect)(() => {
var _a2;
let data = (_a2 = item == null ? void 0 : item.standard_answer_with_score) == null ? void 0 : _a2.map((val, index) => {
var _a3, _b2;
return BFill_spreadProps(BFill_spreadValues({}, val), {
value: ((_b2 = (_a3 = item == null ? void 0 : item.user_answer) == null ? void 0 : _a3[index]) == null ? void 0 : _b2.answer_text) || ""
});
});
setUserAnswer(data);
}, [item == null ? void 0 : item.standard_answer_with_score]);
(0,_react_17_0_2_react.useEffect)(() => {
var _a2, _b2;
if (((_a2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _a2.length) > 0) {
let data = (_b2 = new Array(item.multi_count).fill({ value: "" })) == null ? void 0 : _b2.map((val, index) => {
var _a3, _b3, _c2, _d;
return BFill_spreadProps(BFill_spreadValues({}, val), {
score: (_b3 = (_a3 = item == null ? void 0 : item.standard_answer_with_score) == null ? void 0 : _a3[index]) == null ? void 0 : _b3.score,
value: ((_d = (_c2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _c2[index]) == null ? void 0 : _d.answer_text) || ""
});
});
setUserAnswer(data);
}
}, [item == null ? void 0 : item.user_answer]);
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (item == null ? void 0 : item.code) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { border: "1px solid #CCCCCC", padding: "10px", marginBottom: 20 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { disabledFill: !item.repeat_answer && ((_a = item == null ? void 0 : item.user_answer) == null ? void 0 : _a.length) > 0 && item.ques_status !== 0 || !!(answerData == null ? void 0 : answerData.exercise.commit_status), onFillBlur: (e, index) => BFill_async(void 0, null, function* () {
var _a2;
const res = yield onBlur((_a2 = e == null ? void 0 : e[parseInt(index)]) == null ? void 0 : _a2.value, parseInt(index) + 1, userAnswer);
if (res.status === 0) {
userAnswer[parseInt(index)].type = "success";
setUserAnswer(userAnswer);
} else {
userAnswer[parseInt(index)].type = "warning";
setUserAnswer(userAnswer);
}
}), className: componentsmodules.content, programFillValue: userAnswer, showProgramFill: true, value: base64.Base64.decode((item == null ? void 0 : item.code) || "") })), !!((_b = item == null ? void 0 : item.standard_answer) == null ? void 0 : _b.length) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: componentsmodules.analysisWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: componentsmodules.greyBg }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u7B54\u6848\u3011"), (_c = item == null ? void 0 : item.standard_answer) == null ? void 0 : _c.map((answer, index) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { key: index, className: "mr40" }, "\u586B\u7A7A\u9879", index + 1, ":", answer == null ? void 0 : answer.answer_text);
})), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u89E3\u6790\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: componentsmodules.renderHtml, value: item == null ? void 0 : item.analysis })))), (item == null ? void 0 : item.allow_student_debug) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { textAlign: "end", marginTop: 10 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
Buttonloading/* default */.Z,
{
ButtonProps: { type: "primary" },
ButtonText: "\u8FD0\u884C\u8C03\u8BD5",
items: BFill_spreadProps(BFill_spreadValues({}, item), { userAnswer }),
hackidentifier: item == null ? void 0 : item.hack_identifier
}
)));
};
/* harmony default export */ var components_BFill = (BFill);
// EXTERNAL MODULE: ./src/components/ImagesIcon/index.ts + 32 modules
var ImagesIcon = __webpack_require__(46498);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/ErrCheckIpTip.tsx
const { TextArea: ErrCheckIpTip_TextArea } = input["default"];
const ErrCheckIpTip_Fill = ({
data
}) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc mt80 pb30" }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { width: "486", src: ImagesIcon/* errIcon */.BV }), " ", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), data.status === -1 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-999 mt60" }, "\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"), data.status === -2 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: " c-grey-999 mt60" }, "\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, data.ip), "\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: "mt40 pl20 pr20", type: "primary" }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "/" }, "\u56DE\u5230\u9996\u9875")));
};
/* harmony default export */ var ErrCheckIpTip = (ErrCheckIpTip_Fill);
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(13316);
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
var lodash = __webpack_require__(89392);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/NewAnswerComments/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var NewAnswerCommentsmodules = ({"comments":"comments___ZkLeS","greyText":"greyText___ow9J6","commentText":"commentText___Uklcs","wrapper":"wrapper___XTdhL","header":"header___pq5DQ","updateTime":"updateTime___WYYjt","text":"text___FmQY7","date":"date___DiXg4"});
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/components/NewAnswerComments/index.tsx
const NewAnswerComments = ({
list,
hideScore = false
}) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, list == null ? void 0 : list.map((v) => {
var _a, _b, _c, _d, _e, _f;
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `mt20 ${NewAnswerCommentsmodules.wrapper}`, key: (_a = v == null ? void 0 : v.user) == null ? void 0 : _a.user_id }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", className: NewAnswerCommentsmodules.header }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: env/* default */.Z.API_SERVER + "/images/" + ((_b = v.user) == null ? void 0 : _b.image_url) }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml10 font16" }, (_c = v.user) == null ? void 0 : _c.name), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: NewAnswerCommentsmodules.updateTime }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: NewAnswerCommentsmodules.text }, "\u8BC4\u9605\u65F6\u95F4"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: NewAnswerCommentsmodules.date }, dayjs_min_default()((_e = (_d = v.comments) == null ? void 0 : _d[0]) == null ? void 0 : _e.updated_at).format("YYYY-MM-DD HH:mm")))), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: NewAnswerCommentsmodules.comments }, (_f = v == null ? void 0 : v.comments) == null ? void 0 : _f.map((e, i) => {
var _a2;
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { key: ((_a2 = v == null ? void 0 : v.user) == null ? void 0 : _a2.user_id) + "-" + i }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "space-between" }, !!e.shixun_chanllge_position && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flexShrink: 0, marginRight: 10 } }, "\u7B2C", e.shixun_chanllge_position, "\u5173"), !hideScore && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { flex: 1 } }, "\u539F\u59CB\u5F97\u5206", e == null ? void 0 : e.origin_score, "\u5206\uFF0C\u4FEE\u6B63\u4E3A", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-light-primary" }, e == null ? void 0 : e.score), "\u5206")), !!e.comment && /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${NewAnswerCommentsmodules.greyText} mr10` }, "\u8BC4\u8BED"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: NewAnswerCommentsmodules.commentText }, e.comment)));
})));
}));
};
/* harmony default export */ var components_NewAnswerComments = (NewAnswerComments);
// EXTERNAL MODULE: ./src/pages/Classrooms/Lists/Exercise/components/Unlock.tsx
var Unlock = __webpack_require__(55112);
// EXTERNAL MODULE: ./node_modules/_react-draggable@4.4.6@react-draggable/build/cjs/cjs.js
var cjs = __webpack_require__(12911);
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/MinusOutlined.js + 1 modules
var MinusOutlined = __webpack_require__(17599);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/PlusOutlined.js + 1 modules
var PlusOutlined = __webpack_require__(378);
// EXTERNAL MODULE: ./src/components/AsyncButton/index.tsx
var AsyncButton = __webpack_require__(74352);
// EXTERNAL MODULE: ./src/components/Hooks/index.tsx
var Hooks = __webpack_require__(43939);
// EXTERNAL MODULE: ./src/utils/hooks/useRemindModal.tsx
var useRemindModal = __webpack_require__(52305);
// EXTERNAL MODULE: ./src/utils/constant.ts
var constant = __webpack_require__(67510);
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/Answer/index.tsx
var Answer_defProp = Object.defineProperty;
var Answer_defProps = Object.defineProperties;
var Answer_getOwnPropDescs = Object.getOwnPropertyDescriptors;
var Answer_getOwnPropSymbols = Object.getOwnPropertySymbols;
var Answer_hasOwnProp = Object.prototype.hasOwnProperty;
var Answer_propIsEnum = Object.prototype.propertyIsEnumerable;
var Answer_defNormalProp = (obj, key, value) => key in obj ? Answer_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var Answer_spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (Answer_hasOwnProp.call(b, prop))
Answer_defNormalProp(a, prop, b[prop]);
if (Answer_getOwnPropSymbols)
for (var prop of Answer_getOwnPropSymbols(b)) {
if (Answer_propIsEnum.call(b, prop))
Answer_defNormalProp(a, prop, b[prop]);
}
return a;
};
var Answer_spreadProps = (a, b) => Answer_defProps(a, Answer_getOwnPropDescs(b));
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (Answer_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && Answer_getOwnPropSymbols)
for (var prop of Answer_getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && Answer_propIsEnum.call(source, prop))
target[prop] = source[prop];
}
return target;
};
var Answer_async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const { Countdown } = statistic["default"];
const tagList = [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z"
];
const Answer_scoreStatusMapping = {
0: "c-red-ee4",
1: "c-green"
};
const Answer = (_a) => {
var _b = _a, {
globalSetting,
loading,
user,
exercise,
dispatch
} = _b, props = __objRest(_b, [
"globalSetting",
"loading",
"user",
"exercise",
"dispatch"
]);
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V;
const location = (0,_umi_production_exports.useLocation)();
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
const params = (0,_umi_production_exports.useParams)();
const [answerData, setAnswerData] = (0,_react_17_0_2_react.useState)({});
const [answerCheckData, setAnswerCheckData] = (0,_react_17_0_2_react.useState)({});
const [hideAnswerCard, setHideAnswerCard] = (0,_react_17_0_2_react.useState)({});
const [isSpin, setIsSpin] = (0,_react_17_0_2_react.useState)(false);
const [showAnswerCard, setShowAnswerCard] = (0,_react_17_0_2_react.useState)(true);
const [showCamera, setShowCamera] = (0,_react_17_0_2_react.useState)(false);
const [openFullScreen, setOpenFullScreen] = (0,_react_17_0_2_react.useState)(false);
const [startRecording, setStartRecording] = (0,_react_17_0_2_react.useState)(false);
const [startScreenshot, setStartScreenshot] = (0,_react_17_0_2_react.useState)(false);
const [time, setTime] = (0,_react_17_0_2_react.useState)();
const [iframeUrl, setIframeUrl] = (0,_react_17_0_2_react.useState)("");
const [iframeBlock, setIframeBlock] = (0,_react_17_0_2_react.useState)("none");
const [countDownColor, setCountDownColor] = (0,_react_17_0_2_react.useState)("");
const [checkStatus, setCheckStatus] = (0,_react_17_0_2_react.useState)({ status: 0 });
const [openCameraSuccess, setOpenCameraSuccess] = (0,_react_17_0_2_react.useState)(false);
const [isEducation, setIsEducation] = (0,_react_17_0_2_react.useState)(window.document.domain === "kepukehuan.educoder.net" ? true : false);
const [normalClose, setNormalClose] = (0,_react_17_0_2_react.useState)(true);
const iframe = (0,_react_17_0_2_react.useRef)();
const captureRef = (0,_react_17_0_2_react.useRef)();
const localIpRef = (0,_react_17_0_2_react.useRef)();
const lockRef = (0,_react_17_0_2_react.useRef)();
const iframeUrlSuffix = (0,_react_17_0_2_react.useRef)();
const answerCheckDataRef = (0,_react_17_0_2_react.useRef)();
const [form] = es_form["default"].useForm();
const socket = (0,_react_17_0_2_react.useMemo)(() => {
return new WebSocket("ws://localhost:8082");
}, []);
let [oneindex, setoneindex] = (0,_react_17_0_2_react.useState)(0);
let [twoindex, settwoindex] = (0,_react_17_0_2_react.useState)(0);
const [isShowmodal, setisshowmodal] = (0,_react_17_0_2_react.useState)(false);
const [ischecked, setischecked] = (0,_react_17_0_2_react.useState)(false);
const allowRouter = [
`/classrooms/${params.coursesId}/exercise/${params.categoryId}/detail`,
`/classrooms/${params.coursesId}/exercise`,
`/classrooms/${params.coursesId}/exercise/`,
`/classrooms/${params.coursesId}/exercise/${params.categoryId}/users/${(_a2 = user.userInfo) == null ? void 0 : _a2.login}/check`,
`/classrooms/${params.coursesId}/exercisenotice/${params.categoryId}/users/${(_b2 = user.userInfo) == null ? void 0 : _b2.login}`
];
const [disabled, setDisabled] = (0,_react_17_0_2_react.useState)(false);
const [bounds, setBounds] = (0,_react_17_0_2_react.useState)({ left: 0, top: 0, bottom: 0, right: 0 });
const draggleRef = (0,_react_17_0_2_react.useRef)(null);
const [isopen, setisopen] = (0,_react_17_0_2_react.useState)(true);
const questionPartRef = (0,_react_17_0_2_react.useRef)();
const [teachAnalysisModal, setTeachAnalysisModal] = (0,_react_17_0_2_react.useState)(false);
(0,Hooks/* useDisableAction */.y)((0,authority/* isStudent */.dE)());
const onStart = (_event, uiData) => {
var _a3;
const { clientWidth, clientHeight } = window.document.documentElement;
const targetRect = (_a3 = draggleRef.current) == null ? void 0 : _a3.getBoundingClientRect();
setBounds({
left: -targetRect.left + uiData.x,
right: clientWidth - (targetRect.right - uiData.x),
top: -targetRect.top + uiData.y,
bottom: clientHeight - (targetRect.bottom - uiData.y) - 70
});
};
const clearCountdownTimeout = (0,useRemindModal/* useRemindModal */._)(answerData);
(0,_react_17_0_2_react.useEffect)(() => {
document.body.setAttribute("data-custom", "auto");
return () => {
document.body.removeAttribute("data-custom");
};
}, []);
(0,_react_17_0_2_react.useEffect)(() => {
var _a3, _b3;
document.body.scrollIntoView();
if (((_a3 = user.userInfo) == null ? void 0 : _a3.real_name) === "\u6E38\u5BA2") {
window.location.href = `/classrooms/${params.coursesId}/exercise`;
return;
}
if ((_b3 = user.userInfo) == null ? void 0 : _b3.user_id) {
if ((0,authority/* isAdmin */.GJ)()) {
initData();
} else if (user.userInfo.login) {
checkCanStart();
}
}
window.addEventListener("message", handleMessage);
return () => {
window.removeEventListener("message", handleMessage);
if (location.pathname.indexOf("/detail") > -1)
(0,fullscreen/* exitFull */.BU)();
};
}, [params.categoryId, user.userInfo.login]);
(0,_react_17_0_2_react.useEffect)(() => {
window.addEventListener("beforeunload", sendBeacon);
return () => {
clearCountdownTimeout();
window.removeEventListener("beforeunload", sendBeacon);
};
}, []);
(0,_react_17_0_2_react.useEffect)(() => {
dispatch({
type: "globalSetting/headerFooterToggle",
payload: false
});
return () => {
dispatch({
type: "globalSetting/headerFooterToggle",
payload: true
});
};
}, []);
(0,_react_17_0_2_react.useEffect)(() => {
var _a3;
if ((_a3 = answerData == null ? void 0 : answerData.question_status) == null ? void 0 : _a3.every((item) => !!item.ques_status && openCameraSuccess && (answerCheckData == null ? void 0 : answerCheckData.used_screen_num) < (answerCheckData == null ? void 0 : answerCheckData.screen_num))) {
setTimeout(() => {
var _a4;
(_a4 = captureRef.current) == null ? void 0 : _a4.handlePhoto();
}, 1300);
}
}, [answerData]);
const sendBeacon = () => {
var _a3;
if (!(answerCheckData == null ? void 0 : answerCheckData.is_commit) && (0,authority/* isStudent */.dE)()) {
(0,util/* copyTextFuc */.RG)(" ", true);
}
if ((_a3 = exercise.exerciseUserInfo) == null ? void 0 : _a3.screen_open)
window.navigator.sendBeacon(
`${env/* default */.Z.API_SERVER}/api/exercises/${params.categoryId}/commit_screen_at.json`,
{}
);
};
const handleMessage = (data) => {
if (data.data === "backExercise") {
(0,util/* copyTextFuc */.RG)(" ", true);
resetIframe();
}
};
const resetIframe = () => {
setIframeBlock("none");
setIframeUrl("");
initData();
};
const checkCanStart = () => Answer_async(void 0, null, function* () {
getExerciseUserInfo();
});
const startLocke = () => Answer_async(void 0, null, function* () {
setNormalClose(false);
es_modal["default"].info({
title: "\u5F00\u8003\u5BC6\u7801",
width: 500,
centered: true,
closable: false,
keyboard: false,
maskClosable: false,
maskStyle: { background: "#000" },
okText: "\u8FDB\u5165\u8003\u8BD5",
onOk: () => {
return new Promise((resolve, reject) => Answer_async(void 0, null, function* () {
try {
yield form.validateFields();
} catch (e) {
reject();
}
const res = yield (0,service_exercise/* exerciseStartUnLock */.pL)(Answer_spreadValues({
exercise_user_id: answerCheckData == null ? void 0 : answerCheckData.exercise_user_id,
categoryId: params.categoryId
}, yield form.validateFields()));
if ((res == null ? void 0 : res.status) === 0) {
setNormalClose(true);
checkCamera();
resolve(res);
} else {
form.setFields([{
name: "start_password",
errors: [res == null ? void 0 : res.message]
}]);
reject();
}
}));
},
content: /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: "" }, "\u8BF7\u8F93\u5165\u76D1\u8003\u8001\u5E08\u5BA3\u5E03\u672C\u573A\u8003\u8BD5\u7684\u5F00\u8003\u5BC6\u7801\u540E\u8FDB\u5165\u8003\u8BD5"), /* @__PURE__ */ _react_17_0_2_react.createElement(
es_form["default"],
{
form,
autoComplete: "off"
},
/* @__PURE__ */ _react_17_0_2_react.createElement(
es_form["default"].Item,
{
name: "start_password",
label: "\u5F00\u8003\u5BC6\u7801",
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u5F00\u8003\u5BC6\u7801" }]
},
/* @__PURE__ */ _react_17_0_2_react.createElement(input["default"].Password, { autoComplete: "off" })
)
))
});
});
const getExerciseUserInfo = () => Answer_async(void 0, null, function* () {
const res = yield dispatch({
type: "exercise/getExerciseUserInfo",
payload: Answer_spreadValues({}, params)
});
answerCheckDataRef.current = Answer_spreadProps(Answer_spreadValues({}, res.data), { status: res == null ? void 0 : res.status });
setAnswerCheckData(Answer_spreadProps(Answer_spreadValues({}, res.data), { status: res == null ? void 0 : res.status }));
});
(0,_react_17_0_2_react.useEffect)(() => {
if (answerCheckData == null ? void 0 : answerCheckData.exercise_user_id) {
if (!(answerCheckData == null ? void 0 : answerCheckData.is_commit)) {
(0,util/* copyTextFuc */.RG)(" ", true);
}
;
if (!(answerCheckData == null ? void 0 : answerCheckData.is_commit) && ((answerCheckData == null ? void 0 : answerCheckData.ip_limit) === "inner" || (answerCheckData == null ? void 0 : answerCheckData.ip_bind))) {
iframeUrlSuffix.current = `&ip_limit=${answerCheckData == null ? void 0 : answerCheckData.ip_limit}&ip_bind=${answerCheckData == null ? void 0 : answerCheckData.ip_bind}`;
}
;
if (!(answerCheckData == null ? void 0 : answerCheckData.is_commit)) {
(0,util/* copyTextFuc */.RG)(" ", true);
if (!(answerCheckData == null ? void 0 : answerCheckData.can_start)) {
window.location.href = `/classrooms/${params.coursesId}/exercise/${params.categoryId}/users/${params.login}/check`;
return;
}
if ((answerCheckData == null ? void 0 : answerCheckData.is_locked) && answerCheckData.ip_error) {
dispatch({
type: "exercise/setActionTabs",
payload: {
key: "student-unlock",
exerciseParams: Answer_spreadProps(Answer_spreadValues({}, answerCheckData), { id: params.categoryId })
}
});
return;
} else if (!(answerCheckData == null ? void 0 : answerCheckData.is_locked) && answerCheckData.ip_error) {
}
if (document.referrer === "" || performance.navigation.type === 2 || !allowRouter.includes(new URL(document.referrer).pathname)) {
sessionStorage.setItem("illegalEntry", "illegalEntry");
_umi_production_exports.history.push(`/classrooms/${params.coursesId}/exercise/`);
return;
}
if ((answerCheckData == null ? void 0 : answerCheckData.start_locked) && !(answerCheckData == null ? void 0 : answerCheckData.user_is_enter)) {
startLocke();
return;
}
if ((answerCheckData == null ? void 0 : answerCheckData.is_locked) && performance.navigation.type === 1 && !sessionStorage.getItem("studentunlock")) {
dispatch({
type: "exercise/setActionTabs",
payload: {
key: "student-unlock",
exerciseParams: Answer_spreadProps(Answer_spreadValues({}, answerCheckData), { id: params.categoryId })
}
});
return;
}
if ((answerCheckData == null ? void 0 : answerCheckData.is_locked) && performance.navigation.type === 0 && (answerCheckData == null ? void 0 : answerCheckData.user_is_enter) && !(answerCheckData == null ? void 0 : answerCheckData.is_commit)) {
dispatch({
type: "exercise/setActionTabs",
payload: {
key: "student-unlock",
exerciseParams: Answer_spreadProps(Answer_spreadValues({}, answerCheckData), { id: params.categoryId })
}
});
return;
}
} else if (!answerCheckData.answered_open) {
es_modal["default"].info({
width: 500,
centered: true,
icon: null,
title: "\u63D0\u793A",
content: "\u8001\u5E08\u5DF2\u8BBE\u7F6E\u672C\u8BD5\u5377\u5728\u4EA4\u5377\u540E\u4E0D\u53EF\u67E5\u770B",
onOk: () => {
window.location.href = `/classrooms/${params.coursesId}/exercise/${params.categoryId}/detail`;
}
});
return;
}
checkCamera();
}
return () => {
if (!(answerCheckData == null ? void 0 : answerCheckData.is_commit) && (0,authority/* isStudent */.dE)()) {
(0,util/* copyTextFuc */.RG)(" ", true);
}
};
}, [answerCheckData]);
const checkCamera = () => Answer_async(void 0, null, function* () {
var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2;
sessionStorage.setItem("studentunlock", "studentunlock");
const res = { data: answerCheckData, status: answerCheckData.status };
if (((_a3 = res == null ? void 0 : res.data) == null ? void 0 : _a3.ip_limit) !== "no" || ((_b3 = res == null ? void 0 : res.data) == null ? void 0 : _b3.ip_bind))
localIpRef.current = yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.ip_limit, ip_bind: (_d2 = res == null ? void 0 : res.data) == null ? void 0 : _d2.ip_bind, ip_bind_type: (_e2 = res == null ? void 0 : res.data) == null ? void 0 : _e2.ip_bind_type });
if (((_f2 = res == null ? void 0 : res.data) == null ? void 0 : _f2.ip_limit) !== "no" || ((_g2 = res == null ? void 0 : res.data) == null ? void 0 : _g2.ip_bind)) {
if (((_h2 = res == null ? void 0 : res.data) == null ? void 0 : _h2.ip_limit) === "inner" || ((_i2 = res == null ? void 0 : res.data) == null ? void 0 : _i2.ip_bind)) {
var checkData = yield (0,util/* checkLocalOrPublicIp */.oi)({ exerciseId: params.categoryId, ip: localIpRef.current, errmsgHide: true, ip_limit: ((_j2 = res == null ? void 0 : res.data) == null ? void 0 : _j2.ip_limit) || "no", ip_bind: (_k2 = res == null ? void 0 : res.data) == null ? void 0 : _k2.ip_bind, ip_bind_type: (_l2 = res == null ? void 0 : res.data) == null ? void 0 : _l2.ip_bind_type });
if ((checkData == null ? void 0 : checkData.status) !== 0) {
setCheckStatus(checkData);
return;
}
}
}
if ((res == null ? void 0 : res.status) == 0) {
if (((_m2 = res == null ? void 0 : res.data) == null ? void 0 : _m2.used_screen_num) > ((_n2 = res == null ? void 0 : res.data) == null ? void 0 : _n2.screen_num) && ((_o2 = res == null ? void 0 : res.data) == null ? void 0 : _o2.screen_open)) {
handleSubmitAnswer();
return false;
}
setShowCamera(res == null ? void 0 : res.data.check_camera);
if (!(res == null ? void 0 : res.data.check_camera)) {
if (res == null ? void 0 : res.data.screen_shot_open) {
setStartRecording(answerCheckData == null ? void 0 : answerCheckData.screen_shot_open);
return;
}
setOpenFullScreen((_p2 = res == null ? void 0 : res.data) == null ? void 0 : _p2.screen_open);
initData();
}
}
});
const handleCheckInitModal = (res) => Answer_async(void 0, null, function* () {
if ((res == null ? void 0 : res.type) === 1) {
es_modal["default"].info({
centered: true,
width: 470,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
title: "\u63D0\u793A",
icon: null,
keyboard: false,
onOk: () => {
_umi_production_exports.history.replace(`/classrooms/${params.coursesId}/exercise/${params.categoryId}/detail`);
},
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (res == null ? void 0 : res.message) || "")
});
return Promise.reject();
}
if ((res == null ? void 0 : res.type) === 2) {
const toSkipUrl = () => {
_umi_production_exports.history.replace(`/classrooms/${params.coursesId}/exercise/${params.categoryId}/centralizeReview/${res == null ? void 0 : res.login}`);
};
es_modal["default"].confirm({
centered: true,
width: 470,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
title: "\u63D0\u793A",
icon: null,
keyboard: false,
onOk: toSkipUrl,
onCancel: () => {
_umi_production_exports.history.replace(`/classrooms/${params.coursesId}/exercise/${params.categoryId}/detail`);
},
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u60A8\u5DF2\u6210\u4E3A\u6307\u5B9A\u9605\u5377\u6559\u5E08\uFF0C\u662F\u5426\u73B0\u5728\u524D\u5F80", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: toSkipUrl, className: "ml5 mr5 c-light-primary current" }, "\u96C6\u4E2D\u9605\u5377"), "\u7EE7\u7EED\u8BC4\u9605\uFF1F"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-999" }, "\uFF08\u9605\u5377\u7ED3\u675F\u540E\u6062\u590D\u5B66\u751F\u4E2A\u4EBA\u8BC4\u9605\u529F\u80FD\uFF0C\u5E76\u5C55\u793A\u5B66\u751F\u6210\u7EE9\uFF09"))
});
return Promise.reject();
}
});
const initData = () => Answer_async(void 0, null, function* () {
var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2;
document.body.scrollIntoView();
setIsSpin(true);
let res;
let random_id = (_a3 = user.userInfo) == null ? void 0 : _a3.user_id;
if ((0,authority/* isAdmin */.GJ)()) {
res = yield (0,service_exercise/* getReviewExercise */.BJ)({ exerciseId: params.categoryId, login: params.login }).catch(() => setIsSpin(false));
(res == null ? void 0 : res.exercise) && (res.exercise.user_exercise_status = 1);
random_id = (_b3 = res == null ? void 0 : res.exercise_answer_user) == null ? void 0 : _b3.user_id;
} else {
if (searchParams.get("check")) {
res = yield (0,service_exercise/* getReviewExercise */.BJ)(Answer_spreadProps(Answer_spreadValues({}, params), { exerciseId: params.categoryId, login: params.login })).catch(() => setIsSpin(false));
random_id = (_c2 = res == null ? void 0 : res.exercise) == null ? void 0 : _c2.user_id;
} else {
if (((_d2 = answerCheckDataRef.current) == null ? void 0 : _d2.ip_limit) !== "no" || ((_e2 = answerCheckDataRef.current) == null ? void 0 : _e2.ip_bind))
localIpRef.current = yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: (_f2 = answerCheckDataRef.current) == null ? void 0 : _f2.ip_limit, ip_bind: (_g2 = answerCheckDataRef.current) == null ? void 0 : _g2.ip_bind, ip_bind_type: (_h2 = answerCheckDataRef.current) == null ? void 0 : _h2.ip_bind_type });
res = yield (0,service_exercise/* getExerciseStart */.CD)(Answer_spreadProps(Answer_spreadValues({}, params), { ip: localIpRef.current })).catch(() => setIsSpin(false));
if (res.status === -1) {
handleToDetail();
}
if ((res == null ? void 0 : res.status) === -5) {
dispatch({
type: "exercise/setActionTabs",
payload: {
key: "student-unlock",
exerciseParams: Answer_spreadProps(Answer_spreadValues({}, answerCheckDataRef.current), { id: params.categoryId, errorMessage: res == null ? void 0 : res.message })
}
});
return;
}
(res == null ? void 0 : res.exercise) && (res.exercise.user_exercise_status = 0);
(res == null ? void 0 : res.exercise) && (res.exercise.exercise_status = 2);
(_i2 = res == null ? void 0 : res.exercise_question_types) == null ? void 0 : _i2.map((item) => {
var _a4;
if ((item == null ? void 0 : item.question_type) < 3) {
(_a4 = item == null ? void 0 : item.items) == null ? void 0 : _a4.map((ite) => {
ite.user_answer = ite.question_choices.filter((j) => j.user_answer_boolean).map((k) => k.choice_id);
});
}
});
}
if (!((_j2 = res == null ? void 0 : res.exercise) == null ? void 0 : _j2.can_start) && (res == null ? void 0 : res.exercise)) {
window.location.href = `/classrooms/${params.coursesId}/exercise/${params.categoryId}/users/${params.login}/check`;
return;
}
if (((_k2 = res.exercise) == null ? void 0 : _k2.commit_status) === 0 && !lockRef.current) {
try {
lockRef.current = true;
socket.send(JSON.stringify({ type: "toggleLockExit", data: true }));
socket.send(JSON.stringify({ type: "network-close", data: "" }));
if ((_l2 = res == null ? void 0 : res.exercise) == null ? void 0 : _l2.screen_open) {
socket.send(JSON.stringify({ type: "open-disabled-switchscreen", data: "" }));
}
} catch (e) {
}
;
}
if ((_m2 = res == null ? void 0 : res.exercise) == null ? void 0 : _m2.left_time) {
setTimeout(() => {
setCountDownColor(Answermodules.red);
}, (((_n2 = res == null ? void 0 : res.exercise) == null ? void 0 : _n2.left_time) - 300 > 0 ? ((_o2 = res == null ? void 0 : res.exercise) == null ? void 0 : _o2.left_time) - 300 : 0) * 1e3);
}
if (((_p2 = res == null ? void 0 : res.exercise) == null ? void 0 : _p2.take_photo) >= ((_q2 = res == null ? void 0 : res.exercise) == null ? void 0 : _q2.photo_count)) {
}
}
setIsSpin(false);
yield handleCheckInitModal(res);
if (res) {
if (((_r2 = res == null ? void 0 : res.exercise) == null ? void 0 : _r2.question_random) || ((_s2 = res == null ? void 0 : res.exercise) == null ? void 0 : _s2.choice_random)) {
let key = 1;
res.exercise.question_random = (_t2 = res == null ? void 0 : res.exercise_question_types) == null ? void 0 : _t2.map((item) => {
var _a4, _b4;
if ((_a4 = res == null ? void 0 : res.exercise) == null ? void 0 : _a4.choice_random) {
if (item.question_type === 0 || item.question_type === 1) {
item.items.map((i) => {
i.question_choices = (0,util/* randomArray */.M2)(i.question_choices, random_id);
return i;
});
}
if (item.question_type === 7) {
item.items.forEach((i) => {
i.sub_exercise_questions.forEach((k) => {
if (k.question_choices) {
k.question_choices = (0,util/* randomArray */.M2)(k.question_choices, random_id);
}
});
});
}
}
if ((_b4 = res == null ? void 0 : res.exercise) == null ? void 0 : _b4.question_random) {
item.items = (0,util/* randomArray */.M2)(item.items, random_id);
}
item.items.map((i) => {
i.question_num = key;
key++;
return i;
});
return item;
});
}
res.exercise_types = (res == null ? void 0 : res.exercise_types) || ((_u2 = res == null ? void 0 : res.exercise_scores) == null ? void 0 : _u2.exercise_types);
res.question_status = res.question_status || createItems((res == null ? void 0 : res.exercise_question_types) || []);
setAnswerData(res);
}
return res;
});
const createItems = (item) => {
let items = [];
item.forEach((e) => {
items = items.concat(e.items);
});
items = items.map((e) => ({ ques_status: e == null ? void 0 : e.ques_status, question_num: e == null ? void 0 : e.question_num, ques_id: e == null ? void 0 : e.question_id }));
return items;
};
(0,_react_17_0_2_react.useEffect)(() => {
var _a3, _b3, _c2;
if (((_a3 = answerData.exercise) == null ? void 0 : _a3.left_time) === 0) {
handleSubmitAnswer();
}
((_b3 = answerData.exercise) == null ? void 0 : _b3.left_time) && setTime(Date.now() + ((_c2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _c2.left_time) * 1e3);
}, [(_c = answerData.exercise) == null ? void 0 : _c.left_time]);
const handleBackToRedo = () => {
var _a3;
if (((_a3 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a3.exercise_status) === 3) {
es_modal["default"].confirm({
width: 530,
title: "\u63D0\u793A",
icon: null,
centered: true,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C")
});
} else {
es_modal["default"].confirm({
width: 530,
title: "\u63D0\u793A",
icon: null,
centered: true,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\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__ */ _react_17_0_2_react.createElement("br", null), "\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"),
onOk: () => Answer_async(void 0, null, function* () {
var _a4;
const res = yield (0,service_exercise/* redoExercise */.q6)({
categoryId: params.categoryId,
user_ids: [(_a4 = answerData == null ? void 0 : answerData.exercise_answer_user) == null ? void 0 : _a4.user_id]
});
if (res) {
message/* default */.ZP.info(res == null ? void 0 : res.message);
handleToDetail();
}
})
});
}
};
const handleToDetail = () => {
window.location.href = (0,util/* checkIsClientExam */.Ll)() ? "/" : `/classrooms/${params.coursesId}/exercise/${params.categoryId}/detail`;
};
const handleLeftTime = () => Answer_async(void 0, null, function* () {
const res = yield (0,service_exercise/* exerciseLeftTime */.PT)(Answer_spreadValues({}, params));
if (res == null ? void 0 : res.has_time) {
setTime(Date.now() + (res == null ? void 0 : res.left_time) * 1e3);
setAnswerData((prevData) => Answer_spreadProps(Answer_spreadValues({}, prevData), { exercise: Answer_spreadProps(Answer_spreadValues({}, prevData.exercise), { left_time: res == null ? void 0 : res.left_time }) }));
return true;
} else {
handleFinishTime();
return false;
}
});
const handleFinishTime = () => Answer_async(void 0, null, function* () {
const res = yield (0,service_exercise/* submitExerciseAnswer */.VL)({
categoryId: params.categoryId,
commit_method: 2
});
setOpenFullScreen(false);
setStartRecording(false);
if ((res == null ? void 0 : res.status) === 0) {
es_modal["default"].info({
width: 530,
title: "\u63D0\u793A",
centered: true,
okText: "\u786E\u5B9A",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),
onOk: () => Answer_async(void 0, null, function* () {
handleToDetail();
})
});
message/* default */.ZP.info(res == null ? void 0 : res.message);
}
if ((res == null ? void 0 : res.status) === -3) {
const time2 = parseInt(res == null ? void 0 : res.message);
answerData.exercise.left_time = time2;
setAnswerData(Answer_spreadValues({}, answerData));
}
});
const goShixun = (item) => Answer_async(void 0, null, function* () {
const res = yield (item.is_jupyter || item.is_jupyter_lab ? shixuns/* execJupyter */.BK : shixuns/* execShixun */.Ir)({ id: item.shixun_identifier });
if ((res == null ? void 0 : res.game_identifier) || (res == null ? void 0 : res.identifier)) {
if (item.is_jupyter_lab || item.is_jupyter) {
setIframeUrl(`/tasks/${res.identifier}/jupyter?type=exercises&exercisesId=${params.categoryId}&coursesId=${params.coursesId}&login=${params.login}&questionId=${item.question_id}&isFullScreen=${(0,fullscreen/* IsFull */.vp)()}${iframeUrlSuffix.current || ""}&ip_limit=${answerCheckData == null ? void 0 : answerCheckData.ip_limit}&ip_bind=${answerCheckData == null ? void 0 : answerCheckData.ip_bind}&ip_bind_type=${answerCheckData == null ? void 0 : answerCheckData.ip_bind_type}`);
} else {
setIframeUrl(`/tasks/${res.game_identifier}?type=exercises&exercisesId=${params.categoryId}&coursesId=${params.coursesId}&login=${params.login}&questionId=${item.question_id}&isFullScreen=${(0,fullscreen/* IsFull */.vp)()}${iframeUrlSuffix.current || ""}&ip_limit=${answerCheckData == null ? void 0 : answerCheckData.ip_limit}&ip_bind=${answerCheckData == null ? void 0 : answerCheckData.ip_bind}&ip_bind_type=${answerCheckData == null ? void 0 : answerCheckData.ip_bind_type}`);
}
setIframeBlock("block");
}
if ((res == null ? void 0 : res.status) === -3) {
(0,util/* bindPhone */.eF)();
} else if ((res == null ? void 0 : res.status) === 2) {
handleResetGame(res == null ? void 0 : res.message, item.question_id, item.is_jupyter_lab, item.is_jupyter);
} else if ((res == null ? void 0 : res.status) === 3) {
handleInBeta(res == null ? void 0 : res.message);
}
});
const handleResetGame = (url, question_id, is_jupyter_lab, is_jupyter) => {
url = (url == null ? void 0 : url.includes(".json")) ? url : `${url}.json`;
es_modal["default"].confirm({
centered: true,
title: "\u63D0\u793A",
icon: null,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),
onOk: () => Answer_async(void 0, null, function* () {
const res = yield (0,service_exercise/* resetMyGame */.$Q)({ url });
if (!res) {
return;
}
message/* default */.ZP.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8DF5\u9879\u76EE\uFF01");
const execRes = yield (0,shixuns/* execShixun */.Ir)({ id: res.shixun_identifier });
if (execRes == null ? void 0 : execRes.game_identifier) {
goShixun({ shixun_identifier: execRes == null ? void 0 : execRes.game_identifier, question_id, is_jupyter_lab, is_jupyter });
return;
}
if ((execRes == null ? void 0 : execRes.status) === 2) {
handleResetGame(execRes == null ? void 0 : execRes.message, question_id, is_jupyter_lab, is_jupyter);
} else if ((execRes == null ? void 0 : execRes.status) === 3) {
handleInBeta(execRes == null ? void 0 : execRes.message);
}
})
});
};
const handleInBeta = (message2) => {
es_modal["default"].confirm({
centered: true,
title: "\u63D0\u793A",
icon: null,
okText: "\u786E\u5B9A",
cancelText: "\u53D6\u6D88",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message2, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")
});
};
const handleJoinShixun = (item) => Answer_async(void 0, null, function* () {
var _a3;
const checkRes = yield (0,service_exercise/* checkRedoStatus */.o3)({ exercise_user_id: (_a3 = exercise.exerciseUserInfo) == null ? void 0 : _a3.exercise_user_id, shixun_id: item.shixun_id });
if (checkRes == null ? void 0 : checkRes.redo) {
es_modal["default"].info({
width: 530,
title: "\u63D0\u793A",
icon: null,
centered: true,
okText: "\u786E\u5B9A",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, "\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"),
onOk: () => Answer_async(void 0, null, function* () {
const res = yield (0,service_exercise/* resetMyGame */.$Q)({ id: checkRes == null ? void 0 : checkRes.myshixun_identifier, url: checkRes == null ? void 0 : checkRes.url });
if (res) {
clearCountdownTimeout();
const newQuestions = (0,lodash.cloneDeep)(answerData == null ? void 0 : answerData.exercise_question_types);
const index = newQuestions == null ? void 0 : newQuestions.findIndex((e) => e.question_type === 5);
newQuestions[index].items.find((er) => er.question_id === item.question_id).redo = false;
newQuestions[index].items.find((er) => er.question_id === item.question_id).shixun_identifier = res.shixun_identifier;
answerData.exercise_question_types = newQuestions;
setAnswerData(answerData);
const newItem = Answer_spreadProps(Answer_spreadValues({}, item), { shixun_identifier: res.shixun_identifier });
goShixun(newItem);
}
})
});
} else {
clearCountdownTimeout();
goShixun(item);
}
});
const handleJoinProgram = (item) => Answer_async(void 0, null, function* () {
if (item.hack_identifier) {
const res = yield (0,service_exercise/* startProgram */.nF)({ id: item.hack_identifier });
if ((res == null ? void 0 : res.status) === 0) {
clearCountdownTimeout();
setIframeUrl(`/myproblems/${res.identifier}?type=exercises&exercisesId=${params.categoryId}&coursesId=${params.coursesId}&login=${params.login}&questionId=${item.question_id}${iframeUrlSuffix.current || ""}`);
setIframeBlock("block");
}
}
});
const handleSave = (questionId, exercise_choice_id, answer_text, callBack, kp_content, kp_clazz, hideLoading) => Answer_async(void 0, null, function* () {
var _a3, _b3;
if (!hideLoading)
setIsSpin(true);
let ip;
let saveParams = {
questionId,
exercise_choice_id,
answer_text
};
if ((answerCheckData == null ? void 0 : answerCheckData.ip_limit) === "inner" || answerCheckData.ip_bind && answerCheckData.ip_bind_type) {
ip = yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: answerCheckData == null ? void 0 : answerCheckData.ip_limit, ip_bind: answerCheckData == null ? void 0 : answerCheckData.ip_bind, ip_bind_type: answerCheckData == null ? void 0 : answerCheckData.ip_bind_type });
}
if (kp_content) {
saveParams["kp_content"] = kp_content;
}
if (kp_content) {
saveParams["kp_clazz"] = kp_clazz;
}
if (!questionId) {
console.error(`handleSave no questionId params`);
return;
}
saveParams.ip = ip;
const res = yield (0,service_exercise/* updateExerciseAnswers */.oX)(saveParams);
if ((_a3 = res == null ? void 0 : res.alert) == null ? void 0 : _a3.length) {
(_b3 = res == null ? void 0 : res.alert) == null ? void 0 : _b3.map((item) => {
es_modal["default"].warn({
title: "\u63D0\u793A",
autoFocusButton: null,
content: item
});
});
}
if ((res == null ? void 0 : res.status) === 0) {
callBack && callBack();
signConfigFuc();
} else if ((res == null ? void 0 : res.status) === -1) {
setTimeout(() => {
handleToDetail();
}, 1e3);
} else if ((res == null ? void 0 : res.status) === -2) {
setCheckStatus(res);
} else if ((res == null ? void 0 : res.status) === -3) {
res.status = -1;
setCheckStatus(res);
} else if ((res == null ? void 0 : res.status) === -4) {
signConfigFuc();
} else if ((res == null ? void 0 : res.status) === -5) {
dispatch({
type: "exercise/setActionTabs",
payload: {
key: "student-unlock",
exerciseParams: Answer_spreadProps(Answer_spreadValues({}, answerCheckData), { id: params.categoryId, errorMessage: res == null ? void 0 : res.message })
}
});
} else {
message/* default */.ZP.warning(res.message || "\u8BD5\u5377\u5DF2\u622A\u6B62\uFF0C\u5DF2\u81EA\u52A8\u4EA4\u5377");
}
setIsSpin(false);
return res;
});
const handleVerifySave = (isSave) => Answer_async(void 0, null, function* () {
var _a3, _b3, _c2, _d2;
const timeRes = yield (0,service_exercise/* exerciseLeftTime */.PT)(Answer_spreadValues({}, params));
const time2 = (timeRes == null ? void 0 : timeRes.left_time) ? Date.now() + (timeRes == null ? void 0 : timeRes.left_time) * 1e3 : null;
const res = yield (0,service_exercise/* beginCommit */.Vj)({ id: params.categoryId });
if (!res) {
return;
}
console.log("res===", res);
if (res.question_undo !== 0 || res.oj_undo !== 0) {
let tip;
if (res.question_undo > 0) {
const total = /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u6709", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.orangeNum }, res.question_undo), "\u9898\u672A\u5B8C\u6210");
if (res.oj_undo > 0 || res.shixun_undo > 0) {
const renderArr = [
{ type: ((_b3 = (_a3 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _a3.find((item) => item.question_type == 6)) == null ? void 0 : _b3.name) || "\u7F16\u7A0B\u9898", num: res.oj_undo },
{ type: ((_d2 = (_c2 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _c2.find((item) => item.question_type == 5)) == null ? void 0 : _d2.name) || "\u5B9E\u8BAD\u9898", num: res.shixun_undo }
];
const filteredArr = renderArr.filter((item) => item.num > 0);
tip = /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, total, "\uFF08\u5176\u4E2D\u6709", filteredArr.map((item, index) => /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.orangeNum }, item == null ? void 0 : item.num), "\u4E2A", item == null ? void 0 : item.type, index !== (filteredArr == null ? void 0 : filteredArr.length) - 1 ? "\u3001" : "")), "\uFF09");
}
}
es_modal["default"].confirm({
width: 530,
title: "\u63D0\u793A",
icon: null,
closable: true,
centered: true,
okText: isSave ? "\u77E5\u9053\u4E86" : "\u786E\u8BA4\u4EA4\u5377",
cancelText: "\u53D6\u6D88",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, tip, isSave ? `\u5728${dayjs_min_default()(res.end_time).format("YYYY-MM-DD HH:mm")}\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898` : time2 ? `\u4F60\u672C\u573A\u8003\u8BD5\u5269\u4F59\u65F6\u95F4\u8FD8\u6709${(0,util/* toTimeFormat */.li)((time2 - (/* @__PURE__ */ new Date()).getTime()) / 1e3)} \uFF0C\u786E\u8BA4\u63D0\u524D\u4EA4\u5377\u5417\uFF1F` : "\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),
onOk: () => Answer_async(void 0, null, function* () {
setOpenFullScreen(false);
setStartRecording(false);
if (isSave) {
if (!(answerCheckData == null ? void 0 : answerCheckData.screen_open))
handleToDetail();
else
message/* default */.ZP.success("\u4FDD\u5B58\u6210\u529F");
} else {
yield handleSubmitAnswer();
}
})
});
} else {
es_modal["default"].confirm({
width: 530,
title: "\u63D0\u793A",
icon: null,
centered: true,
okText: isSave ? "\u77E5\u9053\u4E86" : "\u786E\u8BA4\u4EA4\u5377",
cancelText: "\u53D6\u6D88",
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, isSave ? `\u5728${dayjs_min_default()(res.end_time).format("YYYY-MM-DD HH:mm")}\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898` : time2 ? `\u4F60\u672C\u573A\u8003\u8BD5\u5269\u4F59\u65F6\u95F4\u8FD8\u6709${(0,util/* toTimeFormat */.li)((time2 - (/* @__PURE__ */ new Date()).getTime()) / 1e3)} \uFF0C\u786E\u8BA4\u63D0\u524D\u4EA4\u5377\u5417\uFF1F` : "\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),
onOk: () => Answer_async(void 0, null, function* () {
setOpenFullScreen(false);
setStartRecording(false);
if (isSave) {
if (!(answerCheckData == null ? void 0 : answerCheckData.screen_open))
handleToDetail();
else
message/* default */.ZP.success("\u4FDD\u5B58\u6210\u529F");
} else {
yield handleSubmitAnswer();
}
})
});
}
});
const submitProgressContent = (progress) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(
es_progress/* default */.Z,
{
strokeColor: {
from: "#3061D0",
to: "#63E0FB"
},
status: "active",
percent: progress
}
), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "c-grey-c tc mt10 mb20" }, "\u6B63\u5728\u5224\u5206\u4E2D\u2026"));
};
const submitProgressLoading = () => {
let progress = 0;
let modal = es_modal["default"].info({
title: "\u4EA4\u5377\u4E2D",
icon: null,
className: "modal-footer-none",
content: submitProgressContent(progress)
});
let interval = setInterval(() => {
if (progress <= 100) {
progress += 2;
modal.update({
content: submitProgressContent(progress)
});
} else {
modal.destroy();
clearInterval(interval);
}
}, 50);
};
const handleSubmitAnswer = () => Answer_async(void 0, null, function* () {
const res = yield (0,service_exercise/* submitExerciseAnswer */.VL)({ categoryId: params.categoryId, commit_method: 1 });
yield dispatch({
type: "exercise/setActionTabs",
payload: Answer_spreadValues({}, { removeEventListenerExitScreen: true })
});
if ((res == null ? void 0 : res.status) === 0) {
submitProgressLoading();
message/* default */.ZP.success(res == null ? void 0 : res.message);
setShowCamera(false);
try {
socket.send(JSON.stringify({ type: "toggleLockExit", data: false }));
socket.send(JSON.stringify({ type: "network-open", data: "" }));
socket.send(JSON.stringify({ type: "close-disabled-switchscreen", data: "" }));
} catch (e) {
}
setTimeout(() => {
var _a3, _b3, _c2, _d2, _e2;
es_modal["default"].info({
centered: true,
title: "\u4EA4\u5377\u6210\u529F",
className: `${Answermodules.commitModal}`,
width: 520,
icon: null,
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20", gutter: 20 }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 12, className: Answermodules.commitItem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoLabel }, "\u59D3\u540D"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoValue, title: (_a3 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a3.user_name }, ((_b3 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b3.user_name) || "- -")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 12, className: Answermodules.commitItem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoLabel }, "\u4F5C\u7B54\u65F6\u957F"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoValue }, (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.user_exercise_time))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { gutter: 20 }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 12, className: Answermodules.commitItem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoLabel }, "\u5B66\u53F7"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoValue }, ((_d2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d2.student_id) || "- -")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { span: 12, className: Answermodules.commitItem }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoLabel }, "\u4EA4\u5377\u65F6\u95F4"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.commitInfoValue }, (_e2 = res == null ? void 0 : res.data) == null ? void 0 : _e2.commit_time)))),
okText: "\u786E\u5B9A",
maskClosable: false,
keyboard: false,
onOk: () => {
(0,fullscreen/* exitFull */.BU)();
handleToDetail();
}
});
}, 3e3);
}
});
const handleChangeSingle = (value, id, key, item, items) => Answer_async(void 0, null, function* () {
handleSave(id, value, null, () => {
var _a3, _b3, _c2, _d2;
item.user_answer = [];
item.user_answer.push(value);
if (items == null ? void 0 : items.question_id) {
let answer = (_a3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _a3.filter((item2) => {
var _a4;
return ((_a4 = item2.user_answer) == null ? void 0 : _a4.length) === 0;
});
const fill = (_b3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _b3.filter((jtem) => jtem.question_type == 3);
const isFillFinished = fill.length > 0 ? fill.every((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) == ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 1 : fill.some((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) > ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 2 : 0 : 1;
answerData.question_status.find((item2) => item2.ques_id === (items == null ? void 0 : items.question_id)).ques_status = (answer == null ? void 0 : answer.length) === ((_c2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _c2.length) ? 0 : (answer == null ? void 0 : answer.length) > 0 && (answer == null ? void 0 : answer.length) < ((_d2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _d2.length) ? 2 : isFillFinished;
} else {
answerData.question_status.find((item2) => item2.ques_id === id).ques_status = value ? 1 : 0;
}
setAnswerData(Answer_spreadValues({}, answerData));
});
});
const handleChangeSingles = (value, id, key, item, items) => Answer_async(void 0, null, function* () {
handleSave(item.question_id, value, null, () => {
var _a3, _b3, _c2;
item.user_answer = [];
item.user_answer.push(value);
items.user_answer = [...item.user_answer];
let answer = (_a3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _a3.filter((item2) => {
var _a4;
return ((_a4 = item2.user_answer) == null ? void 0 : _a4.length) === 0;
});
answerData.question_status.find((item2) => item2.ques_id === id).ques_status = (answer == null ? void 0 : answer.length) === ((_b3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _b3.length) ? 0 : (answer == null ? void 0 : answer.length) > 0 && (answer == null ? void 0 : answer.length) < ((_c2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _c2.length) ? 2 : 1;
setAnswerData(Answer_spreadValues({}, answerData));
});
});
const handleChangeMultiple = (value, id, item, items) => {
if (!(value == null ? void 0 : value.length))
return;
handleSave(id, value, null, () => {
var _a3, _b3, _c2, _d2;
item.user_answer = value;
if (items == null ? void 0 : items.question_id) {
let answer = (_a3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _a3.filter((item2) => {
var _a4;
return ((_a4 = item2.user_answer) == null ? void 0 : _a4.length) === 0;
});
const fill = (_b3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _b3.filter((jtem) => jtem.question_type == 3);
const isFillFinished = fill.length > 0 ? fill.every((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) == ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 1 : fill.some((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) > ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 2 : 0 : 1;
answerData.question_status.find((item2) => item2.ques_id === (items == null ? void 0 : items.question_id)).ques_status = (answer == null ? void 0 : answer.length) === ((_c2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _c2.length) ? 0 : (answer == null ? void 0 : answer.length) > 0 && (answer == null ? void 0 : answer.length) < ((_d2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _d2.length) ? 2 : isFillFinished;
} else {
answerData.question_status.find((item2) => item2.ques_id === id).ques_status = (value == null ? void 0 : value.length) ? 1 : 0;
}
setAnswerData(Answer_spreadValues({}, answerData));
});
};
const handleBlurFill = (value, index, id, param, item, items) => Answer_async(void 0, null, function* () {
if (!value.replaceAll(" ", "")) {
signConfigFuc();
return { status: -4, message: "\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A" };
}
const res = yield handleSave(id, index, value, () => {
var _a3, _b3, _c2, _d2;
let answers = { choice_id: index, answer_text: value };
if (item.user_answer.filter((item2) => item2.choice_id != index)) {
item.user_answer.splice(index - 1, 1, answers);
} else {
item.user_answer.push(answers);
}
if (items == null ? void 0 : items.question_id) {
let answer = (_a3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _a3.filter((item2) => {
var _a4;
return ((_a4 = item2.user_answer) == null ? void 0 : _a4.length) === 0;
});
const fill = (_b3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _b3.filter((jtem) => jtem.question_type == 3);
const isFillFinished = fill.length > 0 ? fill.every((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) == ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 1 : fill.some((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) > ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 2 : 0 : 1;
answerData.question_status.find((item2) => item2.ques_id === (items == null ? void 0 : items.question_id)).ques_status = (answer == null ? void 0 : answer.length) === ((_c2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _c2.length) ? 0 : (answer == null ? void 0 : answer.length) > 0 && (answer == null ? void 0 : answer.length) < ((_d2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _d2.length) ? 2 : isFillFinished;
} else {
answerData.question_status.find((item2) => item2.ques_id === id).ques_status = param.every((k) => !!k.answer_text) ? 1 : answerData.question_status.find((item2) => item2.ques_id === id).ques_status = param.some((k) => !!k.answer_text) ? 2 : 0;
}
setAnswerData(Answer_spreadValues({}, answerData));
});
return res;
});
const handleBlurBProgram = (value, index, id, param, item) => Answer_async(void 0, null, function* () {
const res = yield handleSave(id, index, value, () => {
answerData.question_status.find((item2) => item2.ques_id === id).ques_status = param.every((k) => !!k.value) ? 1 : answerData.question_status.find((item2) => item2.ques_id === id).ques_status = param.some((k) => !!k.value) ? 2 : 0;
let answers = { choice_id: index, answer_text: value };
if (item.user_answer.filter((item2) => item2.choice_id != index)) {
item.user_answer.splice(index - 1, 1, answers);
} else {
item.user_answer.push(answers);
}
if (!item.repeat_answer) {
item.israp = true;
}
setAnswerData(Answer_spreadValues({}, answerData));
});
return res;
});
const handleBlurSimple = (value, id, item, hideLoading, items) => {
if (!value.replaceAll(" ", "")) {
signConfigFuc();
return;
}
handleSave(id, null, value, () => {
var _a3, _b3, _c2, _d2;
item.user_answer = [];
item.user_answer.push(value);
if (items == null ? void 0 : items.question_id) {
let answer = (_a3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _a3.filter((item2) => {
var _a4;
return ((_a4 = item2.user_answer) == null ? void 0 : _a4.length) === 0;
});
const fill = (_b3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _b3.filter((jtem) => jtem.question_type == 3);
const isFillFinished = fill.length > 0 ? fill.every((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) == ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 1 : fill.some((k) => {
var _a4;
return (k == null ? void 0 : k.multi_count) > ((_a4 = k == null ? void 0 : k.user_answer) == null ? void 0 : _a4.length);
}) ? 2 : 0 : 1;
answerData.question_status.find((item2) => item2.ques_id === (items == null ? void 0 : items.question_id)).ques_status = (answer == null ? void 0 : answer.length) === ((_c2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _c2.length) ? 0 : (answer == null ? void 0 : answer.length) > 0 && (answer == null ? void 0 : answer.length) < ((_d2 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _d2.length) ? 2 : isFillFinished;
} else {
answerData.question_status.find((item2) => item2.ques_id === id).ques_status = value ? 1 : 0;
}
setAnswerData(Answer_spreadValues({}, answerData));
}, void 0, void 0, hideLoading);
};
const renderSingle = (item, key, items) => {
var _a3, _b3, _c2, _d2, _e2, _f2, _g2;
let answerText = "";
const answerBool = (item == null ? void 0 : item.question_type) === 0 || (item == null ? void 0 : item.question_type) === 1;
if (answerBool) {
(_a3 = item == null ? void 0 : item.question_choices) == null ? void 0 : _a3.forEach((k, i) => {
if (k.standard_boolean) {
answerText = answerText + tagList[i];
}
});
}
const disabled2 = ((_b3 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b3.user_exercise_status) === 1 || !item.repeat_answer && ((_c2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _c2.length) > 0 && item.ques_status !== 0;
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.baseMargin }, /* @__PURE__ */ _react_17_0_2_react.createElement(
es_radio/* default.Group */.ZP.Group,
{
disabled: disabled2,
defaultValue: (_d2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _d2[0],
onChange: (e) => handleChangeSingle(e.target.value, item == null ? void 0 : item.question_id, key, item, items),
className: item.user_score && `edu-radio-${item.user_score === item.question_score ? "green" : "red"}`
},
(_e2 = item == null ? void 0 : item.question_choices) == null ? void 0 : _e2.map((answer, index) => {
const isJudge = item.question_type == 2;
const prefix = isJudge ? "" : `${tagList[index]}.`;
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.answerWrap, key: index }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_radio/* default */.ZP, { className: Answermodules.noWrap, value: answer == null ? void 0 : answer.choice_id }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333333" }, className: "font16 mr3" }, prefix), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { style: { width: 740 }, className: Answermodules.renderHtml, value: answer == null ? void 0 : answer.choice_text })));
})
)), ((0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_f2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _f2.user_exercise_status) > 0 && ((_g2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _g2.open_score)) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "end", className: "mb20", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14", style: { color: "#6A7283" } }, "\u5F97\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 ml10" }, (item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answer_scoreStatusMapping[Number(item == null ? void 0 : item.answer_status)] || "c-orange-ff9" }, item == null ? void 0 : item.user_score), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: 5, color: "#6A7283" } }, "\u5206")), !(item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u672A\u8BC4"))), (item == null ? void 0 : item.standard_answer_show) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.analysisWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.greyBg }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u7B54\u6848\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, answerBool ? answerText : item == null ? void 0 : item.standard_answer_show)), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u89E3\u6790\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: Answermodules.renderHtml, value: item == null ? void 0 : item.analysis })))));
};
const renderSingles = (items, keys, i) => {
var _a3, _b3;
const disabled2 = ((_a3 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a3.user_exercise_status) === 1 || !items.repeat_answer && items.ques_status !== 0;
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, (_b3 = items == null ? void 0 : items.sub_exercise_questions) == null ? void 0 : _b3.map((item, key) => {
var _a4;
let answerText = "";
(_a4 = item == null ? void 0 : item.question_choices) == null ? void 0 : _a4.forEach((k, i2) => {
if (k.standard_boolean) {
answerText = answerText + tagList[i2];
}
});
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Answermodules.baseMargin} ${Answermodules.singleItem} mb20`, key }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", alignItems: "baseline", userSelect: "none", marginBottom: 40 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flexShrink: 0, color: "#999999" }, className: "font14" }, "\uFF08", item == null ? void 0 : item.question_score, "\u5206\uFF09"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { flexShrink: 0, marginRight: 6 }, className: "font16" }, i + 1 + "." + (key + 1)), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: item == null ? void 0 : item.question_title })), ((item == null ? void 0 : item.question_type) == 0 || (item == null ? void 0 : item.question_type) == 2) && renderSingle(item, item == null ? void 0 : item.question_type, items), (item == null ? void 0 : item.question_type) == 1 && renderMultiple(item, item == null ? void 0 : item.question_type, items), (item == null ? void 0 : item.question_type) == 3 && renderFill(item, item == null ? void 0 : item.question_type, items), (item == null ? void 0 : item.question_type) == 4 && renderSimple(item, item == null ? void 0 : item.question_type, items));
}));
};
const renderMultiple = (item, key, items) => {
var _a3, _b3, _c2, _d2, _e2, _f2;
let answerText = "";
const answerBool = (item == null ? void 0 : item.question_type) === 0 || (item == null ? void 0 : item.question_type) === 1;
if (answerBool) {
(_a3 = item == null ? void 0 : item.question_choices) == null ? void 0 : _a3.forEach((k, i) => {
if (k.standard_boolean) {
answerText = answerText + tagList[i];
}
});
}
const disabled2 = ((_b3 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b3.user_exercise_status) === 1 || !item.repeat_answer && ((_c2 = item == null ? void 0 : item.user_answer) == null ? void 0 : _c2.length) > 0 && item.ques_status !== 0;
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.baseMargin }, /* @__PURE__ */ _react_17_0_2_react.createElement(
es_checkbox["default"].Group,
{
disabled: disabled2,
defaultValue: item == null ? void 0 : item.user_answer,
style: { flexDirection: "column" },
onChange: (value) => handleChangeMultiple(value, item == null ? void 0 : item.question_id, item, items),
className: item.user_score && `edu-checkbox-${item.user_score === item.question_score ? "green" : "red"}`
},
(_d2 = item == null ? void 0 : item.question_choices) == null ? void 0 : _d2.map((answer, index) => {
const prefix = `${tagList[index]}.`;
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.answerWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], { value: answer == null ? void 0 : answer.choice_id }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#333333" }, className: "font16 mr3" }, prefix), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: Answermodules.renderHtml, value: answer == null ? void 0 : answer.choice_text })));
})
)), ((0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_e2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _e2.user_exercise_status) > 0 && ((_f2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _f2.open_score)) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "end", className: "mb20", align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14", style: { color: "#6A7283" } }, "\u5F97\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 ml10" }, (item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answer_scoreStatusMapping[Number(item == null ? void 0 : item.answer_status)] || "c-orange-ff9" }, item == null ? void 0 : item.user_score), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { marginLeft: 5, color: "#6A7283" } }, "\u5206")), !(item == null ? void 0 : item.user_score) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u672A\u8BC4"))), (item == null ? void 0 : item.standard_answer_show) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.analysisWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.greyBg }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: "mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u7B54\u6848\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, answerBool ? answerText : item == null ? void 0 : item.standard_answer_show)), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "font14 mr10", style: { color: "#6A7283" } }, "\u3010\u89E3\u6790\u3011"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { className: Answermodules.renderHtml, value: item == null ? void 0 : item.analysis })))));
};
const renderFill = (item, key, items) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(
components_Fill,
{
item,
sign,
answerData,
onBlur: (value, index, userAnswer) => Answer_async(void 0, null, function* () {
return yield handleBlurFill(value, index, item == null ? void 0 : item.question_id, userAnswer, item, items);
})
}
);
};
const renderSimple = (item, key, items) => {
if (isEducation) {
return /* @__PURE__ */ _react_17_0_2_react.createElement(
Simple2,
{
item,
answerData,
onBlur: (value, kp_content, kp_clazz) => handleSave(item == null ? void 0 : item.question_id, null, value, void 0, kp_content, kp_clazz),
isEducation
}
);
} else {
return /* @__PURE__ */ _react_17_0_2_react.createElement(
components_Simple,
{
item,
answerData,
onBlur: (value, hideLoading) => handleBlurSimple(value, item == null ? void 0 : item.question_id, item, hideLoading, items),
isEducation,
sign
}
);
}
};
const renderShixun = (item, key) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(
components_Shixun,
{
item,
answerData,
exerciseId: params.categoryId,
coursesId: params.coursesId
}
);
};
const renderProgram = (item, key) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(
components_Program,
{
item,
answerData
}
);
};
const renderBProgram = (item, key) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(
components_BFill,
{
item,
answerData,
onBlur: (value, index, userAnswer) => Answer_async(void 0, null, function* () {
return yield handleBlurBProgram(value, index, item == null ? void 0 : item.question_id, userAnswer, item);
})
}
);
};
const renderAnswerCard = (title, key, index) => {
var _a3, _b3;
const obj = (_a3 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _a3.find((item) => item.question_type === key);
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.answerSheetWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement(
"div",
{
className: Answermodules.answerSheetQuestionTitle,
onClick: () => {
hideAnswerCard[key] = !hideAnswerCard[key];
setHideAnswerCard(Answer_spreadValues({}, hideAnswerCard));
}
},
!hideAnswerCard[key] && /* @__PURE__ */ _react_17_0_2_react.createElement(MinusSquareOutlined/* default */.Z, null),
hideAnswerCard[key] && /* @__PURE__ */ _react_17_0_2_react.createElement(PlusSquareOutlined/* default */.Z, null),
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml5 c-grey-666" }, title)
), !hideAnswerCard[key] && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: Answermodules.answerSheet, gutter: [20, 20], key }, (_b3 = obj == null ? void 0 : obj.items) == null ? void 0 : _b3.map(function(item, k) {
var _a4, _b4, _c2;
if (item.question_type === key) {
return /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
"div",
{
onClick: () => {
if (index === oneindex && k === twoindex) {
return;
}
if (sign.current) {
sign.current = "appoint";
skipData.current = { oneindex: index, twoindex: k };
return;
}
skipAppointQuestion({ oneindex: index, twoindex: k });
},
key: k,
className: `
${Answermodules.answerSheetItem}
${((_a4 = answerData == null ? void 0 : answerData.question_status) == null ? void 0 : _a4.some((val) => val.ques_id === item.question_id && (val == null ? void 0 : val.ques_status) === 1)) ? Answermodules.active : ""}
${((_b4 = answerData == null ? void 0 : answerData.question_status) == null ? void 0 : _b4.some((val) => val.ques_id === item.question_id && (val == null ? void 0 : val.ques_status) === 2)) ? Answermodules.partialActive : ""}
${index === oneindex && k === twoindex ? Answermodules.selected : ""}
`
},
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.qindex }, k + 1),
((_c2 = answerData == null ? void 0 : answerData.question_status) == null ? void 0 : _c2.some((val) => val.ques_id === item.question_id && (val == null ? void 0 : val.ques_status) === 2)) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: 12, background: "#3061D0", position: "absolute", width: "100%", bottom: 0 } }),
item.is_marked && /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `iconfont icon-biaoji1 ${Answermodules.markIcon}` })
));
}
})));
};
const renderQuestion = (item, i) => {
var _a3, _b3, _c2, _d2;
let answerText = "";
const answerBool = (item == null ? void 0 : item.question_type) === 0 || (item == null ? void 0 : item.question_type) === 1;
if (answerBool) {
(_a3 = item == null ? void 0 : item.question_choices) == null ? void 0 : _a3.forEach((k, i2) => {
if (k.standard_boolean) {
answerText = answerText + tagList[i2];
}
});
}
return /* @__PURE__ */ _react_17_0_2_react.createElement(
"div",
{ className: Answermodules.questionItem, id: `Anchor_${item == null ? void 0 : item.question_type}_${i}` },
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: "flex", alignItems: "baseline", marginBottom: 40, userSelect: "none" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${Answermodules.questionScore} mr10` }, item == null ? void 0 : item.question_score, "\u5206"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `font16 ${Answermodules.noWrap}` }, i + 1, "\u3001"), /* @__PURE__ */ _react_17_0_2_react.createElement(RenderHtml/* default */.Z, { value: (item == null ? void 0 : item.question_type) === 8 ? item == null ? void 0 : item.description : item == null ? void 0 : item.question_title }), !!((_b3 = item == null ? void 0 : item.schools) == null ? void 0 : _b3.length) && /* @__PURE__ */ _react_17_0_2_react.createElement(
tooltip/* default */.Z,
{
title: "\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"
},
/* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-zhidinggongkai1 line24 font18 c-orange" })
)),
// 单选题
(item == null ? void 0 : item.question_type) == 0 && renderSingle(item, item == null ? void 0 : item.question_type),
// 判断题
(item == null ? void 0 : item.question_type) == 2 && renderSingle(item, item == null ? void 0 : item.question_type),
// 多选题
(item == null ? void 0 : item.question_type) == 1 && renderMultiple(item, item == null ? void 0 : item.question_type),
// 填空题
(item == null ? void 0 : item.question_type) == 3 && renderFill(item, item == null ? void 0 : item.question_type),
// 简答题
(item == null ? void 0 : item.question_type) == 4 && renderSimple(item, item == null ? void 0 : item.question_type),
// 实训题
(item == null ? void 0 : item.question_type) == 5 && renderShixun(item, item == null ? void 0 : item.question_type),
// 编程题
(item == null ? void 0 : item.question_type) == 6 && renderProgram(item, item == null ? void 0 : item.question_type),
// 组合题
(item == null ? void 0 : item.question_type) == 7 && renderSingles(item, item == null ? void 0 : item.question_type, i),
// 编程题
(item == null ? void 0 : item.question_type) == 8 && renderBProgram(item, item == null ? void 0 : item.question_type),
(item == null ? void 0 : item.answer_comments) && /* @__PURE__ */ _react_17_0_2_react.createElement(components_NewAnswerComments, { hideScore: true, list: item == null ? void 0 : item.answer_comments }),
// 实训题 ,答题
(item == null ? void 0 : item.question_type) == 5 && ((_c2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _c2.user_exercise_status) === 0 && (item == null ? void 0 : item.answer_status) != 3 && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "end", className: "mt20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { type: "primary", className: Answermodules.toIframeBtn, onClick: () => Answer_async(void 0, null, function* () {
return yield handleJoinShixun(item);
}) }, "\u8FDB\u5165\u7B54\u9898")),
// 编程题 ,答题
(0,authority/* isStudent */.dE)() && ((_d2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d2.user_exercise_status) === 0 && (item == null ? void 0 : item.question_type) == 6 && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "end", className: "mt20" }, /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { type: "primary", className: Answermodules.toIframeBtn, onClick: () => handleJoinProgram(item) }, "\u8FDB\u5165\u7B54\u9898"))
);
};
const renderCardList = (item, index) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, renderAnswerCard((item == null ? void 0 : item.name) || constant/* QUESTIONTYPE */.f[item.question_type].name, item.question_type, index));
};
const sign = (0,_react_17_0_2_react.useRef)(false);
const skipData = (0,_react_17_0_2_react.useRef)({});
const switchType = (0,_react_17_0_2_react.useRef)();
const switchData = (0,_react_17_0_2_react.useRef)({});
const skipPrevQuestion = () => {
var _a3, _b3, _c2, _d2, _e2, _f2;
window.blur();
const currentQuestionItem = (_c2 = (_b3 = (_a3 = answerData.exercise_question_types) == null ? void 0 : _a3[oneindex]) == null ? void 0 : _b3.items) == null ? void 0 : _c2[twoindex];
if (!ischecked && ((_d2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d2.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
if (!(currentQuestionItem == null ? void 0 : currentQuestionItem.repeat_answer) && ((_e2 = currentQuestionItem == null ? void 0 : currentQuestionItem.user_answer) == null ? void 0 : _e2.length) > 0) {
if ((currentQuestionItem == null ? void 0 : currentQuestionItem.ques_status) === 0) {
switchType.current = "prev";
setisshowmodal(true);
return;
}
}
}
if (!(currentQuestionItem == null ? void 0 : currentQuestionItem.repeat_answer) && ((_f2 = currentQuestionItem == null ? void 0 : currentQuestionItem.user_answer) == null ? void 0 : _f2.length) > 0) {
currentQuestionItem.ques_status = 1;
}
questionPartRef.current.scrollTo({ top: 0, left: 0, behavior: "smooth" });
if (twoindex === 0) {
oneindex -= 1;
twoindex = answerData.exercise_question_types[oneindex].items.length - 1;
} else {
twoindex -= 1;
}
setoneindex(oneindex);
settwoindex(twoindex);
};
const skipNextQuestion = () => {
var _a3, _b3, _c2, _d2, _e2, _f2;
window.blur();
const currentQuestionItem = (_c2 = (_b3 = (_a3 = answerData.exercise_question_types) == null ? void 0 : _a3[oneindex]) == null ? void 0 : _b3.items) == null ? void 0 : _c2[twoindex];
if (!ischecked && ((_d2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d2.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
if (!(currentQuestionItem == null ? void 0 : currentQuestionItem.repeat_answer) && ((_e2 = currentQuestionItem == null ? void 0 : currentQuestionItem.user_answer) == null ? void 0 : _e2.length) > 0) {
if ((currentQuestionItem == null ? void 0 : currentQuestionItem.ques_status) === 0) {
switchType.current = "next";
setisshowmodal(true);
return;
}
}
}
if (!(currentQuestionItem == null ? void 0 : currentQuestionItem.repeat_answer) && ((_f2 = currentQuestionItem == null ? void 0 : currentQuestionItem.user_answer) == null ? void 0 : _f2.length) > 0) {
currentQuestionItem.ques_status = 1;
}
questionPartRef.current.scrollTo({ top: 0, left: 0, behavior: "smooth" });
if (answerData.exercise_question_types[oneindex].items.length - 1 === twoindex) {
oneindex = oneindex + 1;
twoindex = 0;
} else {
twoindex = twoindex + 1;
}
setoneindex(oneindex);
settwoindex(twoindex);
};
const skipAppointQuestion = (p) => {
var _a3, _b3, _c2, _d2, _e2, _f2;
const record = p || skipData.current;
const currentQuestionItem = (_c2 = (_b3 = (_a3 = answerData.exercise_question_types) == null ? void 0 : _a3[oneindex]) == null ? void 0 : _b3.items) == null ? void 0 : _c2[twoindex];
if (!ischecked && ((_d2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d2.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
if (!(currentQuestionItem == null ? void 0 : currentQuestionItem.repeat_answer) && ((_e2 = currentQuestionItem == null ? void 0 : currentQuestionItem.user_answer) == null ? void 0 : _e2.length) > 0) {
if ((currentQuestionItem == null ? void 0 : currentQuestionItem.ques_status) === 0) {
switchType.current = "appoint";
switchData.current = record;
setisshowmodal(true);
return;
}
}
}
if (!(currentQuestionItem == null ? void 0 : currentQuestionItem.repeat_answer) && ((_f2 = currentQuestionItem == null ? void 0 : currentQuestionItem.user_answer) == null ? void 0 : _f2.length) > 0) {
currentQuestionItem.ques_status = 1;
}
setoneindex(record == null ? void 0 : record.oneindex);
settwoindex(record == null ? void 0 : record.twoindex);
questionPartRef.current.scrollTo({ top: 0, left: 0, behavior: "smooth" });
};
const handleRefresh = () => Answer_async(void 0, null, function* () {
var _a3;
if (sign.current) {
sign.current = "refresh";
return;
}
const res = yield initData();
if ((_a3 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a3.left_time) {
yield handleLeftTime();
}
if (!(res == null ? void 0 : res.status)) {
message/* default */.ZP.success("\u66F4\u65B0\u6210\u529F");
}
});
const signConfigFuc = () => {
var _a3;
switch (sign.current) {
case "prev":
skipPrevQuestion();
break;
case "next":
skipNextQuestion();
break;
case "appoint":
skipAppointQuestion();
break;
case "submit":
handleVerifySave(false);
break;
case "refresh":
handleRefresh();
break;
default:
}
if (((_a3 = document.activeElement) == null ? void 0 : _a3.localName) === "textarea") {
sign.current = true;
} else {
sign.current = false;
}
skipData.current = {};
};
const renderClassifyQuestion = () => {
var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
const currentItem = (_b3 = (_a3 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _a3[oneindex].items) == null ? void 0 : _b3[twoindex];
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: oneindex }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "pt20 mb20" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.questionTypeTitle }, (0,util/* toChineseNumber */.EM)(oneindex + 1), "\u3001", (_d2 = (_c2 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _c2[oneindex]) == null ? void 0 : _d2.name), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.questionTypeInfo }, "\uFF08\u5171", (_f2 = (_e2 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _e2[oneindex]) == null ? void 0 : _f2.count, "\u9898\uFF1B", ((_h2 = (_g2 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _g2[oneindex]) == null ? void 0 : _h2.question_type) === 7 ? `\u5305\u542B${(_j2 = (_i2 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _i2[oneindex]) == null ? void 0 : _j2.sub_questions_count}\u5C0F\u9898` : "", " \u5171", (_l2 = (_k2 = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _k2[oneindex]) == null ? void 0 : _l2.score, "\u5206\uFF09"), !(currentItem == null ? void 0 : currentItem.repeat_answer) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#E30000", marginLeft: 20, fontSize: 14 } }, "\u6CE8\u610F\uFF1A\u8BE5\u9898\u4F5C\u7B54\u4E4B\u540E\u4E0D\u5141\u8BB8\u4FEE\u6539\u7B54\u6848\u3002")), /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: twoindex }, renderQuestion(currentItem, twoindex)));
};
return /* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { size: "middle", spinning: isSpin }, openFullScreen && ((_d = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d.user_exercise_status) === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(
recordScreen/* default */.Z,
{
exerciseUserInfo: exercise.exerciseUserInfo,
iframe,
socket,
onStartScreenshot: () => {
if (answerCheckData == null ? void 0 : answerCheckData.screen_shot_open) {
setStartScreenshot(true);
}
},
onCloseScreenshot: () => {
if (answerCheckData == null ? void 0 : answerCheckData.screen_shot_open) {
setStartScreenshot(false);
}
}
}
), /* @__PURE__ */ _react_17_0_2_react.createElement(
components_ReactCaptureScreens,
{
id: params.categoryId,
startRecording,
startScreenshot,
onSuccuss: () => {
setOpenFullScreen(answerCheckData == null ? void 0 : answerCheckData.screen_open);
initData();
},
onBack: handleToDetail
}
), /* @__PURE__ */ _react_17_0_2_react.createElement("iframe", { style: { display: iframeBlock }, id: "iframeShixuns", className: Answermodules.iframe, src: iframeUrl, ref: iframe, frameBorder: "0" }), checkStatus.status !== -2 && checkStatus.status !== -1 && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.fixHeader }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, align: "middle", className: "edu-container" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, (0,util/* exerciseTips */.vB)((_e = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _e.exercise_status)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: `${Answermodules.exerciseTitle} ml10`, title: (_f = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _f.exercise_name }, (_g = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _g.exercise_name), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: { marginLeft: "auto" } }, !((0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_h = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _h.user_exercise_status) == 1) && !!((_i = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _i.left_time) && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: `${Answermodules.countDown} ${countDownColor}` }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-daojishi", style: { marginRight: 6 } }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.cnText }, "\u5269\u4F59\u7B54\u9898\u65F6\u957F"), /* @__PURE__ */ _react_17_0_2_react.createElement(
Countdown,
{
value: time,
onFinish: handleLeftTime
}
))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, !((0,authority/* isAdmin */.GJ)() || (0,authority/* isStudent */.dE)() && ((_j = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _j.user_exercise_status) == 1) && exercise.actionTabs.key !== "student-unlock" && normalClose && /* @__PURE__ */ _react_17_0_2_react.createElement(
AsyncButton/* AsyncButton */.Z,
{
className: `${Answermodules.refreshBtn} ml30`,
onClick: handleRefresh
},
/* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "iconfont icon-shuaxin2 mr5" }),
"\u5237\u65B0"
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, (0,authority/* isStudent */.dE)() && ((_k = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _k.user_exercise_status) === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(AsyncButton/* AsyncButton */.Z, { className: `${Answermodules.submitButton} ml10`, type: "primary", onClick: () => Answer_async(void 0, null, function* () {
if (sign.current) {
sign.current = "submit";
return;
}
yield handleVerifySave(false);
}) }, "\u4EA4\u5377")), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, (((_l = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _l.commit_status) == 1 || ((_m = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _m.exercise_status) == 3) && ((_n = answerData == null ? void 0 : answerData.exercise_answer_user) == null ? void 0 : _n.analysis) && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.teachAnalysis, onClick: () => setTeachAnalysisModal(true) }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-jiaoshipingjia" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "ml5" }, "\u6559\u5E08\u8BC4\u4EF7"))))), /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: `edu-container ${Answermodules.wrapper} ${isEducation && Answermodules.wrpAnswer}` }, ((_p = (_o = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _o.exercise_description) == null ? void 0 : _p.length) > 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(
es_alert/* default */.Z,
{
className: Answermodules.exerciseAlert,
description: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { wrap: false, gutter: 10, align: "top" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.title }, "\u8003\u8BD5\u987B\u77E5"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.content }, (_q = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _q.exercise_description)),
closable: true
}
), checkStatus.status === 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: `${isEducation ? "mt70" : ""} ${Answermodules.mainPart}`, wrap: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: showAnswerCard ? "280px" : "0px", className: isEducation ? "mb100" : "" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.leftPart }, /* @__PURE__ */ _react_17_0_2_react.createElement("section", null, showAnswerCard && /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1", style: { background: "#fff", marginBottom: "10px", padding: "20px" } }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginBottom: 15 } }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u59D3\u540D"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `ml10 ${Answermodules.userInfoText}` }, ((_r = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _r.user_name) || "- -")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#5F6368" } }, "\u5B66\u53F7"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `ml10 ${Answermodules.userInfoText}` }, ((_s = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _s.student_id) || "- -"))), showAnswerCard && (0,authority/* isStudent */.dE)() && ((_t = answerData.exercise) == null ? void 0 : _t.user_exercise_status) === 0 && ((_u = answerData.exercise) == null ? void 0 : _u.open_phone_video_recording) && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: Answermodules.eduQrcode, style: { marginTop: 10 }, align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement((lib_default()), { value: `https://${document.domain}/live-push.html?id=${params.categoryId}&login=${params.login}&cookie=${(0,util/* getCookie */.ej)("_educoder_session")}` })), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: "ml15" }, "\u6253\u5F00\u5FAE\u4FE1\u626B\u4E00\u626B", /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), "\u5F00\u542F\u624B\u673A\u89C6\u9891\u5F55\u5236")), showAnswerCard && /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: "bg-white" }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: Answermodules.answerInfo }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, "\u7B54\u9898\u8FDB\u5EA6"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.answerProgress }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF" } }, (_w = (_v = answerData == null ? void 0 : answerData.question_status) == null ? void 0 : _v.filter((val) => val.ques_status === 1)) == null ? void 0 : _w.length), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#999999" } }, "/", (_x = answerData == null ? void 0 : answerData.exercise_types) == null ? void 0 : _x.q_counts))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
es_progress/* default */.Z,
{
strokeColor: "#165dffa6",
trailColor: "#0000000d",
percent: ((_z = (_y = answerData == null ? void 0 : answerData.question_status) == null ? void 0 : _y.filter((val) => val.ques_status === 1)) == null ? void 0 : _z.length) / ((_A = answerData == null ? void 0 : answerData.exercise_types) == null ? void 0 : _A.q_counts) * 100,
showInfo: false
}
)), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, "\u5171 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#165DFF" } }, ((_B = answerData == null ? void 0 : answerData.exercise_types) == null ? void 0 : _B.q_counts) || ((_D = (_C = answerData == null ? void 0 : answerData.exercise_scores) == null ? void 0 : _C.exercise_types) == null ? void 0 : _D.q_counts)), " \u9898\uFF1A"), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-grey-333" }, "\u6EE1\u5206 ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#FA6400" } }, ((_E = answerData == null ? void 0 : answerData.exercise_types) == null ? void 0 : _E.q_scores) || ((_G = (_F = answerData == null ? void 0 : answerData.exercise_scores) == null ? void 0 : _F.exercise_types) == null ? void 0 : _G.q_scores)), " \u5206")))), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: Answermodules.dottedLineWrapper, align: "middle" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.leftHalfCircle }), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: 1, className: Answermodules.dottedLine }), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.rightHalfCircle })), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement("aside", { className: `${Answermodules.cardList} ${((_H = answerData.exercise) == null ? void 0 : _H.open_phone_video_recording) ? Answermodules.withQrcode : ""}` }, (_I = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _I.map((er, index) => {
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, { key: er.question_type }, renderCardList(er, index));
})))))), (0,authority/* isStudent */.dE)() && /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { justify: "space-around", align: "middle", className: Answermodules.answerSheetBottom }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.tooltipWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: Answermodules.answerYes }), "\u5DF2\u7B54"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.tooltipWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${Answermodules.answerNo} ml10` }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { height: "50%", width: "100%", background: "#0152d9" } })), "\u90E8\u5206\u7B54\u9898"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.tooltipWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: `${Answermodules.answerNo} ml10` }), "\u672A\u7B54"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { className: Answermodules.tooltipWrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-biaoji1", style: { marginRight: 4, color: "#FFB538" } }), "\u6807\u8BB0")))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: Answermodules.fold, onClick: () => setShowAnswerCard(!showAnswerCard) }, showAnswerCard && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u6536\u8D77\u7B54\u9898\u5361" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "icon-zuojiantou iconfont c-grey-c" })), !showAnswerCard && /* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: "\u5C55\u5F00" }, " ", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "icon-youjiantou iconfont c-grey-c" })))), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement("section", { className: [Answermodules.rightPart, "ml20"].join(" ") }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: `${Answermodules.questionPart} pl30 pr30`, ref: questionPartRef }, renderClassifyQuestion()), /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: Answermodules.bottom, align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
AsyncButton/* AsyncButton */.Z,
{
icon: /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: `iconfont ${((_K = (_J = answerData.exercise_question_types) == null ? void 0 : _J[oneindex].items[twoindex]) == null ? void 0 : _K.is_marked) ? "icon-biaoji1" : "icon-biaojigaiti"}`, style: { color: "#FFB538", marginRight: 6 } }),
className: Answermodules.markBtn,
onClick: () => Answer_async(void 0, null, function* () {
var _a3;
const res = yield (0,service_exercise/* markQuestion */.sS)(params.categoryId, { exercise_question_id: (_a3 = answerData.exercise_question_types[oneindex].items[twoindex]) == null ? void 0 : _a3.question_id });
if (res.status === 0) {
initData();
}
})
},
((_M = (_L = answerData.exercise_question_types) == null ? void 0 : _L[oneindex].items[twoindex]) == null ? void 0 : _M.is_marked) ? "\u53D6\u6D88\u6807\u8BB0" : "\u6807\u8BB0\u8BE5\u9898"
)), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, (oneindex != 0 || twoindex != 0) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: `${Answermodules.changeButton} ${Answermodules.prevBtn} mr20`, type: "default", onClick: () => {
if (sign.current) {
sign.current = "prev";
return;
}
skipPrevQuestion();
} }, "\u4E0A\u4E00\u9898"), !(oneindex === ((_N = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _N.length) - 1 && twoindex === ((_Q = (_P = (_O = answerData == null ? void 0 : answerData.exercise_question_types) == null ? void 0 : _O[oneindex]) == null ? void 0 : _P.items) == null ? void 0 : _Q.length) - 1) && /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { className: Answermodules.changeButton, type: "primary", onClick: () => {
if (sign.current) {
sign.current = "next";
return;
}
skipNextQuestion();
} }, "\u4E0B\u4E00\u9898")))))), checkStatus.status !== 0 && /* @__PURE__ */ _react_17_0_2_react.createElement(ErrCheckIpTip, { data: checkStatus }), /* @__PURE__ */ _react_17_0_2_react.createElement(
es_modal["default"],
{
title: "\u6CE8\u610F",
open: isShowmodal,
closable: false,
footer: false
},
/* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("p", { style: { marginBottom: 0 } }, "\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 60, display: "flex", justifyContent: "space-between", alignItems: "center" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], { checked: ischecked, onChange: (e) => {
setischecked(e.target.checked);
} }, "\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => {
setisshowmodal(false);
setischecked(false);
} }, "\u6211\u518D\u60F3\u60F3"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { onClick: () => {
answerData.exercise_question_types[oneindex].items[twoindex].ques_status = 1;
setAnswerData(Answer_spreadValues({}, answerData));
if (switchType.current === "prev") {
if (twoindex === 0) {
oneindex -= 1;
twoindex = answerData.exercise_question_types[oneindex].items.length - 1;
} else {
twoindex -= 1;
}
setoneindex(oneindex);
settwoindex(twoindex);
} else if (switchType.current === "next") {
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(switchData.current.oneindex);
settwoindex(switchData.current.twoindex);
}
setisshowmodal(false);
}, type: "primary", style: { marginLeft: 30 } }, "\u786E\u8BA4"))))
), /* @__PURE__ */ _react_17_0_2_react.createElement(Unlock/* default */.Z, { successCb: checkCamera })), showCamera && /* @__PURE__ */ _react_17_0_2_react.createElement(
(cjs_default()),
{
disabled,
bounds,
onStart: (event, uiData) => onStart(event, uiData)
},
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { ref: draggleRef, style: { position: "absolute", left: 40, top: 200, zIndex: 101 } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
"div",
{
onMouseOver: () => {
if (disabled) {
setDisabled(false);
}
},
onMouseOut: () => {
setDisabled(true);
}
},
/* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { className: Answermodules.cameraHeader, align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-kaiqishexiangtou" }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5DF2\u5F00\u542F\u6444\u50CF\u5934")), isopen ? /* @__PURE__ */ _react_17_0_2_react.createElement(MinusOutlined/* default */.Z, { onClick: () => {
setisopen(false);
} }) : /* @__PURE__ */ _react_17_0_2_react.createElement(PlusOutlined/* default */.Z, { onClick: () => {
setisopen(true);
} })),
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { display: isopen ? "flex" : "none" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
CaptureVideo/* default */.Z,
{
number: ((_R = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _R.photo_count) - ((_S = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _S.take_photo),
take_photo: (_T = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _T.take_photo,
ref: captureRef,
time: (_U = answerData.exercise) == null ? void 0 : _U.left_time,
update: initData,
supportCamera: (type) => {
if (type === 2) {
setOpenCameraSuccess(true);
setStartRecording(answerCheckData == null ? void 0 : answerCheckData.screen_shot_open);
if (!(answerCheckData == null ? void 0 : answerCheckData.screen_shot_open)) {
setOpenFullScreen(answerCheckData == null ? void 0 : answerCheckData.screen_open);
initData();
}
} else if (type === 1) {
setTimeout(() => _umi_production_exports.history.push("/"), 3e3);
}
}
}
))
))
), /* @__PURE__ */ _react_17_0_2_react.createElement(
es_modal["default"],
{
destroyOnClose: true,
closable: false,
centered: true,
className: Answermodules.teachAnalysisModal,
title: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "space-between" }, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { style: { color: "rgba(0,0,0,0.9)", fontSize: "16px" } }, "\u6559\u5E08\u8BC4\u4EF7"), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement("i", { className: "iconfont icon-guanbi7", style: { fontSize: "15px", cursor: "pointer" }, onClick: () => setTeachAnalysisModal(false) }))),
open: teachAnalysisModal,
footer: false,
onCancel: () => setTeachAnalysisModal(false)
},
(_V = answerData == null ? void 0 : answerData.exercise_answer_user) == null ? void 0 : _V.analysis
));
};
/* harmony default export */ var Exercise_Answer = ((0,_umi_production_exports.connect)(
({
loading,
user,
exercise,
globalSetting
}) => ({
globalSetting,
user,
exercise,
loading: loading.effects
})
)(Answer));
/***/ }),
/***/ 55112:
/*!*******************************************************************!*\
!*** ./src/pages/Classrooms/Lists/Exercise/components/Unlock.tsx ***!
\*******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 31797);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 78241);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! antd */ 43418);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! antd */ 72315);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! antd */ 1056);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! antd */ 95237);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! antd */ 43604);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! antd */ 3113);
/* harmony import */ var _service_exercise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/service/exercise */ 32801);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment */ 9498);
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! umi */ 23175);
/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/util */ 19234);
/* harmony import */ var _components_Exercise_ip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/Exercise/ip */ 3474);
/* harmony import */ var _utils_authority__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/authority */ 69740);
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
const { Countdown } = antd__WEBPACK_IMPORTED_MODULE_7__["default"];
const Unlock = ({ exercise, successCb, dispatch }) => {
var _a, _b, _c, _d;
const params = (0,umi__WEBPACK_IMPORTED_MODULE_3__.useParams)();
const [form] = antd__WEBPACK_IMPORTED_MODULE_8__["default"].useForm();
const [isLoading, setIsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
const localIpRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
const { actionTabs } = exercise;
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (exercise.actionTabs.key === "student-unlock") {
setIsLoading(false);
form.resetFields();
}
}, [exercise.actionTabs.key]);
const getLocalIp = () => {
return new Promise((resolve) => __async(void 0, null, function* () {
var _a2, _b2, _c2;
localIpRef.current = yield (0,_components_Exercise_ip__WEBPACK_IMPORTED_MODULE_5__/* .findLocalIp */ .y)({ ip_limit: (_a2 = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _a2.ip_limit, ip_bind: (_b2 = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _b2.ip_bind, ip_bind_type: (_c2 = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _c2.ip_bind_type });
return resolve();
}));
};
const handleOk = () => __async(void 0, null, function* () {
var _a2, _b2, _c2, _d2, _e, _f, _g;
yield form.validateFields();
const formValue = form.getFieldsValue();
setIsLoading(true);
if (((_a2 = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _a2.ip_limit) !== "no" || ((_b2 = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _b2.ip_bind))
yield getLocalIp();
const unlockRes = yield (0,_service_exercise__WEBPACK_IMPORTED_MODULE_1__/* .unlockUser */ .ZD)((_c2 = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _c2.id, { exercise_user_id: (_d2 = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _d2.exercise_user_id, unlock_key: formValue.unlock_key, ip: localIpRef.current });
if (unlockRes.status === 0) {
if (successCb) {
dispatch({
type: "exercise/setActionTabs",
payload: {}
});
successCb();
return;
}
if (formValue.time) {
const delayedParams = {
time: moment__WEBPACK_IMPORTED_MODULE_2___default()(formValue.time).format("YYYY-MM-DD HH:mm"),
exercise_user_id: (_e = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _e.exercise_user_id,
id: (_f = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _f.id
};
yield (0,_service_exercise__WEBPACK_IMPORTED_MODULE_1__/* .delayedTime */ .qz)(delayedParams);
}
const v = actionTabs == null ? void 0 : actionTabs.exerciseParams;
(0,_utils_util__WEBPACK_IMPORTED_MODULE_4__/* .startExercise */ .nr)({
inner_ip: v.inner_ip,
public_ip: v.public_ip,
open_camera: v.open_camera,
ip_limit: v.ip_limit,
ip_bind: v.ip_bind,
ip_bind_type: v.ip_bind_type,
exercise_tips: v.exercise_tips,
exerciseId: v.id,
screen_open: v.screen_open,
screen_num: v.screen_num,
screen_sec: v.screen_sec,
coursesId: params.coursesId,
login: (_g = (0,_utils_authority__WEBPACK_IMPORTED_MODULE_6__/* .userInfo */ .eY)()) == null ? void 0 : _g.login,
history,
identity_verify: v.identity_verify,
open_phone_video_recording: v.open_phone_video_recording,
current_status: v.current_status
});
dispatch({
type: "exercise/setActionTabs",
payload: {}
});
}
setIsLoading(false);
});
const columns = [
{
title: "IP\u5730\u5740",
dataIndex: "ip",
key: "ip",
render: (text) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: text.indexOf("\u5F02\u5E38") > -1 ? "c-red" : "c-green" }, text)
},
{
title: "\u6D4F\u89C8\u5668",
dataIndex: "browser",
key: "browser",
render: (text) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: text.indexOf("\u5F02\u5E38") > -1 ? "c-red" : "c-green" }, text)
},
{
title: "\u4E0A\u6B21\u767B\u5F55\u65F6\u95F4",
dataIndex: "last_login_time",
key: "last_login_time"
}
];
const hasError5 = ((_a = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _a.errorMessage) && typeof ((_b = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _b.errorMessage) === "object";
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
antd__WEBPACK_IMPORTED_MODULE_9__["default"],
{
width: 514,
centered: true,
closable: !!((_c = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _c.unlockClose),
maskClosable: false,
keyboard: false,
maskStyle: { background: "#000" },
title: "\u63D0\u793A",
open: exercise.actionTabs.key === "student-unlock",
footer: null,
onCancel: () => {
dispatch({
type: "exercise/setActionTabs",
payload: {}
});
}
},
hasError5 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { marginBottom: 16 } }, "\u8BE5\u8D26\u53F7\u5DF2\u7ECF\u5B58\u5728\u5F02\u5E38\u60C5\u51B5\uFF0C\u82E5\u975E\u672C\u4EBA\u64CD\u4F5C\uFF0C\u8BF7\u8054\u7CFB\u76D1\u8003\u8001\u5E08\u8BF4\u660E\u60C5\u51B5\u3002 "),
!hasError5 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { style: { marginBottom: 16 } }, "\u7CFB\u7EDF\u68C0\u6D4B\u5230\u60A8\u5728\u8003\u8BD5\u65F6\u4E2D\u9014\u9000\u51FA\uFF0C\u73B0\u5DF2\u5C06\u8003\u8BD5\u9501\u5B9A\u3002\u5982\u9700\u7EE7\u7EED\u8FDB\u884C\u8003\u8BD5\uFF0C \u8BF7\u5C3D\u5FEB\u8054\u7CFB\u8BFE\u5802\u8001\u5E08\u8FDB\u884C\u89E3\u9501\uFF01"),
hasError5 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_10__["default"], { className: "mb20", pagination: { hideOnSinglePage: true }, dataSource: [((_d = actionTabs == null ? void 0 : actionTabs.exerciseParams) == null ? void 0 : _d.errorMessage) || {}], columns }),
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
antd__WEBPACK_IMPORTED_MODULE_8__["default"],
{
form,
layout: "vertical",
autoComplete: "off"
},
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__["default"].Item, { label: "\u8003\u8BD5\u89E3\u9501\u7801", name: "unlock_key", rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u8003\u8BD5\u89E3\u9501\u7801" }] }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_11__["default"].Password, { autoComplete: "off", placeholder: "\u8BF7\u8F93\u5165\u8003\u8BD5\u89E3\u9501\u7801", visibilityToggle: false }))
)),
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z, { justify: "space-between", align: "middle" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, null), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_13__/* ["default"] */ .Z, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_14__/* ["default"] */ .ZP, { loading: isLoading, onClick: handleOk }, "\u8FDB\u5165\u8003\u8BD5")))
));
};
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_3__.connect)(
({ exercise }) => ({
exercise
})
)(Unlock));
/***/ }),
/***/ 52305:
/*!********************************************!*\
!*** ./src/utils/hooks/useRemindModal.tsx ***!
\********************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ _: function() { return /* binding */ useRemindModal; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd */ 43418);
const useRemindModal = (answerData) => {
var _a, _b;
const countDownRefArr = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)([]);
const clearCountdownTimeout = () => {
for (const id of countDownRefArr.current) {
clearTimeout(id);
}
countDownRefArr.current = [];
};
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
var _a2, _b2, _c, _d, _e, _f;
clearCountdownTimeout();
if (((_a2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a2.left_time) && ((_c = (_b2 = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b2.exercise_events) == null ? void 0 : _c.length) > 0) {
for (const eventItem of (_d = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _d.exercise_events) {
if (((_e = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _e.left_time) > (eventItem == null ? void 0 : eventItem.reminder_time) * 60) {
const timeoutId = setTimeout(() => {
antd__WEBPACK_IMPORTED_MODULE_1__["default"].info({
content: `${eventItem == null ? void 0 : eventItem.reminder_content}`,
icon: null,
title: "\u63D0\u793A",
centered: true,
okText: "\u77E5\u9053\u4E86"
});
}, (((_f = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _f.left_time) - (eventItem == null ? void 0 : eventItem.reminder_time) * 60) * 1e3);
countDownRefArr.current.push(timeoutId);
}
}
}
}, [(_a = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _a.left_time, (_b = answerData == null ? void 0 : answerData.exercise) == null ? void 0 : _b.exercise_events]);
return clearCountdownTimeout;
};
/***/ })
}]);