|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[14889],{
|
|
|
|
|
|
/***/ 3148:
|
|
|
/*!*******************************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_ExclamationCircleOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.25.0@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(81978);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(1393);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/ExclamationCircleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_ExclamationCircleOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_ExclamationCircleOutlined = (RefIcon);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 80511:
|
|
|
/*!*********************************************************************************!*\
|
|
|
!*** ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/index.tsx + 8 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 */ ImitateAnswer; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(82242);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(86882);
|
|
|
// 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/input/index.js + 5 modules
|
|
|
var input = __webpack_require__(24650);
|
|
|
// 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/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/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/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/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
|
var spin = __webpack_require__(71418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/MinusSquareOutlined.js + 1 modules
|
|
|
var MinusSquareOutlined = __webpack_require__(72311);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/PlusSquareOutlined.js + 1 modules
|
|
|
var PlusSquareOutlined = __webpack_require__(60765);
|
|
|
// EXTERNAL MODULE: ./src/components/Exercise/recordScreen.tsx + 3 modules
|
|
|
var recordScreen = __webpack_require__(320);
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.12@dayjs/dayjs.min.js
|
|
|
var dayjs_min = __webpack_require__(17810);
|
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var ImitateAnswermodules = ({"flex_box_center":"flex_box_center___MzHUI","flex_space_between":"flex_space_between___ZPKmx","flex_box_vertical_center":"flex_box_vertical_center___MNo4n","flex_box_center_end":"flex_box_center_end___stoyX","flex_box_column":"flex_box_column___HR6oq","baseMargin":"baseMargin___V_l7f","noWrap":"noWrap___ZcvYB","singleItem":"singleItem___vjYWR","questionIcons":"questionIcons___kiVRR","green":"green___PIOSW","orange":"orange___aGI_B","greenTip":"greenTip___bShpb","redTip":"redTip___wCm4Z","orangeTip":"orangeTip___HRBLJ","pollDesc":"pollDesc___SxQ7V","answered":"answered___e5zk4","unanswer":"unanswer___dEmC8","anchor":"anchor___xdS4e","answerFlag":"answerFlag____R2kw","flagActive":"flagActive___hkk6X","flagHalf":"flagHalf___ZgZyz","answerStudentFlag":"answerStudentFlag___RlIwt","answerStudentActive":"answerStudentActive___pQpEA","questionItem":"questionItem___Yg7y3","questionScore":"questionScore___hGLaV","itemFlag":"itemFlag___KI4Jb","answerWrap":"answerWrap___CETMI","answerSubjective":"answerSubjective____A1OC","otherInput":"otherInput___hanjt","randomFlag":"randomFlag___mId_V","answerTrue":"answerTrue___QzQ9o","answerFalse":"answerFalse____K4Me","answerHalf":"answerHalf___gnzWI","renderHtml":"renderHtml___dDhM4","simpleText":"simpleText___kJ0Kc","answerYes":"answerYes___btoYt","answerNo":"answerNo___aNG_f","answerInfo":"answerInfo___af0Ma","answerProgress":"answerProgress___h6he7","answerSheetWrap":"answerSheetWrap___qVk_a","answerSheetQuestionTitle":"answerSheetQuestionTitle___YqJ8X","answerSheet":"answerSheet___ojXFi","answerSheetItem":"answerSheetItem___coR9L","qindex":"qindex___Fx51y","active":"active___KmAlt","partialActive":"partialActive___UsoA4","selected":"selected___QBbv4","answerSheetBottom":"answerSheetBottom___Lh0Ny","countDown":"countDown___W4ClT","red":"red___RSej4","fold":"fold___pujAY","cardList":"cardList___Bd4OZ","iframe":"iframe___kQjBw","mainPart":"mainPart___aRRl1","tooltipWrap":"tooltipWrap___FJod3","leftPart":"leftPart___f5dDH","rightPart":"rightPart___M7fOP","questionPart":"questionPart___HlX7z","questionTypeTitle":"questionTypeTitle___RRn2_","questionTypeInfo":"questionTypeInfo___a3Iny","toIframeBtn":"toIframeBtn___PH9eF","bottom":"bottom___slps3","changeButton":"changeButton___YjNWr","prevBtn":"prevBtn___NeeAj","fixHeader":"fixHeader___Jjypd","title":"title___h5yRx","submitButton":"submitButton___ATddm","dottedLineWrapper":"dottedLineWrapper___RxpC7","leftHalfCircle":"leftHalfCircle___McsYA","dottedLine":"dottedLine___cwiMH","rightHalfCircle":"rightHalfCircle___sP0Ln"});
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(62554);
|
|
|
// EXTERNAL MODULE: ./src/utils/authority.ts
|
|
|
var authority = __webpack_require__(47428);
|
|
|
// EXTERNAL MODULE: ./src/utils/fullscreen.ts
|
|
|
var fullscreen = __webpack_require__(74025);
|
|
|
// EXTERNAL MODULE: ./src/service/exercise.ts
|
|
|
var exercise = __webpack_require__(3175);
|
|
|
// EXTERNAL MODULE: ./src/service/shixuns.ts
|
|
|
var shixuns = __webpack_require__(98294);
|
|
|
// EXTERNAL MODULE: ./src/components/RenderHtml/index.tsx
|
|
|
var RenderHtml = __webpack_require__(53565);
|
|
|
// EXTERNAL MODULE: ./src/components/markdown-editor/index.tsx + 9 modules
|
|
|
var markdown_editor = __webpack_require__(75053);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Simple.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Simple = function Simple(_ref) {
|
|
|
var _answerData$exercise, _item$user_answer, _item$user_answer2, _item$user_answer4, _item$standard_answer;
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData,
|
|
|
_ref$onBlur = _ref.onBlur,
|
|
|
_onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
value = _useState2[0],
|
|
|
setValue = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isShow = _useState4[0],
|
|
|
setIsShow = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
showEditor = _useState6[0],
|
|
|
setShowEditor = _useState6[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setIsShow(item === null || item === void 0 ? void 0 : item.a_flag);
|
|
|
}, [item === null || item === void 0 ? void 0 : item.a_flag]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [(answerData === null || answerData === void 0 || (_answerData$exercise = answerData.exercise) === null || _answerData$exercise === void 0 ? void 0 : _answerData$exercise.commit_status) === 1 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "mt10 mb0",
|
|
|
children: "\u6211\u7684\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ImitateAnswermodules.simpleText,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 || (_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer[0]
|
|
|
})
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: item.user_score && (item.user_score === item.question_score ? "c-green" : "c-red"),
|
|
|
children: showEditor ? /*#__PURE__*/(0,jsx_runtime.jsx)(markdown_editor/* default */.Z, {
|
|
|
height: 450,
|
|
|
isFocus: true,
|
|
|
defaultValue: item === null || item === void 0 || (_item$user_answer2 = item.user_answer) === null || _item$user_answer2 === void 0 ? void 0 : _item$user_answer2[0],
|
|
|
id: item === null || item === void 0 ? void 0 : item.question_id,
|
|
|
onChange: function onChange(value) {
|
|
|
return setValue(value);
|
|
|
},
|
|
|
onBlur: function onBlur() {
|
|
|
return _onBlur(value);
|
|
|
}
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
onClick: function onClick() {
|
|
|
var _item$user_answer3;
|
|
|
if (!item.repeat_answer && (item === null || item === void 0 || (_item$user_answer3 = item.user_answer) === null || _item$user_answer3 === void 0 ? void 0 : _item$user_answer3.length) > 0) {
|
|
|
return;
|
|
|
}
|
|
|
setShowEditor(true);
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
disabled: !item.repeat_answer && (item === null || item === void 0 || (_item$user_answer4 = item.user_answer) === null || _item$user_answer4 === void 0 ? void 0 : _item$user_answer4.length) > 0 && !item.israp,
|
|
|
size: 'middle',
|
|
|
className: "current",
|
|
|
placeholder: "\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54",
|
|
|
readOnly: true
|
|
|
})
|
|
|
})
|
|
|
}), (item === null || item === void 0 ? void 0 : item.standard_answer) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "mt10 mb0",
|
|
|
children: "\u53C2\u8003\u7B54\u6848\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
border: "1px solid #eee",
|
|
|
background: "#f5f5f5",
|
|
|
borderRadius: 4,
|
|
|
padding: 5
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 || (_item$standard_answer = item.standard_answer) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer[0]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_Simple = (Simple);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@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__(51945);
|
|
|
// EXTERNAL MODULE: ./src/components/monaco-editor/index.jsx + 3 modules
|
|
|
var monaco_editor = __webpack_require__(20384);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var componentsmodules = ({"flex_box_center":"flex_box_center___NzoJU","flex_space_between":"flex_space_between___Hwix8","flex_box_vertical_center":"flex_box_vertical_center___IjC7Y","flex_box_center_end":"flex_box_center_end___HmCsd","flex_box_column":"flex_box_column___hOf25","shixunWrp":"shixunWrp___yZiPI","fill":"fill___gz7tU","index":"index___eoHnJ","success":"success___vcRmo","fail":"fail___u5yz8","fillInput":"fillInput___ras_5","shixunWrapper":"shixunWrapper___jNj55","score":"score___gt155","name":"name___BgNAP","programWrapper":"programWrapper___lMcxv","desc":"desc___ODeOH","content":"content___RoL0o"});
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Shixun.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Shixun = function Shixun(_ref) {
|
|
|
var _answerData$exercise, _answerData$exercise2, _answerData$exercise3, _item$shixun;
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
challengeData = _useState4[0],
|
|
|
setChallengeData = _useState4[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _item$shixun_details;
|
|
|
if (!(item !== null && item !== void 0 && (_item$shixun_details = item.shixun_details) !== null && _item$shixun_details !== void 0 && _item$shixun_details.length)) {
|
|
|
return;
|
|
|
}
|
|
|
var shixun = [];
|
|
|
var challenge = [];
|
|
|
for (var i = 0; i < (item === null || item === void 0 || (_item$shixun_details2 = item.shixun_details) === null || _item$shixun_details2 === void 0 ? void 0 : _item$shixun_details2.length); i++) {
|
|
|
var _item$shixun_details2, _item$shixun_details4;
|
|
|
for (var j = 0; j < (item === null || item === void 0 ? void 0 : item.shixun_details[i].stage_list.length); j++) {
|
|
|
var _item$shixun_details3;
|
|
|
var shixunItem = item === null || item === void 0 ? void 0 : item.shixun_details[i].stage_list[j];
|
|
|
shixun.push(objectSpread2_default()(objectSpread2_default()({}, shixunItem), {
|
|
|
operation: item === null || item === void 0 || (_item$shixun_details3 = item.shixun_details) === null || _item$shixun_details3 === void 0 || (_item$shixun_details3 = _item$shixun_details3[i]) === null || _item$shixun_details3 === void 0 || (_item$shixun_details3 = _item$shixun_details3.shixun_detail) === null || _item$shixun_details3 === void 0 || (_item$shixun_details3 = _item$shixun_details3[0]) === null || _item$shixun_details3 === void 0 ? void 0 : _item$shixun_details3.game_identifier
|
|
|
}));
|
|
|
}
|
|
|
if (item !== null && item !== void 0 && (_item$shixun_details4 = item.shixun_details) !== null && _item$shixun_details4 !== void 0 && (_item$shixun_details4 = _item$shixun_details4[i]) !== null && _item$shixun_details4 !== void 0 && _item$shixun_details4.shixun_detail) {
|
|
|
var _item$shixun_details5;
|
|
|
challenge.push(item === null || item === void 0 || (_item$shixun_details5 = item.shixun_details) === null || _item$shixun_details5 === void 0 || (_item$shixun_details5 = _item$shixun_details5[i]) === null || _item$shixun_details5 === void 0 || (_item$shixun_details5 = _item$shixun_details5.shixun_detail) === null || _item$shixun_details5 === void 0 ? void 0 : _item$shixun_details5[0]);
|
|
|
}
|
|
|
}
|
|
|
setChallengeData(challenge);
|
|
|
setData(shixun);
|
|
|
}, [item === null || item === void 0 ? void 0 : item.shixun_details]);
|
|
|
var columns = [{
|
|
|
title: "关卡",
|
|
|
dataIndex: "position",
|
|
|
key: "position",
|
|
|
align: 'center'
|
|
|
}, {
|
|
|
title: "任务名称",
|
|
|
dataIndex: "name",
|
|
|
key: "name",
|
|
|
align: 'center',
|
|
|
render: function render(name) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "overflowHidden1",
|
|
|
style: {
|
|
|
maxWidth: "400px"
|
|
|
},
|
|
|
title: name && name.length > 25 ? name : "",
|
|
|
children: name
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "评测次数",
|
|
|
dataIndex: "evaluate_count",
|
|
|
key: "evaluate_count",
|
|
|
align: 'center',
|
|
|
render: function render(testCount, item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: item.evaluate_count ? item.evaluate_count : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "color-grey-9",
|
|
|
children: "--"
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "完成时间",
|
|
|
key: "endTime",
|
|
|
dataIndex: "endTime",
|
|
|
align: 'center',
|
|
|
render: function render(endTime, item) {
|
|
|
var timeOver = false;
|
|
|
if (item.finished_time && answerData !== null && answerData !== void 0 && answerData.exercise && answerData !== null && answerData !== void 0 && answerData.exercise_answer_user) {
|
|
|
// issue#29511 exercise.time -1没有设置答题的时间限制,则比较完成时间和试卷截至时间
|
|
|
if ((answerData === null || answerData === void 0 ? void 0 : answerData.exercise.time) === -1) {
|
|
|
timeOver = dayjs_min_default()(answerData === null || answerData === void 0 ? void 0 : answerData.exercise.end_time).isBefore(item.finished_time);
|
|
|
} else {
|
|
|
timeOver = dayjs_min_default()(answerData === null || answerData === void 0 ? void 0 : answerData.exercise_answer_user.start_at).add(answerData === null || answerData === void 0 ? void 0 : answerData.exercise.time, "m").isBefore(item.finished_time);
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [item.finished_time || /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-999",
|
|
|
children: "--"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-orange-ff9 ",
|
|
|
children: timeOver ? "(已超时)" : ""
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "耗时",
|
|
|
dataIndex: "time_consuming",
|
|
|
key: "time_consuming",
|
|
|
align: 'center',
|
|
|
render: function render(time, item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: item.time_consuming || /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "color-grey-9",
|
|
|
children: "--"
|
|
|
})
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: "查看答案",
|
|
|
dataIndex: "view_answer",
|
|
|
key: "view_answer",
|
|
|
align: 'center',
|
|
|
render: function render(exp, item) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: item.view_answer ? "已查看" : "未查看"
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
// {
|
|
|
// title: "经验值",
|
|
|
// dataIndex: "experience",
|
|
|
// key: "experience",
|
|
|
// align: 'center',
|
|
|
// render: (exp: any, item: any) => {
|
|
|
// return (
|
|
|
// <span>
|
|
|
// <span className="c-green">{item.myself_experience}</span>/
|
|
|
// {item.experience}
|
|
|
// </span>
|
|
|
// );
|
|
|
// },
|
|
|
// },
|
|
|
{
|
|
|
title: "操作",
|
|
|
dataIndex: "operation",
|
|
|
key: "operation",
|
|
|
align: 'center',
|
|
|
render: function render(value, data, index) {
|
|
|
return item.is_jupyter_lab || item.is_jupyter ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-999",
|
|
|
children: "--"
|
|
|
}) : value ? /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default */.Z, {
|
|
|
affix: false,
|
|
|
className: "mt10",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_anchor/* default */.Z.Link, {
|
|
|
href: "#challenge_".concat(item === null || item === void 0 ? void 0 : item.question_id).concat(index),
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#0152d9'
|
|
|
},
|
|
|
children: "\u67E5\u770B"
|
|
|
})
|
|
|
})
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-grey-999",
|
|
|
children: "--"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var outputColumns = [{
|
|
|
title: '评测次数',
|
|
|
dataIndex: 'key',
|
|
|
width: "127px",
|
|
|
key: 'key',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: record.key
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '详细信息',
|
|
|
dataIndex: 'error_msg',
|
|
|
key: 'error_msg',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: record.error_msg ? record.error_msg : "--"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var options = {
|
|
|
selectOnLineNumbers: true,
|
|
|
readOnly: true,
|
|
|
minimap: {
|
|
|
enabled: false
|
|
|
},
|
|
|
scrollBeyondLastLine: false
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: componentsmodules.shixunWrapper,
|
|
|
children: [(answerData === null || answerData === void 0 || (_answerData$exercise = answerData.exercise) === null || _answerData$exercise === void 0 ? void 0 : _answerData$exercise.commit_status) === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: item.shixun.map(function (val, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "mb20",
|
|
|
justify: "space-between",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: 1,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: componentsmodules.score,
|
|
|
children: ["(", val.challenge_score, "\u5206)"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: componentsmodules.name,
|
|
|
children: [val.challenge_name, " "]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
children: [val.answer_status === 0 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "font14",
|
|
|
style: {
|
|
|
color: '#FA6400'
|
|
|
},
|
|
|
children: "\u672A\u5B8C\u6210"
|
|
|
}), val.answer_status === 1 && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "font14",
|
|
|
style: {
|
|
|
color: '#37AD83'
|
|
|
},
|
|
|
children: "\u5DF2\u5B8C\u6210"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
})
|
|
|
}), (answerData === null || answerData === void 0 || (_answerData$exercise2 = answerData.exercise) === null || _answerData$exercise2 === void 0 ? void 0 : _answerData$exercise2.commit_status) !== 0 || (answerData === null || answerData === void 0 || (_answerData$exercise3 = answerData.exercise) === null || _answerData$exercise3 === void 0 ? void 0 : _answerData$exercise3.user_exercise_status) !== 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [!!(data !== null && data !== void 0 && data.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "font16 c-grey-666",
|
|
|
children: "\u9636\u6BB5\u6210\u7EE9"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
|
|
|
columns: columns,
|
|
|
dataSource: data,
|
|
|
pagination: false
|
|
|
})]
|
|
|
}), !!(challengeData !== null && challengeData !== void 0 && challengeData.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: "font16 c-grey-666 mt10",
|
|
|
children: "\u5B9E\u8BAD\u8BE6\u60C5"
|
|
|
}), challengeData === null || challengeData === void 0 ? void 0 : challengeData.map(function (chanllenge, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
id: "challenge_".concat(item === null || item === void 0 ? void 0 : item.question_id).concat(index),
|
|
|
className: "mt5",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "font16 mr15",
|
|
|
children: [" \u7B2C", chanllenge.position, "\u5173"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
className: "current c-black font16",
|
|
|
to: "/tasks/".concat(chanllenge.game_identifier),
|
|
|
children: chanllenge.name
|
|
|
})]
|
|
|
}), (chanllenge === null || chanllenge === void 0 ? void 0 : chanllenge.st) === 0 && chanllenge.passed_code && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: componentsmodules.shixunWrp,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("h2", {
|
|
|
children: ["\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-light-black",
|
|
|
children: chanllenge.path
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
|
|
|
height: 300,
|
|
|
language: "python",
|
|
|
theme: "default",
|
|
|
value: chanllenge.passed_code,
|
|
|
options: options
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
})]
|
|
|
})]
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: "c-grey-999 mt20 mb20",
|
|
|
value: item === null || item === void 0 ? void 0 : item.question_title
|
|
|
}), item === null || item === void 0 || (_item$shixun = item.shixun) === null || _item$shixun === void 0 ? void 0 : _item$shixun.map(function (shixun, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
className: "font16 c-grey-666 mb5",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "mr20",
|
|
|
children: ["\u7B2C", shixun === null || shixun === void 0 ? void 0 : shixun.challenge_position, "\u5173 ", shixun === null || shixun === void 0 ? void 0 : shixun.challenge_name]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [shixun === null || shixun === void 0 ? void 0 : shixun.challenge_score, "\u5206"]
|
|
|
})]
|
|
|
}, index);
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_Shixun = (Shixun);
|
|
|
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
|
|
|
var base64 = __webpack_require__(24334);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Program.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Program = function Program(_ref) {
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
data = _useState2[0],
|
|
|
setData = _useState2[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _item$evaluate_codes;
|
|
|
if ((item === null || item === void 0 || (_item$evaluate_codes = item.evaluate_codes) === null || _item$evaluate_codes === void 0 ? void 0 : _item$evaluate_codes.length) > 0) {
|
|
|
var _item$evaluate_codes2;
|
|
|
setData(item === null || item === void 0 || (_item$evaluate_codes2 = item.evaluate_codes) === null || _item$evaluate_codes2 === void 0 ? void 0 : _item$evaluate_codes2.map(function (code, index) {
|
|
|
return {
|
|
|
key: index + 1,
|
|
|
error_msg: code !== null && code !== void 0 && code.error_msg ? base64.Base64.decode(code === null || code === void 0 ? void 0 : code.error_msg) : ''
|
|
|
};
|
|
|
}));
|
|
|
} else {
|
|
|
setData([{
|
|
|
key: "--",
|
|
|
error_msg: "--"
|
|
|
}]);
|
|
|
}
|
|
|
}, [item === null || item === void 0 ? void 0 : item.evaluate_codes]);
|
|
|
var columns = [{
|
|
|
title: '评测次数',
|
|
|
dataIndex: 'key',
|
|
|
width: "127px",
|
|
|
key: 'key',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: record.key
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
title: '详细信息',
|
|
|
dataIndex: 'error_msg',
|
|
|
key: 'error_msg',
|
|
|
align: 'center',
|
|
|
render: function render(text, record) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: record.error_msg ? record.error_msg : "--"
|
|
|
});
|
|
|
}
|
|
|
}];
|
|
|
var options = {
|
|
|
selectOnLineNumbers: true,
|
|
|
readOnly: true,
|
|
|
minimap: {
|
|
|
enabled: false
|
|
|
},
|
|
|
scrollBeyondLastLine: false
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(componentsmodules.programWrapper),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: componentsmodules.desc,
|
|
|
children: "\u9898\u76EE\u63CF\u8FF0"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: componentsmodules.content,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.description
|
|
|
})
|
|
|
}), !!(item !== null && item !== void 0 && item.user_answer.length) && (item === null || item === void 0 ? void 0 : item.passed_code) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: componentsmodules.shixunWrp,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h3", {
|
|
|
children: "\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(monaco_editor/* default */.ZP, {
|
|
|
style: {
|
|
|
border: '1px solid #ccc'
|
|
|
},
|
|
|
height: 300,
|
|
|
language: "python",
|
|
|
theme: "vs-light",
|
|
|
value: item !== null && item !== void 0 && item.passed_code ? base64.Base64.decode(item === null || item === void 0 ? void 0 : item.passed_code) : "",
|
|
|
options: options
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_Program = (Program);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(37205);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./src/components/MathsLatexKeybords/index.tsx
|
|
|
var MathsLatexKeybords = __webpack_require__(84256);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/Fill.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TextArea = input/* default */.Z.TextArea;
|
|
|
var Fill = function Fill(_ref) {
|
|
|
var _item$standard_answer2, _item$standard_answer3;
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData,
|
|
|
_ref$onBlur = _ref.onBlur,
|
|
|
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
userAnswer = _useState2[0],
|
|
|
setUserAnswer = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
saveStatusArr = _useState4[0],
|
|
|
setSaveStatusArr = _useState4[1];
|
|
|
var saveStatusArrs = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
|
// useEffect(() => {
|
|
|
// const data: any = [];
|
|
|
// for (let i = 0; i < item?.multi_count; i++) {
|
|
|
// const param = item?.user_answer?.find((e: any) => e.choice_id === i + 1) || {
|
|
|
// choice_id: i + 1,
|
|
|
// answer_text: ''
|
|
|
// };
|
|
|
// data.push({ ...param });
|
|
|
// }
|
|
|
|
|
|
// setUserAnswer(data);
|
|
|
// }, [item?.user_answer])
|
|
|
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _item$standard_answer;
|
|
|
// const data: any = [];
|
|
|
// for (let i = 0; i < item?.multi_count; i++) {
|
|
|
// const param = item?.user_answer?.find((e: any) => e.choice_id === i + 1) || {
|
|
|
// choice_id: i + 1,
|
|
|
// answer_text: ''
|
|
|
// };
|
|
|
// data.push({ ...param });
|
|
|
// }
|
|
|
|
|
|
var data = [];
|
|
|
data = item === null || item === void 0 || (_item$standard_answer = item.standard_answers) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer.map(function (val) {
|
|
|
var _item$user_answer;
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, val), {}, {
|
|
|
choice_id: val.position,
|
|
|
answer_text: (item === null || item === void 0 || (_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 || (_item$user_answer = _item$user_answer.find(function (e) {
|
|
|
return e.choice_id === val.choice_id;
|
|
|
})) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer.answer_text) || ''
|
|
|
});
|
|
|
});
|
|
|
setUserAnswer(data);
|
|
|
}, [item === null || item === void 0 ? void 0 : item.user_answer]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [userAnswer === null || userAnswer === void 0 ? void 0 : userAnswer.map(function (answer, index) {
|
|
|
var _item$user_answer2, _saveStatusArr$index, _saveStatusArr$index2, _saveStatusArr$index3;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: "".concat(componentsmodules.baseMargin, " ").concat(componentsmodules.fill),
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: componentsmodules.index,
|
|
|
children: ["\u586B\u7A7A\u9879", index + 1]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: '430px',
|
|
|
className: "ml20 mr20",
|
|
|
children: (answer === null || answer === void 0 ? void 0 : answer.model) === 1 ? /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u7B54\u6848",
|
|
|
disabled: !item.repeat_answer && (item === null || item === void 0 || (_item$user_answer2 = item.user_answer) === null || _item$user_answer2 === void 0 ? void 0 : _item$user_answer2.length) > 0 && !item.israp || !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text,
|
|
|
onChange: function onChange(e) {
|
|
|
userAnswer[index].answer_text = e.target.value;
|
|
|
setUserAnswer(toConsumableArray_default()(userAnswer));
|
|
|
},
|
|
|
onBlur: ( /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e) {
|
|
|
var res, newArr, _newArr;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return onBlur(answer === null || answer === void 0 ? void 0 : answer.answer_text, index + 1, userAnswer);
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
newArr = saveStatusArr.slice();
|
|
|
newArr[index] = {
|
|
|
status: 'success',
|
|
|
errorText: ''
|
|
|
};
|
|
|
saveStatusArrs.current = newArr;
|
|
|
setSaveStatusArr(newArr);
|
|
|
} else {
|
|
|
_newArr = saveStatusArr.slice();
|
|
|
_newArr[index] = {
|
|
|
status: 'fail',
|
|
|
errorText: res.message
|
|
|
};
|
|
|
saveStatusArrs.current = _newArr;
|
|
|
setSaveStatusArr(_newArr);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
className: "".concat(item.user_score && (item.user_score === item.question_score ? "c-green" : "c-red"), " ").concat(componentsmodules.fillInput)
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(MathsLatexKeybords/* default */.Z, {
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text,
|
|
|
onChange: ( /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(e) {
|
|
|
var res, _saveStatusArrs$curre, newArr, _saveStatusArrs$curre2, _newArr2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
userAnswer[index].answer_text = e;
|
|
|
setUserAnswer(toConsumableArray_default()(userAnswer));
|
|
|
_context2.next = 4;
|
|
|
return onBlur(e, index + 1, userAnswer);
|
|
|
case 4:
|
|
|
res = _context2.sent;
|
|
|
if (!res.status) {
|
|
|
newArr = (saveStatusArrs === null || saveStatusArrs === void 0 || (_saveStatusArrs$curre = saveStatusArrs.current) === null || _saveStatusArrs$curre === void 0 ? void 0 : _saveStatusArrs$curre.slice()) || [].slice();
|
|
|
newArr[index] = {
|
|
|
status: 'success',
|
|
|
errorText: ''
|
|
|
};
|
|
|
saveStatusArrs.current = newArr;
|
|
|
setSaveStatusArr(newArr);
|
|
|
} else {
|
|
|
_newArr2 = (saveStatusArrs === null || saveStatusArrs === void 0 || (_saveStatusArrs$curre2 = saveStatusArrs.current) === null || _saveStatusArrs$curre2 === void 0 ? void 0 : _saveStatusArrs$curre2.slice()) || [].slice();
|
|
|
_newArr2[index] = {
|
|
|
status: 'fail',
|
|
|
errorText: res.message
|
|
|
};
|
|
|
saveStatusArrs.current = _newArr2;
|
|
|
setSaveStatusArr(_newArr2);
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function (_x2) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}())
|
|
|
})
|
|
|
}), ((_saveStatusArr$index = saveStatusArr[index]) === null || _saveStatusArr$index === void 0 ? void 0 : _saveStatusArr$index.status) === "success" && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
},
|
|
|
className: "iconfont icon-chenggong1 ".concat(componentsmodules.success)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: componentsmodules.success,
|
|
|
children: "\u4FDD\u5B58\u6210\u529F"
|
|
|
})]
|
|
|
})
|
|
|
}), ((_saveStatusArr$index2 = saveStatusArr[index]) === null || _saveStatusArr$index2 === void 0 ? void 0 : _saveStatusArr$index2.status) === "fail" && /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
style: {
|
|
|
marginRight: 8
|
|
|
},
|
|
|
className: "iconfont icon-tishi7 ".concat(componentsmodules.fail)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: componentsmodules.fail,
|
|
|
children: (_saveStatusArr$index3 = saveStatusArr[index]) === null || _saveStatusArr$index3 === void 0 ? void 0 : _saveStatusArr$index3.errorText
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}, index);
|
|
|
}), !!(item !== null && item !== void 0 && (_item$standard_answer2 = item.standard_answer) !== null && _item$standard_answer2 !== void 0 && _item$standard_answer2.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: item === null || item === void 0 || (_item$standard_answer3 = item.standard_answer) === null || _item$standard_answer3 === void 0 ? void 0 : _item$standard_answer3.map(function (answer, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A", index + 1, "\uFF09:"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(TextArea, {
|
|
|
autoSize: true,
|
|
|
disabled: true,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text[0]
|
|
|
})
|
|
|
})]
|
|
|
}, index);
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_Fill = (Fill);
|
|
|
// EXTERNAL MODULE: ./src/components/QuestionEditor/Buttonloading.tsx
|
|
|
var Buttonloading = __webpack_require__(27407);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.4.0@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules
|
|
|
var ExclamationCircleOutlined = __webpack_require__(3148);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/BFill.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var BFill_TextArea = input/* default */.Z.TextArea;
|
|
|
var BFill = function BFill(_ref) {
|
|
|
var _item$standard_answer2, _item$standard_answer3;
|
|
|
var item = _ref.item,
|
|
|
answerData = _ref.answerData,
|
|
|
_ref$onBlur = _ref.onBlur,
|
|
|
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
|
_ref$onDebug = _ref.onDebug,
|
|
|
onDebug = _ref$onDebug === void 0 ? function () {} : _ref$onDebug;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
userAnswer = _useState2[0],
|
|
|
setUserAnswer = _useState2[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _item$standard_answer;
|
|
|
var data = item === null || item === void 0 || (_item$standard_answer = item.standard_answer_with_score) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer.map(function (val, index) {
|
|
|
var _item$user_answer;
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, val), {}, {
|
|
|
value: (item === null || item === void 0 || (_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 || (_item$user_answer = _item$user_answer.find(function (item) {
|
|
|
return parseInt(item.choice_id) === index + 1;
|
|
|
})) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer.answer_text) || ''
|
|
|
});
|
|
|
});
|
|
|
setUserAnswer(data);
|
|
|
}, [item === null || item === void 0 ? void 0 : item.standard_answer_with_score]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [(item === null || item === void 0 ? void 0 : item.code) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
border: '1px solid #CCCCCC',
|
|
|
padding: '10px',
|
|
|
marginBottom: 20
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: componentsmodules.content,
|
|
|
programFillValue: userAnswer,
|
|
|
showProgramFill: true,
|
|
|
onFillBlur: ( /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(e, index) {
|
|
|
var _e$parseInt;
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return onBlur(e === null || e === void 0 || (_e$parseInt = e[parseInt(index)]) === null || _e$parseInt === void 0 ? void 0 : _e$parseInt.value, parseInt(index) + 1, userAnswer);
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
userAnswer[parseInt(index)].type = "success";
|
|
|
setUserAnswer(userAnswer);
|
|
|
} else {
|
|
|
userAnswer[parseInt(index)].type = "warning";
|
|
|
setUserAnswer(userAnswer);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function (_x, _x2) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}()),
|
|
|
value: base64.Base64.decode((item === null || item === void 0 ? void 0 : item.code) || '')
|
|
|
})
|
|
|
}), !!(item !== null && item !== void 0 && (_item$standard_answer2 = item.standard_answer) !== null && _item$standard_answer2 !== void 0 && _item$standard_answer2.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: item === null || item === void 0 || (_item$standard_answer3 = item.standard_answer) === null || _item$standard_answer3 === void 0 ? void 0 : _item$standard_answer3.map(function (answer, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A", index + 1, "\uFF09:"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(BFill_TextArea, {
|
|
|
autoSize: true,
|
|
|
disabled: true,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.answer_text[0]
|
|
|
})
|
|
|
})]
|
|
|
}, index);
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
fontSize: 14,
|
|
|
color: '#FF0000'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
marginLeft: 5
|
|
|
},
|
|
|
children: "\u6CE8\u610F\uFF1A\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801\u8FDB\u884C\u8BC4\u6D4B\uFF0C\u5426\u5219\u65E0\u6CD5\u5F97\u5206"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Buttonloading/* default */.Z, {
|
|
|
ButtonProps: {
|
|
|
type: 'primary'
|
|
|
},
|
|
|
ButtonText: "\u63D0\u4EA4\u4EE3\u7801",
|
|
|
items: objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
|
userAnswer: userAnswer
|
|
|
}),
|
|
|
hackidentifier: item === null || item === void 0 ? 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__(850);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/components/ErrCheckIpTip.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ErrCheckIpTip_TextArea = input/* default */.Z.TextArea;
|
|
|
var ErrCheckIpTip_Fill = function Fill(_ref) {
|
|
|
var data = _ref.data;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc mt80",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
width: "486",
|
|
|
src: ImagesIcon/* errIcon */.BV
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), data.status === -1 && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-grey-999 mt60",
|
|
|
children: "\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"
|
|
|
}), data.status === -2 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: " c-grey-999 mt60",
|
|
|
children: ["\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: data.ip
|
|
|
}), "\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "mt40 pl20 pr20",
|
|
|
type: "primary",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "/",
|
|
|
children: "\u56DE\u5230\u9996\u9875"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ErrCheckIpTip = (ErrCheckIpTip_Fill);
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(39653);
|
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
|
var lodash = __webpack_require__(89392);
|
|
|
// EXTERNAL MODULE: ./src/utils/constant.ts
|
|
|
var constant = __webpack_require__(99288);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Classrooms/Lists/Exercise/ImitateAnswer/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Countdown = statistic/* default */.Z.Countdown;
|
|
|
var ImitateAnswer_TextArea = input/* default */.Z.TextArea;
|
|
|
var tagList = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
|
|
|
var scoreStatusMapping = {
|
|
|
0: 'c-red-ee4',
|
|
|
1: 'c-green'
|
|
|
};
|
|
|
var Answer = function Answer(_ref) {
|
|
|
var _answerData$exercise4, _answerData$exercise16, _answerData$exercise17, _answerData$exercise18, _answerData$exercise19, _answerData$exercise20, _answerData$question_4, _answerData$exercise_10, _answerData$question_5, _answerData$exercise_11, _answerData$exercise_12, _answerData$exercise_13, _answerData$exercise_14, _answerData$exercise_15, _answerData$exercise_16, _answerData$exercise_18, _answerData$exercise_19;
|
|
|
var user = _ref.user,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var params = (0,_umi_production_exports.useParams)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
answerData = _useState2[0],
|
|
|
setAnswerData = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
answerCheckData = _useState4[0],
|
|
|
setAnswerCheckData = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
hideAnswerCard = _useState6[0],
|
|
|
setHideAnswerCard = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
isSpin = _useState8[0],
|
|
|
setIsSpin = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(true),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
showAnswerCard = _useState10[0],
|
|
|
setShowAnswerCard = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
showCamera = _useState12[0],
|
|
|
setShowCamera = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
openFullScreen = _useState14[0],
|
|
|
setOpenFullScreen = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
time = _useState16[0],
|
|
|
setTime = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
iframeUrl = _useState18[0],
|
|
|
setIframeUrl = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)('none'),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
iframeBlock = _useState20[0],
|
|
|
setIframeBlock = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
countDownColor = _useState22[0],
|
|
|
setCountDownColor = _useState22[1];
|
|
|
var _useState23 = (0,_react_17_0_2_react.useState)({
|
|
|
status: 0
|
|
|
}),
|
|
|
_useState24 = slicedToArray_default()(_useState23, 2),
|
|
|
checkStatus = _useState24[0],
|
|
|
setCheckStatus = _useState24[1]; //0ip合法,-1ip不在范围,-2已绑定其他ip
|
|
|
var iframe = (0,_react_17_0_2_react.useRef)();
|
|
|
var _useState25 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState26 = slicedToArray_default()(_useState25, 2),
|
|
|
oneindex = _useState26[0],
|
|
|
setoneindex = _useState26[1]; //大题下标
|
|
|
var _useState27 = (0,_react_17_0_2_react.useState)(0),
|
|
|
_useState28 = slicedToArray_default()(_useState27, 2),
|
|
|
twoindex = _useState28[0],
|
|
|
settwoindex = _useState28[1]; //小题下标
|
|
|
var _useState29 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState30 = slicedToArray_default()(_useState29, 2),
|
|
|
isShowmodal = _useState30[0],
|
|
|
setisshowmodal = _useState30[1];
|
|
|
var _useState31 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState32 = slicedToArray_default()(_useState31, 2),
|
|
|
ischecked = _useState32[0],
|
|
|
setischecked = _useState32[1];
|
|
|
var _useState33 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState34 = slicedToArray_default()(_useState33, 2),
|
|
|
type = _useState34[0],
|
|
|
settype = _useState34[1];
|
|
|
var _useState35 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState36 = slicedToArray_default()(_useState35, 2),
|
|
|
indexitems = _useState36[0],
|
|
|
setindexitems = _useState36[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: "globalSetting/headerFooterToggle",
|
|
|
payload: false
|
|
|
});
|
|
|
if (((0,authority/* isAdmin */.GJ)() || (0,authority/* isCommonAdminOrCreator */.EO)()) && params.categoryId && user.userInfo.login) {
|
|
|
initData();
|
|
|
}
|
|
|
window.addEventListener('message', handleMessage);
|
|
|
return function () {
|
|
|
window.removeEventListener('message', handleMessage);
|
|
|
window.removeEventListener("beforeunload", onBeforeunload);
|
|
|
dispatch({
|
|
|
type: "globalSetting/headerFooterToggle",
|
|
|
payload: true
|
|
|
});
|
|
|
if (location.pathname.indexOf("/detail") > -1) (0,fullscreen/* exitFull */.BU)();
|
|
|
};
|
|
|
}, [params.categoryId, user.userInfo.login]);
|
|
|
var handleMessage = function handleMessage(data) {
|
|
|
if (data.data === 'backExercise') {
|
|
|
setIframeBlock("none");
|
|
|
setIframeUrl("");
|
|
|
initData();
|
|
|
}
|
|
|
};
|
|
|
var onBeforeunload = function onBeforeunload(e) {
|
|
|
var confirmationMessage = "确定离开此页面吗?此页数据可能会丢失";
|
|
|
(e || window.event).returnValue = confirmationMessage;
|
|
|
return confirmationMessage;
|
|
|
};
|
|
|
var initData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var res, _res$exercise_scores;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setIsSpin(true);
|
|
|
_context.next = 3;
|
|
|
return (0,exercise/* startSimulateAnswer */._F)(objectSpread2_default()({}, params))["catch"](function () {
|
|
|
return setIsSpin(false);
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context.sent;
|
|
|
(res === null || res === void 0 ? void 0 : res.exercise) && (res.exercise.user_exercise_status = 1);
|
|
|
setIsSpin(false);
|
|
|
if (res) {
|
|
|
res.exercise_types = (res === null || res === void 0 ? void 0 : res.exercise_types) || (res === null || res === void 0 || (_res$exercise_scores = res.exercise_scores) === null || _res$exercise_scores === void 0 ? void 0 : _res$exercise_scores.exercise_types);
|
|
|
setAnswerData(res);
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function initData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _answerData$exercise, _answerData$exercise2, _answerData$exercise3;
|
|
|
if (((_answerData$exercise = answerData.exercise) === null || _answerData$exercise === void 0 ? void 0 : _answerData$exercise.time) === 0) handleSubmitAnswer(); //自动任务失败,进入后时间为0自动提交试卷
|
|
|
((_answerData$exercise2 = answerData.exercise) === null || _answerData$exercise2 === void 0 ? void 0 : _answerData$exercise2.time) && setTime(Date.now() + (answerData === null || answerData === void 0 || (_answerData$exercise3 = answerData.exercise) === null || _answerData$exercise3 === void 0 ? void 0 : _answerData$exercise3.time) * 1000 * 60);
|
|
|
}, [(_answerData$exercise4 = answerData.exercise) === null || _answerData$exercise4 === void 0 ? void 0 : _answerData$exercise4.time]);
|
|
|
var handleToDetail = function handleToDetail() {
|
|
|
initData();
|
|
|
};
|
|
|
|
|
|
// 自动交卷
|
|
|
var handleFinishTime = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var res, _time;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,exercise/* submitSimulateExerciseAnswer */.kp)({
|
|
|
categoryId: params.categoryId,
|
|
|
commit_method: 2
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context3.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
es_modal/* default */.Z.info({
|
|
|
width: 530,
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc font16",
|
|
|
children: ["\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377", /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), "\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"]
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
handleToDetail();
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
message/* default */.ZP.info(res === null || res === void 0 ? void 0 : res.message);
|
|
|
}
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === -3) {
|
|
|
_time = parseInt(res === null || res === void 0 ? void 0 : res.message);
|
|
|
answerData.exercise.time = _time;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleFinishTime() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var goShixun = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(item) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_context4.next = 2;
|
|
|
return (item.is_jupyter || item.is_jupyter_lab ? shixuns/* execJupyter */.BK : shixuns/* execShixun */.Ir)({
|
|
|
id: item.shixun_identifier
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context4.sent;
|
|
|
if (res !== null && res !== void 0 && res.game_identifier || res !== null && res !== void 0 && res.identifier) {
|
|
|
if (item.is_jupyter_lab || item.is_jupyter) {
|
|
|
setIframeUrl("/tasks/".concat(res.identifier, "/jupyter?type=exercises&exercisesId=").concat(params.categoryId, "&coursesId=coursesId&login=").concat(params.login, "&questionId=").concat(item.question_id));
|
|
|
} else {
|
|
|
setIframeUrl("/tasks/".concat(res.game_identifier, "?type=exercises&exercisesId=").concat(params.categoryId, "&coursesId=").concat(params.coursesId, "&login=").concat(params.login, "&questionId=").concat(item.question_id));
|
|
|
}
|
|
|
setIframeBlock("block");
|
|
|
}
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === -3) {
|
|
|
(0,util/* bindPhone */.eF)();
|
|
|
} else if ((res === null || res === void 0 ? void 0 : res.status) === 2) {
|
|
|
handleResetGame(res === null || res === void 0 ? void 0 : res.message, item.question_id, item.is_jupyter_lab, item.is_jupyter);
|
|
|
} else if ((res === null || res === void 0 ? void 0 : res.status) === 3) {
|
|
|
handleInBeta(res === null || res === void 0 ? void 0 : res.message);
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function goShixun(_x) {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleResetGame = function handleResetGame(url, question_id, is_jupyter_lab, is_jupyter) {
|
|
|
var _url;
|
|
|
url = (_url = url) !== null && _url !== void 0 && _url.includes('.json') ? url : "".concat(url, ".json");
|
|
|
es_modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: "\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var res, execRes;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
_context5.next = 2;
|
|
|
return (0,exercise/* resetMyGame */.$Q)({
|
|
|
url: url
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context5.sent;
|
|
|
if (res) {
|
|
|
_context5.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context5.abrupt("return");
|
|
|
case 5:
|
|
|
message/* default */.ZP.success("重置成功,正在进入实践项目!");
|
|
|
_context5.next = 8;
|
|
|
return (0,shixuns/* execShixun */.Ir)({
|
|
|
id: res.shixun_identifier
|
|
|
});
|
|
|
case 8:
|
|
|
execRes = _context5.sent;
|
|
|
if (!(execRes !== null && execRes !== void 0 && execRes.game_identifier)) {
|
|
|
_context5.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
goShixun({
|
|
|
shixun_identifier: execRes === null || execRes === void 0 ? void 0 : execRes.game_identifier,
|
|
|
question_id: question_id,
|
|
|
is_jupyter_lab: is_jupyter_lab,
|
|
|
is_jupyter: is_jupyter
|
|
|
});
|
|
|
return _context5.abrupt("return");
|
|
|
case 12:
|
|
|
if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 2) {
|
|
|
handleResetGame(execRes === null || execRes === void 0 ? void 0 : execRes.message, question_id, is_jupyter_lab, is_jupyter);
|
|
|
} else if ((execRes === null || execRes === void 0 ? void 0 : execRes.status) === 3) {
|
|
|
handleInBeta(execRes === null || execRes === void 0 ? void 0 : execRes.message);
|
|
|
}
|
|
|
case 13:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk2.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
};
|
|
|
var handleInBeta = function handleInBeta(message) {
|
|
|
es_modal/* default */.Z.confirm({
|
|
|
centered: true,
|
|
|
title: '提示',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc font16",
|
|
|
children: ["\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E", message, "\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01"]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var handleJoinShixun = function handleJoinShixun(item) {
|
|
|
if (item.redo) {
|
|
|
es_modal/* default */.Z.info({
|
|
|
width: 530,
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: "\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
var res, newQuestions, index, newItem;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
_context6.next = 2;
|
|
|
return (0,exercise/* resetMyGame */.$Q)({
|
|
|
id: item.myshixun_identifier,
|
|
|
url: item.url
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context6.sent;
|
|
|
if (res) {
|
|
|
newQuestions = (0,lodash.cloneDeep)(answerData === null || answerData === void 0 ? void 0 : answerData.exercise_question_types);
|
|
|
index = newQuestions === null || newQuestions === void 0 ? void 0 : newQuestions.findIndex(function (e) {
|
|
|
return e.question_type === 5;
|
|
|
});
|
|
|
newQuestions[index].items.find(function (er) {
|
|
|
return er.question_id === item.question_id;
|
|
|
}).redo = false;
|
|
|
newQuestions[index].items.find(function (er) {
|
|
|
return er.question_id === item.question_id;
|
|
|
}).shixun_identifier = res.shixun_identifier;
|
|
|
answerData.exercise_question_types = newQuestions;
|
|
|
setAnswerData(answerData);
|
|
|
newItem = objectSpread2_default()(objectSpread2_default()({}, item), {}, {
|
|
|
shixun_identifier: res.shixun_identifier
|
|
|
});
|
|
|
goShixun(newItem);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk3.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
} else {
|
|
|
goShixun(item);
|
|
|
}
|
|
|
};
|
|
|
var handleJoinProgram = /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7(item) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
if (!item.hack_identifier) {
|
|
|
_context7.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
_context7.next = 3;
|
|
|
return (0,exercise/* startProgram */.nF)({
|
|
|
id: item.hack_identifier
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context7.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
setIframeUrl("/myproblems/".concat(res.identifier, "?type=exercises&exercisesId=").concat(params.categoryId, "&coursesId=").concat(params.coursesId, "&login=").concat(params.login, "&questionId=").concat(item.question_id));
|
|
|
setIframeBlock("block");
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
}));
|
|
|
return function handleJoinProgram(_x2) {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleSave = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(questionId, exercise_choice_id, answer_text, callBack) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
if (questionId) {
|
|
|
_context8.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
console.error("handleSave no questionId params");
|
|
|
return _context8.abrupt("return");
|
|
|
case 3:
|
|
|
_context8.next = 5;
|
|
|
return (0,exercise/* updateExerciseAnswers */.oX)({
|
|
|
questionId: questionId,
|
|
|
exercise_choice_id: exercise_choice_id,
|
|
|
answer_text: answer_text
|
|
|
});
|
|
|
case 5:
|
|
|
res = _context8.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
callBack && callBack();
|
|
|
}
|
|
|
return _context8.abrupt("return", res);
|
|
|
case 8:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee8);
|
|
|
}));
|
|
|
return function handleSave(_x3, _x4, _x5, _x6) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleVerifySave = /*#__PURE__*/function () {
|
|
|
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11(isSave) {
|
|
|
var res, tip, _answerData$exercise_;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
|
|
|
while (1) switch (_context11.prev = _context11.next) {
|
|
|
case 0:
|
|
|
_context11.next = 2;
|
|
|
return (0,exercise/* simulateBeginCommit */.WL)({
|
|
|
id: params.categoryId
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context11.sent;
|
|
|
if (res) {
|
|
|
_context11.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
return _context11.abrupt("return");
|
|
|
case 5:
|
|
|
if (res.question_undo !== 0 || res.oj_undo !== 0) {
|
|
|
tip = '';
|
|
|
if (res.question_undo !== 0 && res.oj_undo !== 0) {
|
|
|
tip = "\u6709 ".concat(res.question_undo, " \u9898\u672A\u5B8C\u6210\uFF0C\u5305\u542B ").concat(res.oj_undo, " \u4E2A").concat((answerData === null || answerData === void 0 || (_answerData$exercise_ = answerData.exercise_question_types) === null || _answerData$exercise_ === void 0 || (_answerData$exercise_ = _answerData$exercise_.find(function (item) {
|
|
|
return item.question_type == 6;
|
|
|
})) === null || _answerData$exercise_ === void 0 ? void 0 : _answerData$exercise_.name) || "编程题");
|
|
|
} else if (res.question_undo !== 0 && res.oj_undo === 0) {
|
|
|
tip = "\u6709 ".concat(res.question_undo, " \u9898\u672A\u5B8C\u6210");
|
|
|
} else if (res.question_undo === 0 && res.oj_undo !== 0) {
|
|
|
tip = "\u6709 ".concat(res.oj_undo, " \u7F16\u7A0B\u9898\u672A\u5B8C\u6210");
|
|
|
}
|
|
|
es_modal/* default */.Z.confirm({
|
|
|
width: 530,
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc font16",
|
|
|
children: [tip, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), isSave ? "\u5728".concat(dayjs_min_default()(res.end_time).format("YYYY-MM-DD HH:mm"), "\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898") : "\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"]
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
|
|
|
while (1) switch (_context9.prev = _context9.next) {
|
|
|
case 0:
|
|
|
if (isSave) {
|
|
|
handleToDetail();
|
|
|
} else {
|
|
|
handleSubmitAnswer();
|
|
|
}
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context9.stop();
|
|
|
}
|
|
|
}, _callee9);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk4.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
} else {
|
|
|
es_modal/* default */.Z.info({
|
|
|
width: 530,
|
|
|
title: '提示',
|
|
|
centered: true,
|
|
|
okText: '知道啦',
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "tc font16",
|
|
|
children: isSave ? "\u5728".concat(dayjs_min_default()(res.end_time).format("YYYY-MM-DD HH:mm"), "\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898") : "\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"
|
|
|
}),
|
|
|
onOk: function () {
|
|
|
var _onOk5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
|
|
|
while (1) switch (_context10.prev = _context10.next) {
|
|
|
case 0:
|
|
|
if (isSave) {
|
|
|
handleToDetail();
|
|
|
} else {
|
|
|
handleSubmitAnswer();
|
|
|
}
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context10.stop();
|
|
|
}
|
|
|
}, _callee10);
|
|
|
}));
|
|
|
function onOk() {
|
|
|
return _onOk5.apply(this, arguments);
|
|
|
}
|
|
|
return onOk;
|
|
|
}()
|
|
|
});
|
|
|
}
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context11.stop();
|
|
|
}
|
|
|
}, _callee11);
|
|
|
}));
|
|
|
return function handleVerifySave(_x7) {
|
|
|
return _ref7.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var submitProgressContent = function submitProgressContent(progress) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_progress/* default */.Z, {
|
|
|
strokeColor: {
|
|
|
from: '#108ee9',
|
|
|
to: '#87d068'
|
|
|
},
|
|
|
status: "active",
|
|
|
percent: progress
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "c-grey-c tc mt10 mb20",
|
|
|
children: "\u6B63\u5728\u5224\u5206\u4E2D\u2026"
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var submitProgressLoading = function submitProgressLoading() {
|
|
|
var progress = 0;
|
|
|
var modal = es_modal/* default */.Z.info({
|
|
|
title: "交卷中",
|
|
|
icon: null,
|
|
|
className: "modal-footer-none",
|
|
|
content: submitProgressContent(progress)
|
|
|
});
|
|
|
var interval = setInterval(function () {
|
|
|
if (progress <= 100) {
|
|
|
progress += 2;
|
|
|
modal.update({
|
|
|
content: submitProgressContent(progress)
|
|
|
});
|
|
|
} else {
|
|
|
modal.destroy();
|
|
|
clearInterval(interval);
|
|
|
}
|
|
|
}, 50);
|
|
|
};
|
|
|
var handleSubmitAnswer = /*#__PURE__*/function () {
|
|
|
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12() {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
|
|
|
while (1) switch (_context12.prev = _context12.next) {
|
|
|
case 0:
|
|
|
submitProgressLoading();
|
|
|
_context12.next = 3;
|
|
|
return (0,exercise/* submitSimulateExerciseAnswer */.kp)({
|
|
|
categoryId: params.categoryId,
|
|
|
commit_method: 1
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context12.sent;
|
|
|
(0,fullscreen/* exitFull */.BU)();
|
|
|
dispatch({
|
|
|
type: "exercise/setActionTabs",
|
|
|
payload: objectSpread2_default()({}, {
|
|
|
removeEventListenerExitScreen: true
|
|
|
})
|
|
|
});
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.success(res === null || res === void 0 ? void 0 : res.message);
|
|
|
setShowCamera(false);
|
|
|
setTimeout(function () {
|
|
|
es_modal/* default */.Z.info({
|
|
|
title: "交卷成功!",
|
|
|
okText: "确定",
|
|
|
onOk: function onOk() {
|
|
|
handleToDetail();
|
|
|
}
|
|
|
});
|
|
|
}, 3000);
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context12.stop();
|
|
|
}
|
|
|
}, _callee12);
|
|
|
}));
|
|
|
return function handleSubmitAnswer() {
|
|
|
return _ref8.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChangeSingle = /*#__PURE__*/function () {
|
|
|
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13(value, id, key, item) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
|
|
|
while (1) switch (_context13.prev = _context13.next) {
|
|
|
case 0:
|
|
|
handleSave(id, value, null, function () {
|
|
|
//题目选中
|
|
|
// const newQuestions = cloneDeep(answerData?.exercise_question_types);
|
|
|
// const index = newQuestions?.findIndex((e: any) => e.question_type === key)
|
|
|
// newQuestions[index].items.find((item: any) => item.question_id === id).user_answer[0] = value;
|
|
|
// answerData.exercise_question_types = newQuestions;
|
|
|
//答题卡选中
|
|
|
answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = value ? 1 : 0;
|
|
|
item.user_answer = [];
|
|
|
item.user_answer.push(value);
|
|
|
if (!item.repeat_answer) {
|
|
|
item.israp = true;
|
|
|
}
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context13.stop();
|
|
|
}
|
|
|
}, _callee13);
|
|
|
}));
|
|
|
return function handleChangeSingle(_x8, _x9, _x10, _x11) {
|
|
|
return _ref9.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChangeSingles = /*#__PURE__*/function () {
|
|
|
var _ref10 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14(value, id, key, item, items) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
|
|
|
while (1) switch (_context14.prev = _context14.next) {
|
|
|
case 0:
|
|
|
handleSave(item.question_id, value, null, function () {
|
|
|
var _items$sub_exercise_q, _items$sub_exercise_q2, _items$sub_exercise_q3;
|
|
|
//题目选中
|
|
|
// const newQuestions = cloneDeep(answerData?.exercise_question_types);
|
|
|
// const index = newQuestions?.findIndex((e: any) => e.question_type === key)
|
|
|
// newQuestions[index].items.find((item: any) => item.question_id === id).user_answer[0] = value;
|
|
|
// answerData.exercise_question_types = newQuestions;
|
|
|
//答题卡选中
|
|
|
// console.log(answerData,id);
|
|
|
item.user_answer = [];
|
|
|
item.user_answer.push(value);
|
|
|
// let items=answerData?.exercise_question_types?.find((item:any)=>item.question_type === 7)?.items?.find((items:any)=>items.question_id===id)
|
|
|
var answer = items === null || items === void 0 || (_items$sub_exercise_q = items.sub_exercise_questions) === null || _items$sub_exercise_q === void 0 ? void 0 : _items$sub_exercise_q.filter(function (item) {
|
|
|
var _item$user_answer;
|
|
|
return ((_item$user_answer = item.user_answer) === null || _item$user_answer === void 0 ? void 0 : _item$user_answer.length) === 0;
|
|
|
});
|
|
|
answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = (answer === null || answer === void 0 ? void 0 : answer.length) === (items === null || items === void 0 || (_items$sub_exercise_q2 = items.sub_exercise_questions) === null || _items$sub_exercise_q2 === void 0 ? void 0 : _items$sub_exercise_q2.length) ? 0 : (answer === null || answer === void 0 ? void 0 : answer.length) > 0 && (answer === null || answer === void 0 ? void 0 : answer.length) < (items === null || items === void 0 || (_items$sub_exercise_q3 = items.sub_exercise_questions) === null || _items$sub_exercise_q3 === void 0 ? void 0 : _items$sub_exercise_q3.length) ? 2 : 1;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
// initData();
|
|
|
});
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context14.stop();
|
|
|
}
|
|
|
}, _callee14);
|
|
|
}));
|
|
|
return function handleChangeSingles(_x12, _x13, _x14, _x15, _x16) {
|
|
|
return _ref10.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleChangeMultiple = function handleChangeMultiple(value, id, item) {
|
|
|
handleSave(id, value, null, function () {
|
|
|
item.user_answer = value;
|
|
|
if (!item.repeat_answer) {
|
|
|
item.israp = true;
|
|
|
}
|
|
|
answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = value !== null && value !== void 0 && value.length ? 1 : 0;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
});
|
|
|
};
|
|
|
var handleBlurFill = /*#__PURE__*/function () {
|
|
|
var _ref11 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15(value, index, id, param, item) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
|
|
|
while (1) switch (_context15.prev = _context15.next) {
|
|
|
case 0:
|
|
|
_context15.next = 2;
|
|
|
return handleSave(id, index, value, function () {
|
|
|
answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = param.every(function (k) {
|
|
|
return !!k.answer_text;
|
|
|
}) ? 1 : answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = param.some(function (k) {
|
|
|
return !!k.answer_text;
|
|
|
}) ? 2 : 0;
|
|
|
// item.user_answer=value;
|
|
|
var answers = {
|
|
|
choice_id: index,
|
|
|
answer_text: value
|
|
|
};
|
|
|
if (item.user_answer.filter(function (item) {
|
|
|
return item.choice_id != index;
|
|
|
})) {
|
|
|
item.user_answer.splice(index - 1, 1, answers);
|
|
|
} else {
|
|
|
item.user_answer.push(answers);
|
|
|
}
|
|
|
if (!item.repeat_answer) {
|
|
|
item.israp = true;
|
|
|
}
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context15.sent;
|
|
|
return _context15.abrupt("return", res);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context15.stop();
|
|
|
}
|
|
|
}, _callee15);
|
|
|
}));
|
|
|
return function handleBlurFill(_x17, _x18, _x19, _x20, _x21) {
|
|
|
return _ref11.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleBlurBProgram = /*#__PURE__*/function () {
|
|
|
var _ref12 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16(value, index, id, param, item) {
|
|
|
var res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
|
|
|
while (1) switch (_context16.prev = _context16.next) {
|
|
|
case 0:
|
|
|
_context16.next = 2;
|
|
|
return handleSave(id, index, value, function () {
|
|
|
answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = param.every(function (k) {
|
|
|
return !!k.value;
|
|
|
}) ? 1 : answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = param.some(function (k) {
|
|
|
return !!k.value;
|
|
|
}) ? 2 : 0;
|
|
|
// item.user_answer=value;
|
|
|
var answers = {
|
|
|
choice_id: index,
|
|
|
answer_text: value
|
|
|
};
|
|
|
if (item.user_answer.filter(function (item) {
|
|
|
return item.choice_id != index;
|
|
|
})) {
|
|
|
item.user_answer.splice(index - 1, 1, answers);
|
|
|
} else {
|
|
|
item.user_answer.push(answers);
|
|
|
}
|
|
|
if (!item.repeat_answer) {
|
|
|
item.israp = true;
|
|
|
}
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
});
|
|
|
case 2:
|
|
|
res = _context16.sent;
|
|
|
return _context16.abrupt("return", res);
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context16.stop();
|
|
|
}
|
|
|
}, _callee16);
|
|
|
}));
|
|
|
return function handleBlurBProgram(_x22, _x23, _x24, _x25, _x26) {
|
|
|
return _ref12.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleBlurSimple = function handleBlurSimple(value, id, item) {
|
|
|
handleSave(id, null, value, function () {
|
|
|
answerData.question_status.find(function (item) {
|
|
|
return item.ques_id === id;
|
|
|
}).ques_status = value ? 1 : 0;
|
|
|
// item.user_answer=value;
|
|
|
item.user_answer = [];
|
|
|
item.user_answer.push(value);
|
|
|
if (!item.repeat_answer) {
|
|
|
item.israp = true;
|
|
|
}
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
});
|
|
|
};
|
|
|
var renderSingle = function renderSingle(item, key) {
|
|
|
var _item$user_answer2, _item$question_choice, _answerData$exercise5, _answerData$exercise6, _answerData$exercise7, _item$standard_answer;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ImitateAnswermodules.baseMargin,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
|
disabled: !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
|
|
|
defaultValue: item === null || item === void 0 || (_item$user_answer2 = item.user_answer) === null || _item$user_answer2 === void 0 ? void 0 : _item$user_answer2[0],
|
|
|
onChange: function onChange(e) {
|
|
|
return handleChangeSingle(e.target.value, item === null || item === void 0 ? void 0 : item.question_id, key, item);
|
|
|
},
|
|
|
className: item.user_score && "edu-radio-".concat(item.user_score === item.question_score ? "green" : "red"),
|
|
|
children: item === null || item === void 0 || (_item$question_choice = item.question_choices) === null || _item$question_choice === void 0 ? void 0 : _item$question_choice.map(function (answer, index) {
|
|
|
var _item$user_answer3;
|
|
|
var isJudge = item.question_type == 2;
|
|
|
var prefix = isJudge ? '' : "".concat(tagList[index], ".");
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(ImitateAnswermodules.answerWrap),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
|
|
|
className: ImitateAnswermodules.noWrap,
|
|
|
disabled: !item.repeat_answer && (item === null || item === void 0 || (_item$user_answer3 = item.user_answer) === null || _item$user_answer3 === void 0 ? void 0 : _item$user_answer3.length) > 0 && !item.israp,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.choice_id,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr3 font16",
|
|
|
children: prefix
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
style: {
|
|
|
width: 740
|
|
|
},
|
|
|
className: ImitateAnswermodules.renderHtml,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.choice_text
|
|
|
})]
|
|
|
})
|
|
|
}, index);
|
|
|
})
|
|
|
}), (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 || (_answerData$exercise5 = answerData.exercise) === null || _answerData$exercise5 === void 0 ? void 0 : _answerData$exercise5.answer_open) && ((answerData === null || answerData === void 0 || (_answerData$exercise6 = answerData.exercise) === null || _answerData$exercise6 === void 0 ? void 0 : _answerData$exercise6.exercise_status) == 3 || (answerData === null || answerData === void 0 || (_answerData$exercise7 = answerData.exercise) === null || _answerData$exercise7 === void 0 ? void 0 : _answerData$exercise7.user_exercise_status) == 1) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", item === null || item === void 0 || (_item$standard_answer = item.standard_answer) === null || _item$standard_answer === void 0 ? void 0 : _item$standard_answer.map(function (answer, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: tagList[Number(answer) - 1]
|
|
|
}, index);
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderSingles = function renderSingles(items, keys, i) {
|
|
|
var _items$sub_exercise_q4;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: items === null || items === void 0 || (_items$sub_exercise_q4 = items.sub_exercise_questions) === null || _items$sub_exercise_q4 === void 0 ? void 0 : _items$sub_exercise_q4.map(function (item, key) {
|
|
|
var _item$user_answer4, _item$question_choice2, _answerData$exercise8, _answerData$exercise9, _answerData$exercise10, _item$standard_answer2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(ImitateAnswermodules.baseMargin, " ").concat(ImitateAnswermodules.singleItem, " mb20"),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
alignItems: 'baseline',
|
|
|
userSelect: "none",
|
|
|
marginBottom: 40
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
flexShrink: 0,
|
|
|
color: '#999999'
|
|
|
},
|
|
|
className: "font14",
|
|
|
children: ["\uFF08", item === null || item === void 0 ? void 0 : item.question_score, "\u5206\uFF09"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flexShrink: 0,
|
|
|
marginRight: 6
|
|
|
},
|
|
|
className: "font16",
|
|
|
children: i + 1 + '.' + (key + 1)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: item === null || item === void 0 ? void 0 : item.question_title
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_radio/* default.Group */.ZP.Group, {
|
|
|
style: {
|
|
|
marginLeft: 66
|
|
|
},
|
|
|
disabled: !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
|
|
|
defaultValue: item === null || item === void 0 || (_item$user_answer4 = item.user_answer) === null || _item$user_answer4 === void 0 ? void 0 : _item$user_answer4[0],
|
|
|
onChange: function onChange(e) {
|
|
|
return handleChangeSingles(e.target.value, items === null || items === void 0 ? void 0 : items.question_id, key, item, items);
|
|
|
},
|
|
|
className: item.user_score && "edu-radio-".concat(item.user_score === item.question_score ? "green" : "red"),
|
|
|
children: item === null || item === void 0 || (_item$question_choice2 = item.question_choices) === null || _item$question_choice2 === void 0 ? void 0 : _item$question_choice2.map(function (answer, index) {
|
|
|
var _item$user_answer5;
|
|
|
var isJudge = item.question_type == 2;
|
|
|
var prefix = isJudge ? '' : "".concat(tagList[index], ".");
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ImitateAnswermodules.answerWrap,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_radio/* default */.ZP, {
|
|
|
className: ImitateAnswermodules.noWrap,
|
|
|
disabled: !item.repeat_answer && (item === null || item === void 0 || (_item$user_answer5 = item.user_answer) === null || _item$user_answer5 === void 0 ? void 0 : _item$user_answer5.length) > 0,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.choice_id,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#333333'
|
|
|
},
|
|
|
className: "mr3 font16 ".concat(ImitateAnswermodules.noWrap),
|
|
|
children: prefix
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
style: {
|
|
|
width: 734
|
|
|
},
|
|
|
className: ImitateAnswermodules.renderHtml,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.choice_text
|
|
|
})]
|
|
|
})
|
|
|
}, index);
|
|
|
})
|
|
|
}), (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 || (_answerData$exercise8 = answerData.exercise) === null || _answerData$exercise8 === void 0 ? void 0 : _answerData$exercise8.answer_open) && ((answerData === null || answerData === void 0 || (_answerData$exercise9 = answerData.exercise) === null || _answerData$exercise9 === void 0 ? void 0 : _answerData$exercise9.exercise_status) == 3 || (answerData === null || answerData === void 0 || (_answerData$exercise10 = answerData.exercise) === null || _answerData$exercise10 === void 0 ? void 0 : _answerData$exercise10.user_exercise_status) == 1) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", item === null || item === void 0 || (_item$standard_answer2 = item.standard_answer) === null || _item$standard_answer2 === void 0 ? void 0 : _item$standard_answer2.map(function (answer, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: tagList[Number(answer) - 1]
|
|
|
}, index);
|
|
|
})]
|
|
|
})]
|
|
|
}, key);
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
var renderMultiple = function renderMultiple(item, key) {
|
|
|
var _item$question_choice3, _answerData$exercise11, _answerData$exercise12, _item$standard_answer3;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ImitateAnswermodules.baseMargin,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z.Group, {
|
|
|
disabled: !!(answerData !== null && answerData !== void 0 && answerData.exercise.commit_status),
|
|
|
defaultValue: item === null || item === void 0 ? void 0 : item.user_answer,
|
|
|
onChange: function onChange(value) {
|
|
|
return handleChangeMultiple(value, item === null || item === void 0 ? void 0 : item.question_id, item);
|
|
|
},
|
|
|
className: item.user_score && "edu-checkbox-".concat(item.user_score === item.question_score ? "green" : "red"),
|
|
|
children: item === null || item === void 0 || (_item$question_choice3 = item.question_choices) === null || _item$question_choice3 === void 0 ? void 0 : _item$question_choice3.map(function (answer, index) {
|
|
|
var _item$user_answer6;
|
|
|
var prefix = "".concat(tagList[index], ".");
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ImitateAnswermodules.answerWrap,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_checkbox/* default */.Z, {
|
|
|
disabled: !item.repeat_answer && (item === null || item === void 0 || (_item$user_answer6 = item.user_answer) === null || _item$user_answer6 === void 0 ? void 0 : _item$user_answer6.length) > 0 && !item.israp,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.choice_id,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "mr3 font16",
|
|
|
children: prefix
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
className: ImitateAnswermodules.renderHtml,
|
|
|
value: answer === null || answer === void 0 ? void 0 : answer.choice_text
|
|
|
})]
|
|
|
})
|
|
|
}, index);
|
|
|
})
|
|
|
}), (0,authority/* isStudent */.dE)() && (answerData === null || answerData === void 0 || (_answerData$exercise11 = answerData.exercise) === null || _answerData$exercise11 === void 0 ? void 0 : _answerData$exercise11.answer_open) && (answerData === null || answerData === void 0 || (_answerData$exercise12 = answerData.exercise) === null || _answerData$exercise12 === void 0 ? void 0 : _answerData$exercise12.exercise_status) == 3 && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: ["\u53C2\u8003\u7B54\u6848\uFF1A", item === null || item === void 0 || (_item$standard_answer3 = item.standard_answer) === null || _item$standard_answer3 === void 0 ? void 0 : _item$standard_answer3.map(function (answer, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: tagList[Number(answer) - 1]
|
|
|
}, index);
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderFill = function renderFill(item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Fill, {
|
|
|
item: item,
|
|
|
answerData: answerData,
|
|
|
onBlur: ( /*#__PURE__*/function () {
|
|
|
var _ref13 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee17(value, index, userAnswer) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee17$(_context17) {
|
|
|
while (1) switch (_context17.prev = _context17.next) {
|
|
|
case 0:
|
|
|
_context17.next = 2;
|
|
|
return handleBlurFill(value, index, item === null || item === void 0 ? void 0 : item.question_id, userAnswer, item);
|
|
|
case 2:
|
|
|
return _context17.abrupt("return", _context17.sent);
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context17.stop();
|
|
|
}
|
|
|
}, _callee17);
|
|
|
}));
|
|
|
return function (_x27, _x28, _x29) {
|
|
|
return _ref13.apply(this, arguments);
|
|
|
};
|
|
|
}())
|
|
|
});
|
|
|
};
|
|
|
|
|
|
// 简答题
|
|
|
var renderSimple = function renderSimple(item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Simple, {
|
|
|
item: item,
|
|
|
answerData: answerData,
|
|
|
onBlur: function onBlur(value) {
|
|
|
return handleBlurSimple(value, item === null || item === void 0 ? void 0 : item.question_id, item);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var renderShixun = function renderShixun(item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Shixun, {
|
|
|
item: item,
|
|
|
answerData: answerData
|
|
|
});
|
|
|
};
|
|
|
var renderProgram = function renderProgram(item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_Program, {
|
|
|
item: item,
|
|
|
answerData: answerData
|
|
|
});
|
|
|
};
|
|
|
var renderBProgram = function renderBProgram(item, key) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(components_BFill, {
|
|
|
item: item,
|
|
|
answerData: answerData,
|
|
|
onBlur: ( /*#__PURE__*/function () {
|
|
|
var _ref14 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee18(value, index, userAnswer) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee18$(_context18) {
|
|
|
while (1) switch (_context18.prev = _context18.next) {
|
|
|
case 0:
|
|
|
_context18.next = 2;
|
|
|
return handleBlurBProgram(value, index, item === null || item === void 0 ? void 0 : item.question_id, userAnswer, item);
|
|
|
case 2:
|
|
|
return _context18.abrupt("return", _context18.sent);
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context18.stop();
|
|
|
}
|
|
|
}, _callee18);
|
|
|
}));
|
|
|
return function (_x30, _x31, _x32) {
|
|
|
return _ref14.apply(this, arguments);
|
|
|
};
|
|
|
}())
|
|
|
});
|
|
|
};
|
|
|
var renderAnswerCard = function renderAnswerCard(title, key, index) {
|
|
|
var _answerData$exercise_2, _obj$items;
|
|
|
var obj = answerData === null || answerData === void 0 || (_answerData$exercise_2 = answerData.exercise_question_types) === null || _answerData$exercise_2 === void 0 ? void 0 : _answerData$exercise_2.find(function (item) {
|
|
|
return item.question_type === key;
|
|
|
});
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ImitateAnswermodules.answerSheetWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ImitateAnswermodules.answerSheetQuestionTitle,
|
|
|
onClick: function onClick() {
|
|
|
hideAnswerCard[key] = !hideAnswerCard[key];
|
|
|
setHideAnswerCard(objectSpread2_default()({}, hideAnswerCard));
|
|
|
},
|
|
|
children: [!hideAnswerCard[key] && /*#__PURE__*/(0,jsx_runtime.jsx)(MinusSquareOutlined/* default */.Z, {}), hideAnswerCard[key] && /*#__PURE__*/(0,jsx_runtime.jsx)(PlusSquareOutlined/* default */.Z, {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "ml5 c-grey-666",
|
|
|
children: title
|
|
|
})]
|
|
|
}), !hideAnswerCard[key] && /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
className: ImitateAnswermodules.answerSheet,
|
|
|
gutter: [20, 20],
|
|
|
children: obj === null || obj === void 0 || (_obj$items = obj.items) === null || _obj$items === void 0 ? void 0 : _obj$items.map(function (item, k) {
|
|
|
if (item.question_type === key) {
|
|
|
var _answerData$question_, _answerData$question_2, _answerData$question_3;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
onClick: function onClick() {
|
|
|
var _answerData$exercise13;
|
|
|
if (index === oneindex && k === twoindex) {
|
|
|
//点击的答题卡选项恰好是当前题目时不该做任何操作
|
|
|
return;
|
|
|
}
|
|
|
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
if (!ischecked && (answerData === null || answerData === void 0 || (_answerData$exercise13 = answerData.exercise) === null || _answerData$exercise13 === void 0 ? void 0 : _answerData$exercise13.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
|
|
|
var _answerData$exercise_3;
|
|
|
if (!((_answerData$exercise_3 = answerData.exercise_question_types) !== null && _answerData$exercise_3 !== void 0 && (_answerData$exercise_3 = _answerData$exercise_3[oneindex]) !== null && _answerData$exercise_3 !== void 0 && (_answerData$exercise_3 = _answerData$exercise_3.items) !== null && _answerData$exercise_3 !== void 0 && (_answerData$exercise_3 = _answerData$exercise_3[twoindex]) !== null && _answerData$exercise_3 !== void 0 && _answerData$exercise_3.repeat_answer)) {
|
|
|
setisshowmodal(true);
|
|
|
settype(3);
|
|
|
setindexitems({
|
|
|
oneindex: index,
|
|
|
twoindex: k
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
setoneindex(index);
|
|
|
settwoindex(k);
|
|
|
var anchorName = "Anchor_".concat(key, "_").concat(k);
|
|
|
var anchorElement = document.getElementById(anchorName);
|
|
|
if (anchorElement) {
|
|
|
setTimeout(function () {
|
|
|
return anchorElement.scrollIntoView({
|
|
|
block: "start",
|
|
|
behavior: "smooth"
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
className: "\n ".concat(ImitateAnswermodules.answerSheetItem, "\n ").concat(answerData !== null && answerData !== void 0 && (_answerData$question_ = answerData.question_status) !== null && _answerData$question_ !== void 0 && _answerData$question_.some(function (val) {
|
|
|
return val.ques_id === item.question_id && (val === null || val === void 0 ? void 0 : val.ques_status) === 1;
|
|
|
}) ? ImitateAnswermodules.active : '', "\n ").concat(answerData !== null && answerData !== void 0 && (_answerData$question_2 = answerData.question_status) !== null && _answerData$question_2 !== void 0 && _answerData$question_2.some(function (val) {
|
|
|
return val.ques_id === item.question_id && (val === null || val === void 0 ? void 0 : val.ques_status) === 2;
|
|
|
}) ? ImitateAnswermodules.partialActive : '', "\n ").concat(index === oneindex && k === twoindex ? ImitateAnswermodules.selected : '', "\n "),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ImitateAnswermodules.qindex,
|
|
|
children: k + 1
|
|
|
}), (answerData === null || answerData === void 0 || (_answerData$question_3 = answerData.question_status) === null || _answerData$question_3 === void 0 ? void 0 : _answerData$question_3.some(function (val) {
|
|
|
return val.ques_id === item.question_id && (val === null || val === void 0 ? void 0 : val.ques_status) === 2;
|
|
|
})) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
height: 12,
|
|
|
background: '#3061D0',
|
|
|
position: 'absolute',
|
|
|
width: '100%',
|
|
|
bottom: 0
|
|
|
}
|
|
|
})]
|
|
|
}, k)
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}, key)]
|
|
|
});
|
|
|
};
|
|
|
var renderQuestion = function renderQuestion(item, i) {
|
|
|
var _item$schools, _item$answer_comments, _item$answer_comments2, _answerData$exercise14, _answerData$exercise15;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ImitateAnswermodules.questionItem,
|
|
|
id: "Anchor_".concat(item === null || item === void 0 ? void 0 : item.question_type, "_").concat(i),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex',
|
|
|
alignItems: 'baseline',
|
|
|
marginTop: 20,
|
|
|
marginBottom: 40,
|
|
|
userSelect: "none"
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "".concat(ImitateAnswermodules.questionScore, " mr10"),
|
|
|
children: [item === null || item === void 0 ? void 0 : item.question_score, "\u5206"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "font16 ".concat(ImitateAnswermodules.noWrap),
|
|
|
children: [i + 1, "\u3001"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RenderHtml/* default */.Z, {
|
|
|
value: (item === null || item === void 0 ? void 0 : item.question_type) == 8 ? item === null || item === void 0 ? void 0 : item.description : item === null || item === void 0 ? void 0 : item.question_title
|
|
|
}), !(item !== null && item !== void 0 && item.repeat_answer) && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#E30000',
|
|
|
marginLeft: 20,
|
|
|
fontSize: 14
|
|
|
},
|
|
|
children: "\u6CE8\u610F\uFF1A\u8BE5\u9898\u4F5C\u7B54\u4E4B\u540E\u4E0D\u5141\u8BB8\u4FEE\u6539\u7B54\u6848\u3002"
|
|
|
}), !!(item !== null && item !== void 0 && (_item$schools = item.schools) !== null && _item$schools !== void 0 && _item$schools.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
|
|
|
className: "iconfont icon-zhidinggongkai1 line24 font18 c-orange"
|
|
|
})
|
|
|
})]
|
|
|
}),
|
|
|
// 单选题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 0 && renderSingle(item, item === null || item === void 0 ? void 0 : item.question_type),
|
|
|
// 判断题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 2 && renderSingle(item, item === null || item === void 0 ? void 0 : item.question_type),
|
|
|
// 多选题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 1 && renderMultiple(item, item === null || item === void 0 ? void 0 : item.question_type),
|
|
|
// 填空题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 3 && renderFill(item, item === null || item === void 0 ? void 0 : item.question_type),
|
|
|
// 简答题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 4 && renderSimple(item, item === null || item === void 0 ? void 0 : item.question_type),
|
|
|
// 实训题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 5 && renderShixun(item, item === null || item === void 0 ? void 0 : item.question_type),
|
|
|
// 编程题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 6 && renderProgram(item, item === null || item === void 0 ? void 0 : item.question_type),
|
|
|
// 组合题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 7 && renderSingles(item, item === null || item === void 0 ? void 0 : item.question_type, i),
|
|
|
// 程序填空题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 8 && renderBProgram(item, item === null || item === void 0 ? void 0 : item.question_type), !!(item !== null && item !== void 0 && (_item$answer_comments = item.answer_comments) !== null && _item$answer_comments !== void 0 && _item$answer_comments.length) && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt30",
|
|
|
children: item === null || item === void 0 || (_item$answer_comments2 = item.answer_comments) === null || _item$answer_comments2 === void 0 ? void 0 : _item$answer_comments2.map(function (v, k) {
|
|
|
var _v$user, _v$user2;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
gutter: [0, 10],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "50px",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: env/* default */.Z.API_SERVER + '/images/' + ((_v$user = v.user) === null || _v$user === void 0 ? void 0 : _v$user.image_url),
|
|
|
width: "40",
|
|
|
style: {
|
|
|
borderRadius: 40
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: [v.updated_at, /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), (_v$user2 = v.user) === null || _v$user2 === void 0 ? void 0 : _v$user2.name]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: "c-grey-c",
|
|
|
children: [v.shixun_chanllge_position && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u7B2C", v.shixun_chanllge_position, "\u5173"]
|
|
|
}), item.question_type !== 4 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: ["\u539F\u59CB\u5F97\u5206", v.origin_score, "\u5206 \uFF0C"]
|
|
|
}), " \u4FEE\u6B63\u4E3A", v.score, "\u5206"]
|
|
|
})]
|
|
|
}), v.comment && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
gutter: [0, 10],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "50px"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(ImitateAnswer_TextArea, {
|
|
|
autoSize: true,
|
|
|
value: v.comment,
|
|
|
disabled: true
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}, k);
|
|
|
})
|
|
|
}), (item === null || item === void 0 ? void 0 : item.question_type) < 3 && (item === null || item === void 0 ? void 0 : item.standard_answer_show) && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "font16 ml20",
|
|
|
children: ["\u6B63\u786E\u7B54\u6848\uFF1A", item === null || item === void 0 ? void 0 : item.standard_answer_show]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: (item === null || item === void 0 ? void 0 : item.user_score) !== null && (item === null || item === void 0 ? void 0 : item.user_score) >= 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: scoreStatusMapping[Number(item === null || item === void 0 ? void 0 : item.answer_status)] || 'c-orange-ff9',
|
|
|
children: item === null || item === void 0 ? void 0 : item.user_score
|
|
|
}), " \u5206"]
|
|
|
})
|
|
|
}),
|
|
|
// 实训题 ,答题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 5 && !((_answerData$exercise14 = answerData.exercise) !== null && _answerData$exercise14 !== void 0 && _answerData$exercise14.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
justify: "end",
|
|
|
className: "mt20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: ImitateAnswermodules.toIframeBtn,
|
|
|
onClick: function onClick() {
|
|
|
return handleJoinShixun(item);
|
|
|
},
|
|
|
children: "\u8FDB\u5165\u7B54\u9898"
|
|
|
})
|
|
|
}),
|
|
|
// 编程题 ,答题
|
|
|
(item === null || item === void 0 ? void 0 : item.question_type) == 6 && !((_answerData$exercise15 = answerData.exercise) !== null && _answerData$exercise15 !== void 0 && _answerData$exercise15.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
justify: "end",
|
|
|
className: "mt20",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: ImitateAnswermodules.toIframeBtn,
|
|
|
onClick: function onClick() {
|
|
|
return handleJoinProgram(item);
|
|
|
},
|
|
|
children: "\u8FDB\u5165\u7B54\u9898"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
var renderCardList = function renderCardList(item, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
|
children: renderAnswerCard(item.name || constant/* QUESTIONTYPE */.f[item.question_type].name, item.question_type, index)
|
|
|
});
|
|
|
};
|
|
|
|
|
|
//转换中文
|
|
|
var toChinesNum = function toChinesNum(num) {
|
|
|
var changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; //changeNum[0] = "零"
|
|
|
var unit = ["", "十", "百", "千", "万"];
|
|
|
num = parseInt(num);
|
|
|
var getWan = function getWan(temp) {
|
|
|
var strArr = temp.toString().split("").reverse();
|
|
|
var newNum = "";
|
|
|
for (var i = 0; i < strArr.length; i++) {
|
|
|
newNum = (i == 0 && strArr[i] == 0 ? "" : i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i])) + newNum;
|
|
|
}
|
|
|
return newNum;
|
|
|
};
|
|
|
var overWan = Math.floor(num / 10000);
|
|
|
var noWan = num % 10000;
|
|
|
if (noWan.toString().length < 4) noWan = "0" + noWan;
|
|
|
return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
|
|
|
};
|
|
|
var renderClassifyQuestion = function renderClassifyQuestion() {
|
|
|
var _answerData$exercise_4, _answerData$exercise_5, _answerData$exercise_6, _answerData$exercise_7, _answerData$exercise_8, _answerData$exercise_9;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "pt20",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: ImitateAnswermodules.questionTypeTitle,
|
|
|
children: [toChinesNum(oneindex + 1), "\u3001", answerData === null || answerData === void 0 || (_answerData$exercise_4 = answerData.exercise_question_types) === null || _answerData$exercise_4 === void 0 || (_answerData$exercise_4 = _answerData$exercise_4[oneindex]) === null || _answerData$exercise_4 === void 0 ? void 0 : _answerData$exercise_4.name]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: ImitateAnswermodules.questionTypeInfo,
|
|
|
children: ["\uFF08\u5171", answerData === null || answerData === void 0 || (_answerData$exercise_5 = answerData.exercise_question_types) === null || _answerData$exercise_5 === void 0 || (_answerData$exercise_5 = _answerData$exercise_5[oneindex]) === null || _answerData$exercise_5 === void 0 ? void 0 : _answerData$exercise_5.count, "\u9898\uFF1B", (answerData === null || answerData === void 0 || (_answerData$exercise_6 = answerData.exercise_question_types) === null || _answerData$exercise_6 === void 0 || (_answerData$exercise_6 = _answerData$exercise_6[oneindex]) === null || _answerData$exercise_6 === void 0 ? void 0 : _answerData$exercise_6.question_type) === 7 ? "\u5305\u542B".concat(answerData === null || answerData === void 0 || (_answerData$exercise_7 = answerData.exercise_question_types) === null || _answerData$exercise_7 === void 0 || (_answerData$exercise_7 = _answerData$exercise_7[oneindex]) === null || _answerData$exercise_7 === void 0 ? void 0 : _answerData$exercise_7.sub_questions_count, "\u5C0F\u9898") : '', " \u5171", answerData === null || answerData === void 0 || (_answerData$exercise_8 = answerData.exercise_question_types) === null || _answerData$exercise_8 === void 0 || (_answerData$exercise_8 = _answerData$exercise_8[oneindex]) === null || _answerData$exercise_8 === void 0 ? void 0 : _answerData$exercise_8.score, "\u5206\uFF09"]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
|
children: renderQuestion(answerData === null || answerData === void 0 || (_answerData$exercise_9 = answerData.exercise_question_types) === null || _answerData$exercise_9 === void 0 || (_answerData$exercise_9 = _answerData$exercise_9[oneindex]) === null || _answerData$exercise_9 === void 0 || (_answerData$exercise_9 = _answerData$exercise_9.items) === null || _answerData$exercise_9 === void 0 ? void 0 : _answerData$exercise_9[twoindex], twoindex)
|
|
|
}, twoindex)]
|
|
|
}, oneindex);
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
|
|
|
size: 'middle',
|
|
|
spinning: isSpin,
|
|
|
children: [openFullScreen && /*#__PURE__*/(0,jsx_runtime.jsx)(recordScreen/* default */.Z, {
|
|
|
iframe: iframe
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
style: {
|
|
|
display: iframeBlock
|
|
|
},
|
|
|
id: "iframeShixuns",
|
|
|
className: ImitateAnswermodules.iframe,
|
|
|
src: iframeUrl,
|
|
|
ref: iframe,
|
|
|
frameBorder: "0"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: ImitateAnswermodules.fixHeader,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
className: "edu-container",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(util/* StatusClassroomsTags */.VV, {
|
|
|
status: answerData !== null && answerData !== void 0 && (_answerData$exercise16 = answerData.exercise) !== null && _answerData$exercise16 !== void 0 && _answerData$exercise16.commit_status ? [util/* ExerciseStatus */.ju[4]] : [util/* ExerciseStatus */.ju[99]]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: "".concat(ImitateAnswermodules.title, " ml10"),
|
|
|
children: answerData === null || answerData === void 0 || (_answerData$exercise17 = answerData.exercise) === null || _answerData$exercise17 === void 0 ? void 0 : _answerData$exercise17.exercise_name
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
style: {
|
|
|
marginLeft: 'auto'
|
|
|
},
|
|
|
children: (answerData === null || answerData === void 0 || (_answerData$exercise18 = answerData.exercise) === null || _answerData$exercise18 === void 0 ? void 0 : _answerData$exercise18.time) !== -1 && !(answerData !== null && answerData !== void 0 && (_answerData$exercise19 = answerData.exercise) !== null && _answerData$exercise19 !== void 0 && _answerData$exercise19.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "".concat(ImitateAnswermodules.countDown, " ").concat(countDownColor),
|
|
|
children: ["\u5269\u4F59\u7B54\u9898\u65F6\u957F", /*#__PURE__*/(0,jsx_runtime.jsx)(Countdown, {
|
|
|
value: time,
|
|
|
onFinish: handleFinishTime
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: !(answerData !== null && answerData !== void 0 && (_answerData$exercise20 = answerData.exercise) !== null && _answerData$exercise20 !== void 0 && _answerData$exercise20.commit_status) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: ImitateAnswermodules.submitButton,
|
|
|
style: {
|
|
|
marginLeft: 30
|
|
|
},
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
return handleVerifySave(false);
|
|
|
},
|
|
|
children: "\u4EA4\u5377"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: "edu-container",
|
|
|
children: [checkStatus.status === 0 && /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: ImitateAnswermodules.mainPart,
|
|
|
wrap: false,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
flex: showAnswerCard ? "280px" : "0px",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ImitateAnswermodules.leftPart,
|
|
|
children: [showAnswerCard && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: "bg-white",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
|
|
|
className: ImitateAnswermodules.answerInfo,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
justify: "space-between",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
children: "\u7B54\u9898\u8FDB\u5EA6"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: ImitateAnswermodules.answerProgress,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#165DFF'
|
|
|
},
|
|
|
children: answerData === null || answerData === void 0 || (_answerData$question_4 = answerData.question_status) === null || _answerData$question_4 === void 0 || (_answerData$question_4 = _answerData$question_4.filter(function (val) {
|
|
|
return (val === null || val === void 0 ? void 0 : val.ques_status) === 1;
|
|
|
})) === null || _answerData$question_4 === void 0 ? void 0 : _answerData$question_4.length
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#999999'
|
|
|
},
|
|
|
children: ["/", answerData === null || answerData === void 0 || (_answerData$exercise_10 = answerData.exercise_types) === null || _answerData$exercise_10 === void 0 ? void 0 : _answerData$exercise_10.q_counts]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_progress/* default */.Z, {
|
|
|
strokeColor: "#165dffa6",
|
|
|
trailColor: "#0000000d",
|
|
|
percent: (answerData === null || answerData === void 0 || (_answerData$question_5 = answerData.question_status) === null || _answerData$question_5 === void 0 || (_answerData$question_5 = _answerData$question_5.filter(function (val) {
|
|
|
return (val === null || val === void 0 ? void 0 : val.ques_status) === 1;
|
|
|
})) === null || _answerData$question_5 === void 0 ? void 0 : _answerData$question_5.length) / (answerData === null || answerData === void 0 || (_answerData$exercise_11 = answerData.exercise_types) === null || _answerData$exercise_11 === void 0 ? void 0 : _answerData$exercise_11.q_counts) * 100,
|
|
|
showInfo: false
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333",
|
|
|
children: ["\u5171 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#165DFF'
|
|
|
},
|
|
|
children: (answerData === null || answerData === void 0 || (_answerData$exercise_12 = answerData.exercise_types) === null || _answerData$exercise_12 === void 0 ? void 0 : _answerData$exercise_12.q_counts) || (answerData === null || answerData === void 0 || (_answerData$exercise_13 = answerData.exercise_scores) === null || _answerData$exercise_13 === void 0 || (_answerData$exercise_13 = _answerData$exercise_13.exercise_types) === null || _answerData$exercise_13 === void 0 ? void 0 : _answerData$exercise_13.q_counts)
|
|
|
}), " \u9898\uFF1A"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: "c-grey-333",
|
|
|
children: ["\u6EE1\u5206 ", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#FA6400'
|
|
|
},
|
|
|
children: (answerData === null || answerData === void 0 || (_answerData$exercise_14 = answerData.exercise_types) === null || _answerData$exercise_14 === void 0 ? void 0 : _answerData$exercise_14.q_scores) || (answerData === null || answerData === void 0 || (_answerData$exercise_15 = answerData.exercise_scores) === null || _answerData$exercise_15 === void 0 || (_answerData$exercise_15 = _answerData$exercise_15.exercise_types) === null || _answerData$exercise_15 === void 0 ? void 0 : _answerData$exercise_15.q_scores)
|
|
|
}), " \u5206"]
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
className: ImitateAnswermodules.dottedLineWrapper,
|
|
|
align: "middle",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: ImitateAnswermodules.leftHalfCircle
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: 1,
|
|
|
className: ImitateAnswermodules.dottedLine
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
className: ImitateAnswermodules.rightHalfCircle
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
|
|
|
className: ImitateAnswermodules.cardList,
|
|
|
children: answerData === null || answerData === void 0 || (_answerData$exercise_16 = answerData.exercise_question_types) === null || _answerData$exercise_16 === void 0 ? void 0 : _answerData$exercise_16.map(function (er, index) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
|
|
|
children: renderCardList(er, index)
|
|
|
}, er.question_type);
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
justify: "space-around",
|
|
|
align: "middle",
|
|
|
className: ImitateAnswermodules.answerSheetBottom,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: ImitateAnswermodules.tooltipWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: ImitateAnswermodules.answerYes
|
|
|
}), "\u5DF2\u7B54"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: ImitateAnswermodules.tooltipWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(ImitateAnswermodules.answerNo, " ml10"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
height: '50%',
|
|
|
background: '#0152d9'
|
|
|
}
|
|
|
})
|
|
|
}), "\u90E8\u5206\u7B54\u9898"]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
className: ImitateAnswermodules.tooltipWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(ImitateAnswermodules.answerNo, " ml10")
|
|
|
}), "\u672A\u7B54"]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: ImitateAnswermodules.fold,
|
|
|
onClick: function onClick() {
|
|
|
return setShowAnswerCard(!showAnswerCard);
|
|
|
},
|
|
|
children: [showAnswerCard && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u6536\u8D77\u7B54\u9898\u5361",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "icon-zuojiantou iconfont c-grey-c"
|
|
|
})
|
|
|
}), !showAnswerCard && /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: "\u5C55\u5F00",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "icon-youjiantou iconfont c-grey-c"
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: [ImitateAnswermodules.rightPart, 'ml20'].join(' '),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(ImitateAnswermodules.questionPart, " pl30 pr30"),
|
|
|
children: renderClassifyQuestion()
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
|
|
|
className: ImitateAnswermodules.bottom,
|
|
|
align: "middle",
|
|
|
justify: "end",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
|
|
|
children: [(oneindex != 0 || twoindex != 0) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "".concat(ImitateAnswermodules.changeButton, " ").concat(ImitateAnswermodules.prevBtn, " mr20"),
|
|
|
type: "default",
|
|
|
onClick: function onClick() {
|
|
|
var _answerData$exercise21;
|
|
|
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
if (!ischecked && (answerData === null || answerData === void 0 || (_answerData$exercise21 = answerData.exercise) === null || _answerData$exercise21 === void 0 ? void 0 : _answerData$exercise21.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
|
|
|
var _answerData$exercise_17;
|
|
|
if (!((_answerData$exercise_17 = answerData.exercise_question_types) !== null && _answerData$exercise_17 !== void 0 && (_answerData$exercise_17 = _answerData$exercise_17[oneindex]) !== null && _answerData$exercise_17 !== void 0 && (_answerData$exercise_17 = _answerData$exercise_17.items) !== null && _answerData$exercise_17 !== void 0 && (_answerData$exercise_17 = _answerData$exercise_17[twoindex]) !== null && _answerData$exercise_17 !== void 0 && _answerData$exercise_17.repeat_answer)) {
|
|
|
setisshowmodal(true);
|
|
|
settype(1);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (twoindex === 0) {
|
|
|
oneindex -= 1;
|
|
|
twoindex = answerData.exercise_question_types[oneindex].items.length - 1;
|
|
|
} else {
|
|
|
twoindex -= 1;
|
|
|
}
|
|
|
setoneindex(oneindex);
|
|
|
settwoindex(twoindex);
|
|
|
},
|
|
|
children: "\u4E0A\u4E00\u9898"
|
|
|
}), !(oneindex === (answerData === null || answerData === void 0 || (_answerData$exercise_18 = answerData.exercise_question_types) === null || _answerData$exercise_18 === void 0 ? void 0 : _answerData$exercise_18.length) - 1 && twoindex === (answerData === null || answerData === void 0 || (_answerData$exercise_19 = answerData.exercise_question_types) === null || _answerData$exercise_19 === void 0 || (_answerData$exercise_19 = _answerData$exercise_19[oneindex]) === null || _answerData$exercise_19 === void 0 || (_answerData$exercise_19 = _answerData$exercise_19.items) === null || _answerData$exercise_19 === void 0 ? void 0 : _answerData$exercise_19.length) - 1) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: ImitateAnswermodules.changeButton,
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
var _answerData$exercise22;
|
|
|
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
if (!ischecked && (answerData === null || answerData === void 0 || (_answerData$exercise22 = answerData.exercise) === null || _answerData$exercise22 === void 0 ? void 0 : _answerData$exercise22.user_exercise_status) === 0 && (0,authority/* isStudent */.dE)()) {
|
|
|
var _answerData$exercise_20;
|
|
|
if (!((_answerData$exercise_20 = answerData.exercise_question_types) !== null && _answerData$exercise_20 !== void 0 && (_answerData$exercise_20 = _answerData$exercise_20[oneindex]) !== null && _answerData$exercise_20 !== void 0 && (_answerData$exercise_20 = _answerData$exercise_20.items) !== null && _answerData$exercise_20 !== void 0 && (_answerData$exercise_20 = _answerData$exercise_20[twoindex]) !== null && _answerData$exercise_20 !== void 0 && _answerData$exercise_20.repeat_answer)) {
|
|
|
setisshowmodal(true);
|
|
|
settype(2);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
if (answerData.exercise_question_types[oneindex].items.length - 1 === twoindex) {
|
|
|
oneindex = oneindex + 1;
|
|
|
twoindex = 0;
|
|
|
} else {
|
|
|
twoindex = twoindex + 1;
|
|
|
}
|
|
|
setoneindex(oneindex);
|
|
|
settwoindex(twoindex);
|
|
|
},
|
|
|
children: "\u4E0B\u4E00\u9898"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
|
|
|
title: "\u6CE8\u610F",
|
|
|
open: isShowmodal,
|
|
|
onCancel: function onCancel() {
|
|
|
return setisshowmodal(false);
|
|
|
},
|
|
|
footer: false,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: {
|
|
|
marginBottom: 0
|
|
|
},
|
|
|
children: "\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 60,
|
|
|
display: 'flex',
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
checked: ischecked,
|
|
|
onChange: function onChange(e) {
|
|
|
setischecked(e.target.checked);
|
|
|
},
|
|
|
children: "\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
if (!answerData.exercise_question_types[oneindex].items[twoindex].israp) {
|
|
|
if (answerData.exercise_question_types[oneindex].items[twoindex].israp === '') {
|
|
|
answerData.exercise_question_types[oneindex].items[twoindex].israp = true;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
}
|
|
|
} else {
|
|
|
answerData.exercise_question_types[oneindex].items[twoindex].israp = true;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
}
|
|
|
},
|
|
|
children: "\u6211\u518D\u60F3\u60F3"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
onClick: function onClick() {
|
|
|
answerData.exercise_question_types[oneindex].items[twoindex].israp = false;
|
|
|
setAnswerData(objectSpread2_default()({}, answerData));
|
|
|
if (type === 1) {
|
|
|
if (twoindex === 0) {
|
|
|
oneindex -= 1;
|
|
|
twoindex = answerData.exercise_question_types[oneindex].items.length - 1;
|
|
|
} else {
|
|
|
twoindex -= 1;
|
|
|
}
|
|
|
console.log(answerData.exercise_question_types[oneindex].items[twoindex], '-----');
|
|
|
setoneindex(oneindex);
|
|
|
settwoindex(twoindex);
|
|
|
} else if (type === 2) {
|
|
|
if (answerData.exercise_question_types[oneindex].items.length - 1 === twoindex) {
|
|
|
oneindex = oneindex + 1;
|
|
|
twoindex = 0;
|
|
|
} else {
|
|
|
twoindex = twoindex + 1;
|
|
|
}
|
|
|
setoneindex(oneindex);
|
|
|
settwoindex(twoindex);
|
|
|
} else {
|
|
|
setoneindex(indexitems.oneindex);
|
|
|
settwoindex(indexitems.twoindex);
|
|
|
}
|
|
|
|
|
|
// initData();
|
|
|
setisshowmodal(false);
|
|
|
},
|
|
|
type: "primary",
|
|
|
style: {
|
|
|
marginLeft: 30
|
|
|
},
|
|
|
children: "\u786E\u8BA4"
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}), checkStatus.status !== 0 && /*#__PURE__*/(0,jsx_runtime.jsx)(ErrCheckIpTip, {
|
|
|
data: checkStatus
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ImitateAnswer = ((0,_umi_production_exports.connect)(function (_ref15) {
|
|
|
var loading = _ref15.loading,
|
|
|
user = _ref15.user;
|
|
|
return {
|
|
|
user: user,
|
|
|
loading: loading.effects
|
|
|
};
|
|
|
})(Answer));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 31797:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/statistic/index.js + 5 modules ***!
|
|
|
\*************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_statistic; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/hooks/useForceUpdate.js
|
|
|
var useForceUpdate = __webpack_require__(56762);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(92343);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/skeleton/index.js + 12 modules
|
|
|
var skeleton = __webpack_require__(66999);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Number.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
const StatisticNumber = props => {
|
|
|
const {
|
|
|
value,
|
|
|
formatter,
|
|
|
precision,
|
|
|
decimalSeparator,
|
|
|
groupSeparator = '',
|
|
|
prefixCls
|
|
|
} = props;
|
|
|
let valueNode;
|
|
|
if (typeof formatter === 'function') {
|
|
|
// Customize formatter
|
|
|
valueNode = formatter(value);
|
|
|
} else {
|
|
|
// Internal formatter
|
|
|
const val = String(value);
|
|
|
const cells = val.match(/^(-?)(\d*)(\.(\d+))?$/);
|
|
|
// Process if illegal number
|
|
|
if (!cells || val === '-') {
|
|
|
valueNode = val;
|
|
|
} else {
|
|
|
const negative = cells[1];
|
|
|
let int = cells[2] || '0';
|
|
|
let decimal = cells[4] || '';
|
|
|
int = int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
|
if (typeof precision === 'number') {
|
|
|
decimal = decimal.padEnd(precision, '0').slice(0, precision > 0 ? precision : 0);
|
|
|
}
|
|
|
if (decimal) {
|
|
|
decimal = `${decimalSeparator}${decimal}`;
|
|
|
}
|
|
|
valueNode = [/*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
key: "int",
|
|
|
className: `${prefixCls}-content-value-int`
|
|
|
}, negative, int), decimal && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
key: "decimal",
|
|
|
className: `${prefixCls}-content-value-decimal`
|
|
|
}, decimal)];
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-content-value`
|
|
|
}, valueNode);
|
|
|
};
|
|
|
/* harmony default export */ var statistic_Number = (StatisticNumber);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/style/index.js
|
|
|
var style = __webpack_require__(17313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/genComponentStyleHook.js
|
|
|
var genComponentStyleHook = __webpack_require__(83116);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/theme/util/statistic.js
|
|
|
var statistic = __webpack_require__(37613);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/style/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const genStatisticStyle = token => {
|
|
|
const {
|
|
|
componentCls,
|
|
|
marginXXS,
|
|
|
padding,
|
|
|
colorTextDescription,
|
|
|
titleFontSize,
|
|
|
colorTextHeading,
|
|
|
contentFontSize,
|
|
|
fontFamily
|
|
|
} = token;
|
|
|
return {
|
|
|
[`${componentCls}`]: Object.assign(Object.assign({}, (0,style/* resetComponent */.Wf)(token)), {
|
|
|
[`${componentCls}-title`]: {
|
|
|
marginBottom: marginXXS,
|
|
|
color: colorTextDescription,
|
|
|
fontSize: titleFontSize
|
|
|
},
|
|
|
[`${componentCls}-skeleton`]: {
|
|
|
paddingTop: padding
|
|
|
},
|
|
|
[`${componentCls}-content`]: {
|
|
|
color: colorTextHeading,
|
|
|
fontSize: contentFontSize,
|
|
|
fontFamily,
|
|
|
[`${componentCls}-content-value`]: {
|
|
|
display: 'inline-block',
|
|
|
direction: 'ltr'
|
|
|
},
|
|
|
[`${componentCls}-content-prefix, ${componentCls}-content-suffix`]: {
|
|
|
display: 'inline-block'
|
|
|
},
|
|
|
[`${componentCls}-content-prefix`]: {
|
|
|
marginInlineEnd: marginXXS
|
|
|
},
|
|
|
[`${componentCls}-content-suffix`]: {
|
|
|
marginInlineStart: marginXXS
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
};
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
/* harmony default export */ var statistic_style = ((0,genComponentStyleHook/* default */.Z)('Statistic', token => {
|
|
|
const statisticToken = (0,statistic/* merge */.TS)(token, {});
|
|
|
return [genStatisticStyle(statisticToken)];
|
|
|
}, token => {
|
|
|
const {
|
|
|
fontSizeHeading3,
|
|
|
fontSize
|
|
|
} = token;
|
|
|
return {
|
|
|
titleFontSize: fontSize,
|
|
|
contentFontSize: fontSizeHeading3
|
|
|
};
|
|
|
}));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Statistic.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Statistic = props => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
valueStyle,
|
|
|
value = 0,
|
|
|
title,
|
|
|
valueRender,
|
|
|
prefix,
|
|
|
suffix,
|
|
|
loading = false,
|
|
|
onMouseEnter,
|
|
|
onMouseLeave,
|
|
|
decimalSeparator = '.',
|
|
|
groupSeparator = ','
|
|
|
} = props;
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
statistic
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const prefixCls = getPrefixCls('statistic', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = statistic_style(prefixCls);
|
|
|
const valueNode = /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Number, Object.assign({
|
|
|
decimalSeparator: decimalSeparator,
|
|
|
groupSeparator: groupSeparator,
|
|
|
prefixCls: prefixCls
|
|
|
}, props, {
|
|
|
value: value
|
|
|
}));
|
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, statistic === null || statistic === void 0 ? void 0 : statistic.className, className, rootClassName, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: cls,
|
|
|
style: Object.assign(Object.assign({}, statistic === null || statistic === void 0 ? void 0 : statistic.style), style),
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave
|
|
|
}, title && /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: `${prefixCls}-title`
|
|
|
}, title), /*#__PURE__*/_react_17_0_2_react.createElement(skeleton/* default */.Z, {
|
|
|
paragraph: false,
|
|
|
loading: loading,
|
|
|
className: `${prefixCls}-skeleton`
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
style: valueStyle,
|
|
|
className: `${prefixCls}-content`
|
|
|
}, prefix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-content-prefix`
|
|
|
}, prefix), valueRender ? valueRender(valueNode) : valueNode, suffix && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${prefixCls}-content-suffix`
|
|
|
}, suffix)))));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var statistic_Statistic = (Statistic);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/utils.js
|
|
|
// Countdown
|
|
|
const timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], ['M', 1000 * 60 * 60 * 24 * 30], ['D', 1000 * 60 * 60 * 24], ['H', 1000 * 60 * 60], ['m', 1000 * 60], ['s', 1000], ['S', 1] // million seconds
|
|
|
];
|
|
|
|
|
|
function formatTimeStr(duration, format) {
|
|
|
let leftDuration = duration;
|
|
|
const escapeRegex = /\[[^\]]*]/g;
|
|
|
const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
|
|
|
const templateText = format.replace(escapeRegex, '[]');
|
|
|
const replacedText = timeUnits.reduce((current, _ref) => {
|
|
|
let [name, unit] = _ref;
|
|
|
if (current.includes(name)) {
|
|
|
const value = Math.floor(leftDuration / unit);
|
|
|
leftDuration -= value * unit;
|
|
|
return current.replace(new RegExp(`${name}+`, 'g'), match => {
|
|
|
const len = match.length;
|
|
|
return value.toString().padStart(len, '0');
|
|
|
});
|
|
|
}
|
|
|
return current;
|
|
|
}, templateText);
|
|
|
let index = 0;
|
|
|
return replacedText.replace(escapeRegex, () => {
|
|
|
const match = keepList[index];
|
|
|
index += 1;
|
|
|
return match;
|
|
|
});
|
|
|
}
|
|
|
function formatCountdown(value, config) {
|
|
|
const {
|
|
|
format = ''
|
|
|
} = config;
|
|
|
const target = new Date(value).getTime();
|
|
|
const current = Date.now();
|
|
|
const diff = Math.max(target - current, 0);
|
|
|
return formatTimeStr(diff, format);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/Countdown.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const REFRESH_INTERVAL = 1000 / 30;
|
|
|
function getTime(value) {
|
|
|
return new Date(value).getTime();
|
|
|
}
|
|
|
const Countdown = props => {
|
|
|
const {
|
|
|
value,
|
|
|
format = 'HH:mm:ss',
|
|
|
onChange,
|
|
|
onFinish
|
|
|
} = props;
|
|
|
const forceUpdate = (0,useForceUpdate/* default */.Z)();
|
|
|
const countdown = _react_17_0_2_react.useRef(null);
|
|
|
const stopTimer = () => {
|
|
|
onFinish === null || onFinish === void 0 ? void 0 : onFinish();
|
|
|
if (countdown.current) {
|
|
|
clearInterval(countdown.current);
|
|
|
countdown.current = null;
|
|
|
}
|
|
|
};
|
|
|
const syncTimer = () => {
|
|
|
const timestamp = getTime(value);
|
|
|
if (timestamp >= Date.now()) {
|
|
|
countdown.current = setInterval(() => {
|
|
|
forceUpdate();
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(timestamp - Date.now());
|
|
|
if (timestamp < Date.now()) {
|
|
|
stopTimer();
|
|
|
}
|
|
|
}, REFRESH_INTERVAL);
|
|
|
}
|
|
|
};
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
syncTimer();
|
|
|
return () => {
|
|
|
if (countdown.current) {
|
|
|
clearInterval(countdown.current);
|
|
|
countdown.current = null;
|
|
|
}
|
|
|
};
|
|
|
}, [value]);
|
|
|
const formatter = (formatValue, config) => formatCountdown(formatValue, Object.assign(Object.assign({}, config), {
|
|
|
format
|
|
|
}));
|
|
|
const valueRender = node => (0,reactNode/* cloneElement */.Tm)(node, {
|
|
|
title: undefined
|
|
|
});
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(statistic_Statistic, Object.assign({}, props, {
|
|
|
valueRender: valueRender,
|
|
|
formatter: formatter
|
|
|
}));
|
|
|
};
|
|
|
/* harmony default export */ var statistic_Countdown = (/*#__PURE__*/_react_17_0_2_react.memo(Countdown));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/statistic/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
statistic_Statistic.Countdown = statistic_Countdown;
|
|
|
/* harmony default export */ var es_statistic = (statistic_Statistic);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |