Auto Submit

dev_local_v9_xiangongyedaxue
autosubmit 2 years ago
parent 9cd9b47e2a
commit cfe4e11a60

@ -598,7 +598,8 @@ var ButtonLoading = function ButtonLoading(_ref) {
_ref$hackidentifier = _ref.hackidentifier,
hackidentifier = _ref$hackidentifier === void 0 ? "" : _ref$hackidentifier,
_ref$items = _ref.items,
items = _ref$items === void 0 ? {} : _ref$items;
items = _ref$items === void 0 ? {} : _ref$items,
setIsSubmitCode = _ref.setIsSubmitCode;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
isloading = _useState2[0],
@ -743,7 +744,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
if (!(ButtonText === '提交代码')) {
_context3.next = 20;
_context3.next = 21;
break;
}
setisloading(true);
@ -837,10 +838,11 @@ var ButtonLoading = function ButtonLoading(_ref) {
case 18:
setisloading(false);
case 19:
!!setIsSubmitCode && setIsSubmitCode(true);
return _context3.abrupt("return");
case 20:
case 21:
aa = true;
_context3.next = 23;
_context3.next = 24;
return form.validateFields().then(function () {
aa = false;
}, function (errInfo) {
@ -859,27 +861,27 @@ var ButtonLoading = function ButtonLoading(_ref) {
});
aa = true;
});
case 23:
case 24:
if (!aa) {
_context3.next = 25;
_context3.next = 26;
break;
}
return _context3.abrupt("return");
case 25:
case 26:
setisloading(true);
if (!isloading) {
_context3.next = 28;
_context3.next = 29;
break;
}
return _context3.abrupt("return");
case 28:
case 29:
res = '';
formValues = form.getFieldsValue();
if (identifier) {
_context3.next = 39;
_context3.next = 40;
break;
}
_context3.next = 33;
_context3.next = 34;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems.json", {
method: 'post',
body: _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
@ -895,15 +897,15 @@ var ButtonLoading = function ButtonLoading(_ref) {
is_blank: true
})
});
case 33:
case 34:
res = _context3.sent;
identifier = (_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.identifier;
sessionStorage.projectFill = identifier;
setidentifier(identifier);
_context3.next = 42;
_context3.next = 43;
break;
case 39:
_context3.next = 41;
case 40:
_context3.next = 42;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, ".json"), {
method: 'put',
body: _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
@ -919,21 +921,21 @@ var ButtonLoading = function ButtonLoading(_ref) {
is_blank: true
})
});
case 41:
res = _context3.sent;
case 42:
_context3.next = 44;
res = _context3.sent;
case 43:
_context3.next = 45;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, "/start.json"), {
method: 'get'
});
case 44:
case 45:
res1 = _context3.sent;
_context3.next = 47;
_context3.next = 48;
return onUpdateCode(null, res1 === null || res1 === void 0 ? void 0 : res1.identifier);
case 47:
case 48:
response = _context3.sent;
if (!((response === null || response === void 0 ? void 0 : response.status) === 0)) {
_context3.next = 56;
_context3.next = 57;
break;
}
_executeCode = /*#__PURE__*/function () {
@ -990,15 +992,15 @@ var ButtonLoading = function ButtonLoading(_ref) {
};
}();
_startTime = getTimeStamp();
_context3.next = 53;
_context3.next = 54;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .sumbitCode */ .bM)(res1 === null || res1 === void 0 ? void 0 : res1.identifier, {});
case 53:
case 54:
_executeCode();
_context3.next = 57;
_context3.next = 58;
break;
case 56:
setisloading(false);
case 57:
setisloading(false);
case 58:
case "end":
return _context3.stop();
}

@ -25,7 +25,7 @@
display: block !important;
}
</style><script>if(document.domain !== "www.educoder.net") document.title = '';</script>
<script src="/react/build/umi.6121bac5.js"></script>
<script src="/react/build/umi.34922aeb.js"></script>
<script src="/react/build/js/public.js"></script>
</body></html>

