Auto Submit

dev_local_v9_haijunshiguan_net
autosubmit 2 years ago
parent ea20082c5f
commit f2c31f5975

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

@ -3100,7 +3100,6 @@ var _excluded = ["globalSetting", "loading", "user", "exercise", "dispatch"];
var Countdown = statistic/* default */.Z.Countdown;
@ -3110,7 +3109,7 @@ var Answer_scoreStatusMapping = {
1: 'c-green'
};
var Answer = function Answer(_ref) {
var _answerData$exercise5, _answerData$exercise6, _answerData$exercise7, _answerData$exercise8, _answerData$exercise9, _answerData$question_5, _answerData$exercise_17, _answerData$question_6, _answerData$exercise_18, _answerData$exercise_19, _answerData$exercise_20, _answerData$exercise_21, _answerData$exercise_22, _answerData$exercise10, _answerData$exercise_23, _answerData$exercise_24, _answerData$exercise_26, _answerData$exercise_27, _answerData$exercise_28;
var _answerData$exercise6, _answerData$exercise7, _answerData$exercise8, _answerData$exercise9, _answerData$exercise10, _answerData$question_5, _answerData$exercise_18, _answerData$question_6, _answerData$exercise_19, _answerData$exercise_20, _answerData$exercise_21, _answerData$exercise_22, _answerData$exercise_23, _answerData$exercise11, _answerData$exercise_24, _answerData$exercise_25, _answerData$exercise_27, _answerData$exercise_28, _answerData$exercise_29;
var globalSetting = _ref.globalSetting,
loading = _ref.loading,
user = _ref.user,
@ -3192,7 +3191,11 @@ var Answer = function Answer(_ref) {
_useState34 = slicedToArray_default()(_useState33, 2),
itemBankData = _useState34[0],
setItemBankData = _useState34[1]; //推荐知识题目
var _useState35 = (0,_react_17_0_2_react.useState)(true),
_useState36 = slicedToArray_default()(_useState35, 2),
showBtn = _useState36[0],
setShowBtn = _useState36[1];
var divRef = (0,_react_17_0_2_react.useRef)(null);
var questionPartRef = (0,_react_17_0_2_react.useRef)();
(0,Hooks/* useDisableAction */.y)((0,authority/* isStudent */.dE)());
var clearCountdownTimeout = (0,useRemindModal/* useRemindModal */._)(answerData);
@ -3555,44 +3558,27 @@ var Answer = function Answer(_ref) {
return _ref6.apply(this, arguments);
};
}();
var handleChangeSingle = /*#__PURE__*/function () {
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(value, id, key, item) {
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
if (!(item.question_type == 'SINGLE')) {
_context8.next = 4;
break;
}
_context8.next = 3;
return updateSuggestAnswer(value, id);
case 3:
return _context8.abrupt("return");
case 4:
//答题卡选中
answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = value ? 1 : 0;
item.user_answer = [];
item.user_answer.push(value);
setAnswerData(objectSpread2_default()({}, answerData));
setShowConfirm(true);
case 9:
case "end":
return _context8.stop();
}
}, _callee8);
}));
return function handleChangeSingle(_x4, _x5, _x6, _x7) {
return _ref7.apply(this, arguments);
};
}();
var handleChangeSingle = function handleChangeSingle(value, id, key, item) {
if (item.question_type == 'SINGLE') {
updateSuggestAnswer(value, id);
return;
}
//答题卡选中
answerData.question_status.find(function (item) {
return item.ques_id === id;
}).ques_status = value ? 1 : 0;
item.user_answer = [];
item.user_answer.push(value);
setAnswerData(objectSpread2_default()({}, answerData));
setShowConfirm(true);
};
var handleChangeSingles = /*#__PURE__*/function () {
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(value, id, key, item, items) {
var _ref7 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8(value, id, key, item, items) {
var _items$sub_exercise_q, _items$sub_exercise_q2, _items$sub_exercise_q3;
var answer;
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
item.user_answer = [];
item.user_answer.push(value);
@ -3607,12 +3593,12 @@ var Answer = function Answer(_ref) {
setAnswerData(objectSpread2_default()({}, answerData));
case 6:
case "end":
return _context9.stop();
return _context8.stop();
}
}, _callee9);
}, _callee8);
}));
return function handleChangeSingles(_x8, _x9, _x10, _x11, _x12) {
return _ref8.apply(this, arguments);
return function handleChangeSingles(_x4, _x5, _x6, _x7, _x8) {
return _ref7.apply(this, arguments);
};
}();
var handleChangeMultiple = function handleChangeMultiple(value, id, item) {
@ -3624,17 +3610,17 @@ var Answer = function Answer(_ref) {
setAnswerData(objectSpread2_default()({}, answerData));
};
var handleBlurFill = /*#__PURE__*/function () {
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10(value, index, id, param, item) {
var _ref8 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee9(value, index, id, param, item) {
var answers;
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
return regeneratorRuntime_default()().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
if (value.replaceAll(' ', '')) {
_context10.next = 3;
_context9.next = 3;
break;
}
signConfigFuc();
return _context10.abrupt("return", {
return _context9.abrupt("return", {
status: -4,
message: '答案不能为空'
});
@ -3662,25 +3648,25 @@ var Answer = function Answer(_ref) {
setAnswerData(objectSpread2_default()({}, answerData));
setShowConfirm(true);
signConfigFuc();
return _context10.abrupt("return", {
return _context9.abrupt("return", {
status: 1,
message: ''
});
case 10:
case "end":
return _context10.stop();
return _context9.stop();
}
}, _callee10);
}, _callee9);
}));
return function handleBlurFill(_x13, _x14, _x15, _x16, _x17) {
return _ref9.apply(this, arguments);
return function handleBlurFill(_x9, _x10, _x11, _x12, _x13) {
return _ref8.apply(this, arguments);
};
}();
var handleBlurBProgram = /*#__PURE__*/function () {
var _ref10 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11(value, index, id, param, item) {
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee10(value, index, id, param, item) {
var answers;
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
return regeneratorRuntime_default()().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
answerData.question_status.find(function (item) {
return item.ques_id === id;
@ -3708,12 +3694,12 @@ var Answer = function Answer(_ref) {
setAnswerData(objectSpread2_default()({}, answerData));
case 5:
case "end":
return _context11.stop();
return _context10.stop();
}
}, _callee11);
}, _callee10);
}));
return function handleBlurBProgram(_x18, _x19, _x20, _x21, _x22) {
return _ref10.apply(this, arguments);
return function handleBlurBProgram(_x14, _x15, _x16, _x17, _x18) {
return _ref9.apply(this, arguments);
};
}();
var handleBlurSimple = function handleBlurSimple(value, id, item, hideLoading) {
@ -3734,11 +3720,11 @@ var Answer = function Answer(_ref) {
setItemBankData(function (e) {
var arr = e.map(function (item) {
if ((item === null || item === void 0 ? void 0 : item.question_id) == id) {
e.user_answer = [];
e.user_answer.push(value);
item.user_answer = [];
item.user_answer.push(value);
}
return item;
});
console.log("Arr", arr);
return arr;
});
};
@ -4124,22 +4110,22 @@ var Answer = function Answer(_ref) {
return _setKnowledgeDialog(true);
},
onBlur: ( /*#__PURE__*/function () {
var _ref11 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12(value, index, userAnswer) {
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
var _ref10 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee11(value, index, userAnswer) {
return regeneratorRuntime_default()().wrap(function _callee11$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
case 0:
_context12.next = 2;
_context11.next = 2;
return handleBlurFill(value, index, item === null || item === void 0 ? void 0 : item.question_id, userAnswer, item);
case 2:
return _context12.abrupt("return", _context12.sent);
return _context11.abrupt("return", _context11.sent);
case 3:
case "end":
return _context12.stop();
return _context11.stop();
}
}, _callee12);
}, _callee11);
}));
return function (_x23, _x24, _x25) {
return _ref11.apply(this, arguments);
return function (_x19, _x20, _x21) {
return _ref10.apply(this, arguments);
};
}())
});
@ -4191,22 +4177,22 @@ var Answer = function Answer(_ref) {
item: item,
answerData: answerData,
onBlur: ( /*#__PURE__*/function () {
var _ref12 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13(value, index, userAnswer) {
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
var _ref11 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee12(value, index, userAnswer) {
return regeneratorRuntime_default()().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
_context13.next = 2;
_context12.next = 2;
return handleBlurBProgram(value, index, item === null || item === void 0 ? void 0 : item.question_id, userAnswer, item);
case 2:
return _context13.abrupt("return", _context13.sent);
return _context12.abrupt("return", _context12.sent);
case 3:
case "end":
return _context13.stop();
return _context12.stop();
}
}, _callee13);
}, _callee12);
}));
return function (_x26, _x27, _x28) {
return _ref12.apply(this, arguments);
return function (_x22, _x23, _x24) {
return _ref11.apply(this, arguments);
};
}())
});
@ -4331,19 +4317,19 @@ var Answer = function Answer(_ref) {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
type: "primary",
className: Answermodules.toIframeBtn,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee13() {
return regeneratorRuntime_default()().wrap(function _callee13$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
case 0:
_context14.next = 2;
_context13.next = 2;
return handleJoinShixun(item);
case 2:
return _context14.abrupt("return", _context14.sent);
return _context13.abrupt("return", _context13.sent);
case 3:
case "end":
return _context14.stop();
return _context13.stop();
}
}, _callee14);
}, _callee13);
})),
children: "\u8FDB\u5165\u7B54\u9898"
})
@ -4523,11 +4509,11 @@ var Answer = function Answer(_ref) {
switch (sign.current) {
case "prev":
skipPrevQuestion();
setItemBankData([]);
initRecommend();
break;
case "next":
skipNextQuestion();
setItemBankData([]);
initRecommend();
break;
case "appoint":
skipAppointQuestion();
@ -4544,6 +4530,12 @@ var Answer = function Answer(_ref) {
}
skipData.current = {};
};
// 初始化推荐题目
var initRecommend = function initRecommend() {
setItemBankData([]);
setShowBtn(true);
};
var renderClassifyQuestion = function renderClassifyQuestion() {
var _answerData$exercise_10, _answerData$exercise_11, _answerData$exercise_12, _answerData$exercise_13, _answerData$exercise_14, _answerData$exercise_15;
var currentItem = answerData === null || answerData === void 0 || (_answerData$exercise_10 = answerData.exercise_question_types) === null || _answerData$exercise_10 === void 0 || (_answerData$exercise_10 = _answerData$exercise_10[oneindex].items) === null || _answerData$exercise_10 === void 0 ? void 0 : _answerData$exercise_10[twoindex];
@ -4570,20 +4562,20 @@ var Answer = function Answer(_ref) {
}, oneindex);
};
var submitAnswer = /*#__PURE__*/function () {
var _ref14 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15() {
var _ref13 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee14() {
var _answerData$exercise_16;
var currentInfo, query, _currentInfo$user_ans, res, _res$data;
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
var currentInfo, paramsData, _currentInfo$user_ans, res, _res$data;
return regeneratorRuntime_default()().wrap(function _callee14$(_context14) {
while (1) switch (_context14.prev = _context14.next) {
case 0:
currentInfo = (_answerData$exercise_16 = answerData.exercise_question_types) === null || _answerData$exercise_16 === void 0 || (_answerData$exercise_16 = _answerData$exercise_16[oneindex]) === null || _answerData$exercise_16 === void 0 || (_answerData$exercise_16 = _answerData$exercise_16.items) === null || _answerData$exercise_16 === void 0 ? void 0 : _answerData$exercise_16[twoindex];
query = {
paramsData = {
questionId: currentInfo.question_id,
exercise_choice_id: [0, 1, 2].includes(currentInfo.question_type) ? currentInfo.user_answer : null
};
if (currentInfo.question_type == 3) {
// 填空题
query.answers = currentInfo.user_answer.map(function (item) {
paramsData.answers = currentInfo.user_answer.map(function (item) {
return {
exercise_choice_id: item === null || item === void 0 ? void 0 : item.choice_id,
answer_text: item === null || item === void 0 ? void 0 : item.answer_text
@ -4591,23 +4583,23 @@ var Answer = function Answer(_ref) {
});
} else if (currentInfo.question_type == 4) {
//简答题
query.answer_text = currentInfo === null || currentInfo === void 0 || (_currentInfo$user_ans = currentInfo.user_answer) === null || _currentInfo$user_ans === void 0 ? void 0 : _currentInfo$user_ans[0];
paramsData.answer_text = currentInfo === null || currentInfo === void 0 || (_currentInfo$user_ans = currentInfo.user_answer) === null || _currentInfo$user_ans === void 0 ? void 0 : _currentInfo$user_ans[0];
} else if (currentInfo.question_type == 7) {
//组合题
query.answers = currentInfo.sub_exercise_questions.map(function (item) {
paramsData.answers = currentInfo.sub_exercise_questions.map(function (item) {
return {
exercise_choice_id: item === null || item === void 0 ? void 0 : item.question_id,
answer_text: item === null || item === void 0 ? void 0 : item.user_answer
};
});
}
_context15.next = 5;
_context14.next = 5;
return (0,fetch/* default */.ZP)("/api/exercise_questions/".concat(currentInfo.question_id, "/exercise_answers/subject_exercise_answer.json"), {
method: 'POST',
body: query
body: paramsData
});
case 5:
res = _context15.sent;
res = _context14.sent;
if (res.status == 0) {
setItemBankData(res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.item_bank_data);
setShowConfirm(false);
@ -4615,45 +4607,76 @@ var Answer = function Answer(_ref) {
}
case 7:
case "end":
return _context15.stop();
return _context14.stop();
}
}, _callee15);
}, _callee14);
}));
return function submitAnswer() {
return _ref14.apply(this, arguments);
return _ref13.apply(this, arguments);
};
}();
var submitAnswer2 = /*#__PURE__*/function () {
var _ref15 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16(item) {
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
var _ref14 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee15() {
var _answerData$exercise_17, _paramsData$item_bank, _answerData$exercise5;
var currentInfo, paramsData, _paramsData$item_bank2, res;
return regeneratorRuntime_default()().wrap(function _callee15$(_context15) {
while (1) switch (_context15.prev = _context15.next) {
case 0:
// console.log("item", item);
itemBankData.forEach(function (val) {
if (val.question_id === (item === null || item === void 0 ? void 0 : item.question_id)) {
console.log('val', val);
currentInfo = (_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 ? void 0 : _answerData$exercise_17[twoindex];
paramsData = {
exercise_question_id: currentInfo.question_id,
// 练习题目得id
item_banks: [] // 被推荐题目数据
};
itemBankData.forEach(function (item) {
var _item$user_answer3;
if (item !== null && item !== void 0 && item.user_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) {
paramsData === null || paramsData === void 0 || paramsData.item_banks.push({
item_bank_id: item === null || item === void 0 ? void 0 : item.question_id,
choice_id: ['SINGLE', 'MULTIPLE', 'JUDGMENT'].includes(item === null || item === void 0 ? void 0 : item.question_type) ? item === null || item === void 0 ? void 0 : item.user_answer : null
});
}
});
// const currentItem = answerData?.exercise_question_types?.[oneindex].items?.[twoindex]
// const res = await Fetch(`/api/subject_exercises/${params.exerciseId}/answer.json`, {
// method: 'post',
// body: {
// exercise_question_id: params.question_id,
// item_banks: {
// item_bank_id: currentItem?.question_id,
// choice_id: [0, 1, 2].includes(currentItem.question_type) ? currentItem.user_answer : null
// }
// }
// })
case 1:
if (!((itemBankData === null || itemBankData === void 0 ? void 0 : itemBankData.length) > (paramsData === null || paramsData === void 0 || (_paramsData$item_bank = paramsData.item_banks) === null || _paramsData$item_bank === void 0 ? void 0 : _paramsData$item_bank.length))) {
_context15.next = 6;
break;
}
message/* default */.ZP.error("\u8FD8\u6709".concat((itemBankData === null || itemBankData === void 0 ? void 0 : itemBankData.length) - (paramsData === null || paramsData === void 0 || (_paramsData$item_bank2 = paramsData.item_banks) === null || _paramsData$item_bank2 === void 0 ? void 0 : _paramsData$item_bank2.length), "\u9898\u6CA1\u6709\u4F5C\u7B54\uFF01"));
return _context15.abrupt("return");
case 6:
_context15.next = 8;
return (0,fetch/* default */.ZP)("/api/subject_exercises/".concat(answerData === null || answerData === void 0 || (_answerData$exercise5 = answerData.exercise) === null || _answerData$exercise5 === void 0 ? void 0 : _answerData$exercise5.subject_exercise_id, "/answer.json"), {
method: 'post',
body: paramsData
});
case 8:
res = _context15.sent;
if (res.status == 0) {
setItemBankData(function (e) {
var arr = e.map(function (item) {
res.data.forEach(function (item2) {
var _item;
if ((item2 === null || item2 === void 0 ? void 0 : item2.item_bank_id) == ((_item = item) === null || _item === void 0 ? void 0 : _item.question_id)) {
item.user_score = item2 !== null && item2 !== void 0 && item2.is_right ? 1 : 0;
item.question_score = 1;
item = objectSpread2_default()(objectSpread2_default()({}, item), item2);
}
});
return item;
});
return arr;
});
divRef.current.scrollTo(0, 0);
setShowBtn(false);
}
case 10:
case "end":
return _context16.stop();
return _context15.stop();
}
}, _callee16);
}, _callee15);
}));
return function submitAnswer2(_x29) {
return _ref15.apply(this, arguments);
return function submitAnswer2() {
return _ref14.apply(this, arguments);
};
}();
return /*#__PURE__*/(0,jsx_runtime.jsxs)(spin/* default */.Z, {
@ -4675,11 +4698,11 @@ var Answer = function Answer(_ref) {
align: "middle",
className: "edu-container",
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: (0,util/* exerciseTips */.vB)(answerData === null || answerData === void 0 || (_answerData$exercise5 = answerData.exercise) === null || _answerData$exercise5 === void 0 ? void 0 : _answerData$exercise5.exercise_status)
children: (0,util/* exerciseTips */.vB)(answerData === null || answerData === void 0 || (_answerData$exercise6 = answerData.exercise) === null || _answerData$exercise6 === void 0 ? void 0 : _answerData$exercise6.exercise_status)
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
className: "".concat(Answermodules.exerciseTitle, " ml10"),
title: answerData === null || answerData === void 0 || (_answerData$exercise6 = answerData.exercise) === null || _answerData$exercise6 === void 0 ? void 0 : _answerData$exercise6.subject_exercise_name,
children: answerData === null || answerData === void 0 || (_answerData$exercise7 = answerData.exercise) === null || _answerData$exercise7 === void 0 ? void 0 : _answerData$exercise7.subject_exercise_name
title: answerData === null || answerData === void 0 || (_answerData$exercise7 = answerData.exercise) === null || _answerData$exercise7 === void 0 ? void 0 : _answerData$exercise7.subject_exercise_name,
children: answerData === null || answerData === void 0 || (_answerData$exercise8 = answerData.exercise) === null || _answerData$exercise8 === void 0 ? void 0 : _answerData$exercise8.subject_exercise_name
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
style: {
marginLeft: 'auto'
@ -4727,7 +4750,7 @@ var Answer = function Answer(_ref) {
children: "\u59D3\u540D"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 ".concat(Answermodules.userInfoText),
children: (answerData === null || answerData === void 0 || (_answerData$exercise8 = answerData.exercise) === null || _answerData$exercise8 === void 0 ? void 0 : _answerData$exercise8.user_name) || '- -'
children: (answerData === null || answerData === void 0 || (_answerData$exercise9 = answerData.exercise) === null || _answerData$exercise9 === void 0 ? void 0 : _answerData$exercise9.user_name) || '- -'
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
@ -4737,7 +4760,7 @@ var Answer = function Answer(_ref) {
children: "\u5B66\u53F7"
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "ml10 ".concat(Answermodules.userInfoText),
children: (answerData === null || answerData === void 0 || (_answerData$exercise9 = answerData.exercise) === null || _answerData$exercise9 === void 0 ? void 0 : _answerData$exercise9.student_id) || '- -'
children: (answerData === null || answerData === void 0 || (_answerData$exercise10 = answerData.exercise) === null || _answerData$exercise10 === void 0 ? void 0 : _answerData$exercise10.student_id) || '- -'
})]
})]
}), showAnswerCard && /*#__PURE__*/(0,jsx_runtime.jsxs)("aside", {
@ -4761,7 +4784,7 @@ var Answer = function Answer(_ref) {
style: {
color: '#999999'
},
children: ["/", answerData === null || answerData === void 0 || (_answerData$exercise_17 = answerData.exercise_types) === null || _answerData$exercise_17 === void 0 ? void 0 : _answerData$exercise_17.q_counts]
children: ["/", answerData === null || answerData === void 0 || (_answerData$exercise_18 = answerData.exercise_types) === null || _answerData$exercise_18 === void 0 ? void 0 : _answerData$exercise_18.q_counts]
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
@ -4770,7 +4793,7 @@ var Answer = function Answer(_ref) {
trailColor: "#0000000d",
percent: (answerData === null || answerData === void 0 || (_answerData$question_6 = answerData.question_status) === null || _answerData$question_6 === void 0 || (_answerData$question_6 = _answerData$question_6.filter(function (val) {
return val.ques_status === 1;
})) === null || _answerData$question_6 === void 0 ? void 0 : _answerData$question_6.length) / (answerData === null || answerData === void 0 || (_answerData$exercise_18 = answerData.exercise_types) === null || _answerData$exercise_18 === void 0 ? void 0 : _answerData$exercise_18.q_counts) * 100,
})) === null || _answerData$question_6 === void 0 ? void 0 : _answerData$question_6.length) / (answerData === null || answerData === void 0 || (_answerData$exercise_19 = answerData.exercise_types) === null || _answerData$exercise_19 === void 0 ? void 0 : _answerData$exercise_19.q_counts) * 100,
showInfo: false
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
@ -4781,7 +4804,7 @@ var Answer = function Answer(_ref) {
style: {
color: '#165DFF'
},
children: (answerData === null || answerData === void 0 || (_answerData$exercise_19 = answerData.exercise_types) === null || _answerData$exercise_19 === void 0 ? void 0 : _answerData$exercise_19.q_counts) || (answerData === null || answerData === void 0 || (_answerData$exercise_20 = answerData.exercise_scores) === null || _answerData$exercise_20 === void 0 || (_answerData$exercise_20 = _answerData$exercise_20.exercise_types) === null || _answerData$exercise_20 === void 0 ? void 0 : _answerData$exercise_20.q_counts)
children: (answerData === null || answerData === void 0 || (_answerData$exercise_20 = answerData.exercise_types) === null || _answerData$exercise_20 === void 0 ? void 0 : _answerData$exercise_20.q_counts) || (answerData === null || answerData === void 0 || (_answerData$exercise_21 = answerData.exercise_scores) === null || _answerData$exercise_21 === void 0 || (_answerData$exercise_21 = _answerData$exercise_21.exercise_types) === null || _answerData$exercise_21 === void 0 ? void 0 : _answerData$exercise_21.q_counts)
}), " \u9898\uFF1A"]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
className: "c-grey-333",
@ -4789,7 +4812,7 @@ var Answer = function Answer(_ref) {
style: {
color: '#FA6400'
},
children: (answerData === null || answerData === void 0 || (_answerData$exercise_21 = answerData.exercise_types) === null || _answerData$exercise_21 === void 0 ? void 0 : _answerData$exercise_21.q_scores) || (answerData === null || answerData === void 0 || (_answerData$exercise_22 = answerData.exercise_scores) === null || _answerData$exercise_22 === void 0 || (_answerData$exercise_22 = _answerData$exercise_22.exercise_types) === null || _answerData$exercise_22 === void 0 ? void 0 : _answerData$exercise_22.q_scores)
children: (answerData === null || answerData === void 0 || (_answerData$exercise_22 = answerData.exercise_types) === null || _answerData$exercise_22 === void 0 ? void 0 : _answerData$exercise_22.q_scores) || (answerData === null || answerData === void 0 || (_answerData$exercise_23 = answerData.exercise_scores) === null || _answerData$exercise_23 === void 0 || (_answerData$exercise_23 = _answerData$exercise_23.exercise_types) === null || _answerData$exercise_23 === void 0 ? void 0 : _answerData$exercise_23.q_scores)
}), " \u5206"]
})]
})
@ -4809,8 +4832,8 @@ var Answer = function Answer(_ref) {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
flex: "1",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("aside", {
className: "".concat(Answermodules.cardList, " ").concat((_answerData$exercise10 = answerData.exercise) !== null && _answerData$exercise10 !== void 0 && _answerData$exercise10.open_phone_video_recording ? Answermodules.withQrcode : ''),
children: answerData === null || answerData === void 0 || (_answerData$exercise_23 = answerData.exercise_question_types) === null || _answerData$exercise_23 === void 0 ? void 0 : _answerData$exercise_23.map(function (er, index) {
className: "".concat(Answermodules.cardList, " ").concat((_answerData$exercise11 = answerData.exercise) !== null && _answerData$exercise11 !== void 0 && _answerData$exercise11.open_phone_video_recording ? Answermodules.withQrcode : ''),
children: answerData === null || answerData === void 0 || (_answerData$exercise_24 = answerData.exercise_question_types) === null || _answerData$exercise_24 === void 0 ? void 0 : _answerData$exercise_24.map(function (er, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(_react_17_0_2_react.Fragment, {
children: renderCardList(er, index)
}, er.question_type);
@ -4890,35 +4913,35 @@ var Answer = function Answer(_ref) {
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
icon: /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont ".concat((_answerData$exercise_24 = answerData.exercise_question_types) !== null && _answerData$exercise_24 !== void 0 && (_answerData$exercise_24 = _answerData$exercise_24[oneindex].items[twoindex]) !== null && _answerData$exercise_24 !== void 0 && _answerData$exercise_24.is_marked ? 'icon-biaoji1' : 'icon-biaojigaiti'),
className: "iconfont ".concat((_answerData$exercise_25 = answerData.exercise_question_types) !== null && _answerData$exercise_25 !== void 0 && (_answerData$exercise_25 = _answerData$exercise_25[oneindex].items[twoindex]) !== null && _answerData$exercise_25 !== void 0 && _answerData$exercise_25.is_marked ? 'icon-biaoji1' : 'icon-biaojigaiti'),
style: {
color: '#FFB538',
marginRight: 6
}
}),
className: Answermodules.markBtn,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee17() {
var _answerData$exercise_25;
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee16() {
var _answerData$exercise_26;
var res;
return regeneratorRuntime_default()().wrap(function _callee17$(_context17) {
while (1) switch (_context17.prev = _context17.next) {
return regeneratorRuntime_default()().wrap(function _callee16$(_context16) {
while (1) switch (_context16.prev = _context16.next) {
case 0:
_context17.next = 2;
_context16.next = 2;
return (0,service_exercise/* markQuestion */.sS)(params.categoryId, {
exercise_question_id: (_answerData$exercise_25 = answerData.exercise_question_types[oneindex].items[twoindex]) === null || _answerData$exercise_25 === void 0 ? void 0 : _answerData$exercise_25.question_id
exercise_question_id: (_answerData$exercise_26 = answerData.exercise_question_types[oneindex].items[twoindex]) === null || _answerData$exercise_26 === void 0 ? void 0 : _answerData$exercise_26.question_id
});
case 2:
res = _context17.sent;
res = _context16.sent;
if (res.status === 0) {
initData();
}
case 4:
case "end":
return _context17.stop();
return _context16.stop();
}
}, _callee17);
}, _callee16);
})),
children: (_answerData$exercise_26 = answerData.exercise_question_types) !== null && _answerData$exercise_26 !== void 0 && (_answerData$exercise_26 = _answerData$exercise_26[oneindex].items[twoindex]) !== null && _answerData$exercise_26 !== void 0 && _answerData$exercise_26.is_marked ? '取消标记' : '标记该题'
children: (_answerData$exercise_27 = answerData.exercise_question_types) !== null && _answerData$exercise_27 !== void 0 && (_answerData$exercise_27 = _answerData$exercise_27[oneindex].items[twoindex]) !== null && _answerData$exercise_27 !== void 0 && _answerData$exercise_27.is_marked ? '取消标记' : '标记该题'
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(col/* default */.Z, {
children: [(oneindex != 0 || twoindex != 0) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
@ -4932,7 +4955,7 @@ var Answer = function Answer(_ref) {
skipPrevQuestion();
},
children: "\u4E0A\u4E00\u9898"
}), !showConfirm && !(oneindex === (answerData === null || answerData === void 0 || (_answerData$exercise_27 = answerData.exercise_question_types) === null || _answerData$exercise_27 === void 0 ? void 0 : _answerData$exercise_27.length) - 1 && twoindex === (answerData === null || answerData === void 0 || (_answerData$exercise_28 = answerData.exercise_question_types) === null || _answerData$exercise_28 === void 0 || (_answerData$exercise_28 = _answerData$exercise_28[oneindex]) === null || _answerData$exercise_28 === void 0 || (_answerData$exercise_28 = _answerData$exercise_28.items) === null || _answerData$exercise_28 === void 0 ? void 0 : _answerData$exercise_28.length) - 1) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
}), !showConfirm && !(oneindex === (answerData === null || answerData === void 0 || (_answerData$exercise_28 = answerData.exercise_question_types) === null || _answerData$exercise_28 === void 0 ? void 0 : _answerData$exercise_28.length) - 1 && twoindex === (answerData === null || answerData === void 0 || (_answerData$exercise_29 = answerData.exercise_question_types) === null || _answerData$exercise_29 === void 0 || (_answerData$exercise_29 = _answerData$exercise_29[oneindex]) === null || _answerData$exercise_29 === void 0 || (_answerData$exercise_29 = _answerData$exercise_29.items) === null || _answerData$exercise_29 === void 0 ? void 0 : _answerData$exercise_29.length) - 1) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: Answermodules.changeButton,
type: "primary",
onClick: function onClick() {
@ -4946,16 +4969,16 @@ var Answer = function Answer(_ref) {
}), showConfirm && /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
className: "".concat(Answermodules.changeButton, " ml20"),
type: "primary",
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee18() {
return regeneratorRuntime_default()().wrap(function _callee18$(_context18) {
while (1) switch (_context18.prev = _context18.next) {
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee17() {
return regeneratorRuntime_default()().wrap(function _callee17$(_context17) {
while (1) switch (_context17.prev = _context17.next) {
case 0:
submitAnswer();
case 1:
case "end":
return _context18.stop();
return _context17.stop();
}
}, _callee18);
}, _callee17);
})),
children: "\u786E\u5B9A"
})]
@ -4964,11 +4987,10 @@ var Answer = function Answer(_ref) {
})
})]
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
width: 900,
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
width: 930,
centered: true,
keyboard: false,
zIndex: 6666,
title: "\u540C\u77E5\u8BC6\u70B9\u9898\u76EE\u63A8\u8350",
open: knowledgeDialog,
footer: null,
@ -4976,48 +4998,56 @@ var Answer = function Answer(_ref) {
onCancel: function onCancel() {
_setKnowledgeDialog(false);
},
children: itemBankData.length > 0 ? /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: [" ", itemBankData.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
children: [renderQuestion(item, index, false), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
height: 50,
width: '100%'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
type: "primary",
className: Answermodules.toIframeBtn,
style: {
"float": 'right'
},
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee19() {
return regeneratorRuntime_default()().wrap(function _callee19$(_context19) {
while (1) switch (_context19.prev = _context19.next) {
case 0:
_context19.next = 2;
return submitAnswer2(item);
case 2:
return _context19.abrupt("return", _context19.sent);
case 3:
case "end":
return _context19.stop();
}
}, _callee19);
})),
children: "\u786E\u5B9A"
})
})]
children: [itemBankData.length > 0 ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
maxHeight: 500,
overflowY: 'auto'
},
ref: divRef,
children: itemBankData.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
children: renderQuestion(item, index, false)
});
}), " "]
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {})
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), showBtn ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
width: '100%',
display: 'flex',
justifyContent: 'flex-end',
padding: '25px 0px 20px 0px'
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)(AsyncButton/* AsyncButton */.Z, {
type: "primary",
className: Answermodules.toIframeBtn,
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee18() {
return regeneratorRuntime_default()().wrap(function _callee18$(_context18) {
while (1) switch (_context18.prev = _context18.next) {
case 0:
_context18.next = 2;
return submitAnswer2();
case 2:
return _context18.abrupt("return", _context18.sent);
case 3:
case "end":
return _context18.stop();
}
}, _callee18);
})),
children: "\u786E\u5B9A"
})
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
height: 20
}
})]
})]
});
};
/* harmony default export */ var Detail_Answer = ((0,_umi_production_exports.connect)(function (_ref19) {
var loading = _ref19.loading,
user = _ref19.user,
exercise = _ref19.exercise,
globalSetting = _ref19.globalSetting;
/* harmony default export */ var Detail_Answer = ((0,_umi_production_exports.connect)(function (_ref18) {
var loading = _ref18.loading,
user = _ref18.user,
exercise = _ref18.exercise,
globalSetting = _ref18.globalSetting;
return {
globalSetting: globalSetting,
user: user,

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