@ -102,7 +102,8 @@ var ButtonLoading = function ButtonLoading(_ref) {
_ref$hackidentifier = _ref.hackidentifier,
hackidentifier = _ref$hackidentifier === void 0 ? "" : _ref$hackidentifier,
_ref$items = _ref.items,
items = _ref$items === void 0 ? {} : _ref$items;
items = _ref$items === void 0 ? {} : _ref$items,
setIsSubmitCode = _ref.setIsSubmitCode;
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_5__.useState)(false),
_useState2 = _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState, 2),
isloading = _useState2[0],
@ -247,7 +248,7 @@ var ButtonLoading = function ButtonLoading(_ref) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
if (!(ButtonText === '提交代码')) {
_context3.next = 20;
_context3.next = 21;
break;
}
setisloading(true);
@ -341,10 +342,11 @@ var ButtonLoading = function ButtonLoading(_ref) {
case 18:
setisloading(false);
case 19:
!!setIsSubmitCode && setIsSubmitCode(true);
return _context3.abrupt("return");
case 20:
case 21:
aa = true;
_context3.next = 23;
_context3.next = 24;
return form.validateFields().then(function () {
aa = false;
}, function (errInfo) {
@ -363,27 +365,27 @@ var ButtonLoading = function ButtonLoading(_ref) {
});
aa = true;
});
case 23:
case 24:
if (!aa) {
_context3.next = 25;
_context3.next = 26;
break;
}
return _context3.abrupt("return");
case 25:
case 26:
setisloading(true);
if (!isloading) {
_context3.next = 28;
_context3.next = 29;
break;
}
return _context3.abrupt("return");
case 28:
case 29:
res = '';
formValues = form.getFieldsValue();
if (identifier) {
_context3.next = 39;
_context3.next = 40;
break;
}
_context3.next = 33;
_context3.next = 34;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems.json", {
method: 'post',
body: _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
@ -399,15 +401,15 @@ var ButtonLoading = function ButtonLoading(_ref) {
is_blank: true
})
});
case 33:
case 34:
res = _context3.sent;
identifier = (_res2 = res) === null || _res2 === void 0 ? void 0 : _res2.identifier;
sessionStorage.projectFill = identifier;
setidentifier(identifier);
_context3.next = 42;
_context3.next = 43;
break;
case 39:
_context3.next = 41;
case 40:
_context3.next = 42;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, ".json"), {
method: 'put',
body: _root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()(_root_workspace_ppte5yg23_local_v9_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0___default()({}, formValues), {}, {
@ -423,21 +425,21 @@ var ButtonLoading = function ButtonLoading(_ref) {
is_blank: true
})
});
case 41:
res = _context3.sent;
case 42:
_context3.next = 44;
res = _context3.sent;
case 43:
_context3.next = 45;
return (0,_utils_fetch__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .ZP)("/api/problems/".concat(identifier, "/start.json"), {
method: 'get'
});
case 44:
case 45:
res1 = _context3.sent;
_context3.next = 47;
_context3.next = 48;
return onUpdateCode(null, res1 === null || res1 === void 0 ? void 0 : res1.identifier);
case 47:
case 48:
response = _context3.sent;
if (!((response === null || response === void 0 ? void 0 : response.status) === 0)) {
_context3.next = 56;
_context3.next = 57;
break;
}
_executeCode = /*#__PURE__*/function () {
@ -494,15 +496,15 @@ var ButtonLoading = function ButtonLoading(_ref) {
};
}();
_startTime = getTimeStamp();
_context3.next = 53;
_context3.next = 54;
return (0,_pages_MyProblem_service__WEBPACK_IMPORTED_MODULE_8__/* .sumbitCode */ .bM)(res1 === null || res1 === void 0 ? void 0 : res1.identifier, {});
case 53:
case 54:
_executeCode();
_context3.next = 57;
_context3.next = 58;
break;
case 56:
setisloading(false);
case 57:
setisloading(false);
case 58:
case "end":
return _context3.stop();
}
@ -1419,13 +1421,13 @@ var BFill = function BFill(_ref) {
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
fontSize: 14,
color: '#F19417'
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"
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: {

@ -2460,6 +2460,8 @@ var SeeAnswer = __webpack_require__(89761);
var componentmodules = __webpack_require__(13706);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(41686);
// EXTERNAL MODULE: ./node_modules/_js-base64@2.6.4@js-base64/base64.js
var base64 = __webpack_require__(24334);
// 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/Review/component/BFill.tsx
@ -2478,6 +2480,7 @@ var jsx_runtime = __webpack_require__(37712);
var TextArea = input/* default */.Z.TextArea;
var BFill = function BFill(_ref) {
var _datas$records, _item$submit_records;
var item = _ref.item,
answerData = _ref.answerData,
changeScoreData = _ref.changeScoreData,
@ -2502,6 +2505,78 @@ var BFill = function BFill(_ref) {
_useState8 = slicedToArray_default()(_useState7, 2),
datas = _useState8[0],
setdatas = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)({
page: 1,
limit: 5
}),
_useState10 = slicedToArray_default()(_useState9, 2),
urlData = _useState10[0],
setUrlData = _useState10[1];
var columns1 = [{
title: '序号',
width: 80,
dataIndex: 'index'
}, {
title: '学生答案',
width: "40%",
dataIndex: 'answer_content',
render: function render(text) {
return text === null || text === void 0 ? void 0 : text.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("pre", {
style: {
whiteSpace: 'pre-wrap'
},
children: [item === null || item === void 0 ? void 0 : item.name, ":", item === null || item === void 0 ? void 0 : item.value]
}, index);
});
}
}, {
title: '评测结果',
dataIndex: 'evaluate_status'
}, {
title: '评测时间',
width: 110,
dataIndex: 'evaluate_time'
}, {
title: '得分',
width: 80,
dataIndex: 'score'
}];
var columns2 = [{
title: '序号',
width: 80,
dataIndex: 'index'
}, {
title: '学生答案',
width: (datas === null || datas === void 0 || (_datas$records = datas.records) === null || _datas$records === void 0 ? void 0 : _datas$records.every(function (k) {
return !(k !== null && k !== void 0 && k.is_new);
})) && 80,
dataIndex: 'answer_content',
render: function render(text, record) {
return text === null || text === void 0 ? void 0 : text.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("pre", {
style: {
whiteSpace: 'pre-wrap'
},
children: [item === null || item === void 0 ? void 0 : item.name, ":", item === null || item === void 0 ? void 0 : item.value]
}, index);
});
}
}, {
title: '评测结果',
dataIndex: 'evaluate_status',
render: function render(text, record) {
return record !== null && record !== void 0 && record.is_new ? text : base64.Base64.decode(text);
}
}, {
title: '评测时间',
width: 110,
dataIndex: 'evaluate_time'
}, {
title: '得分',
width: 80,
dataIndex: 'score'
}];
(0,_react_17_0_2_react.useEffect)(function () {
if (changeScoreData !== null && changeScoreData !== void 0 && changeScoreData[item.q_position]) {
!showEdit && setShowEdit(true);
@ -2520,6 +2595,37 @@ var BFill = function BFill(_ref) {
});
setUserAnswer(data);
}, [item === null || item === void 0 ? void 0 : item.user_answer]);
(0,_react_17_0_2_react.useEffect)(function () {
isshow && getSubmitRecords();
}, [urlData]);
var getSubmitRecords = /*#__PURE__*/function () {
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,fetch/* default */.ZP)("/api/myproblems/".concat(item === null || item === void 0 ? void 0 : item.hack_user_identifier, "/exercise_submit_records.json"), {
params: {
exercise_question_id: item === null || item === void 0 ? void 0 : item.question_id
}
});
case 2:
res = _context.sent;
// let res = await Fetch(`/api/myproblems/${item?.hack_user_identifier}/submit_records.json`, {
// method: 'get',
// })
setdatas(res);
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return function getSubmitRecords() {
return _ref2.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: componentmodules/* default */.Z.fillBg,
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
@ -2534,42 +2640,26 @@ var BFill = function BFill(_ref) {
style: {
cursor: 'pointer'
},
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res, _res$records;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
if (item !== null && item !== void 0 && item.hack_user_identifier) {
_context.next = 3;
_context2.next = 3;
break;
}
message/* default */.ZP.info("当前学生暂无评测记录");
return _context.abrupt("return");
return _context2.abrupt("return");
case 3:
_context.next = 5;
return (0,fetch/* default */.ZP)("/api/myproblems/".concat(item === null || item === void 0 ? void 0 : item.hack_user_identifier, "/submit_records.json"), {
method: 'get'
});
case 5:
res = _context.sent;
if (!res) {
_context.next = 12;
break;
}
if (!((res === null || res === void 0 || (_res$records = res.records) === null || _res$records === void 0 ? void 0 : _res$records.length) === 0)) {
_context.next = 10;
break;
}
message/* default */.ZP.info("当前学生暂无评测记录");
return _context.abrupt("return");
case 10:
setisshow(true);
setdatas(res === null || res === void 0 ? void 0 : res.records);
case 12:
setUrlData(objectSpread2_default()(objectSpread2_default()({}, urlData), {}, {
page: 1
}));
case 5:
case "end":
return _context.stop();
return _context2.stop();
}
}, _callee);
}, _callee2);
})),
className: "font14 c-light-primary mb5",
children: "\u67E5\u770B\u8BC4\u6D4B\u8BB0\u5F55"
@ -2598,39 +2688,37 @@ var BFill = function BFill(_ref) {
});
}), seeAnswerVisible && /*#__PURE__*/(0,jsx_runtime.jsx)(SeeAnswer/* SeeAnswer */.u, {
data: item
}), !!(item !== null && item !== void 0 && (_item$submit_records = item.submit_records) !== null && _item$submit_records !== void 0 && _item$submit_records.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
className: "mt20",
dataSource: item === null || item === void 0 ? void 0 : item.submit_records,
columns: columns1,
pagination: false
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_modal/* default */.Z, {
title: "\u8BC4\u6D4B\u8BB0\u5F55",
open: isshow,
footer: false,
centered: true,
width: 900,
onCancel: function onCancel() {
setisshow(false);
},
width: 700,
children: /*#__PURE__*/(0,jsx_runtime.jsx)(table/* default */.Z, {
scroll: {
y: 400
},
dataSource: datas,
columns: [{
title: '评测序号',
dataIndex: 'name',
render: function render(text, record, index) {
return index + 1;
}
}, {
title: '评测时间',
dataIndex: 'created_at',
render: function render(text, record, index) {
return dayjs_min_default()(text).format('YYYY-MM-DD HH:mm');
}
}, {
title: '评测结果',
dataIndex: 'error_msg',
render: function render(text, record, index) {
return Base64.decode(text);
dataSource: datas === null || datas === void 0 ? void 0 : datas.records,
columns: columns2,
pagination: {
current: urlData.page,
pageSize: urlData.limit,
total: datas === null || datas === void 0 ? void 0 : datas.records_count,
onChange: function onChange(page, limit) {
setUrlData(objectSpread2_default()(objectSpread2_default()({}, urlData), {}, {
page: page,
limit: limit
}));
}
}]
}
})
})]
});
@ -3380,8 +3468,6 @@ var ScoreModal = function ScoreModal(_ref, ref) {
};
/* harmony default export */ var component_ScoreModal = (/*#__PURE__*/(0,_react_17_0_2_react.forwardRef)(ScoreModal));
;
// 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/Review/component/NewProgram.tsx

@ -3809,7 +3809,10 @@ function MyProblem_reducer(state, action) {
icon: null,
title: '提示',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: "\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"
style: {
color: "#FF0000"
},
children: "\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u662F\u5426\u8FDB\u884C\u8BC4\u6D4B\u5E76\u63D0\u4EA4\uFF0C\u672A\u8BC4\u6D4B\u5219\u4F1A\u5BFC\u81F4\u8BE5\u9898\u65E0\u6CD5\u83B7\u5F97\u5206\u6570"
}),
onOk: function onOk() {
// window.close()

@ -9757,8 +9757,10 @@ function TipContent() {
cancelText: '取消',
title: '提示',
content: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "tc",
children: "\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"
style: {
color: "#FF0000"
},
children: "\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u662F\u5426\u8FDB\u884C\u8BC4\u6D4B\u5E76\u63D0\u4EA4\uFF0C\u672A\u8BC4\u6D4B\u5219\u4F1A\u5BFC\u81F4\u8BE5\u9898\u65E0\u6CD5\u83B7\u5F97\u5206\u6570"
}),
onOk: function onOk() {
// window.close()

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save