Auto Submit

local_educoder
autosubmit 2 years ago
parent 9c7d8577ac
commit fb001a88c5

@ -543,6 +543,7 @@ function Setting({
const [course_workspace_file_time, setcourse_workspace_file_time] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();
const [podSwitch, setPodSwitch] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
const [ai_user, setai_user] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("1");
const [openLocalEvaluate, setOpenLocalEvaluate] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
let params = (0,umi__WEBPACK_IMPORTED_MODULE_1__.useParams)();
const diffObj = {
forbid_copy: "forbidCopy",
@ -559,7 +560,8 @@ function Setting({
open_code_debugger: "openCodeDebugger",
start_permanent: "startPermanent",
open_self_run: "openSelfRun",
exit_delete_pod_switch: podSwitch
exit_delete_pod_switch: "podSwitch",
open_local_evaluate: "openLocalEvaluate"
};
const editable = (_b = (_a = user.userInfo) == null ? void 0 : _a.shixun) == null ? void 0 : _b.editable;
const own = (_d = (_c = user.userInfo) == null ? void 0 : _c.shixun) == null ? void 0 : _d.own;
@ -595,7 +597,7 @@ function Setting({
setSelectDepartmentList([...selectDepartmentList, value]);
};
const handleInitState = () => {
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M;
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O;
setCodeEditPermission((_b2 = (_a2 = shixunsDetail.setting) == null ? void 0 : _a2.shixun) == null ? void 0 : _b2.code_edit_permission);
setCodeHidden((_d2 = (_c2 = shixunsDetail.setting) == null ? void 0 : _c2.shixun) == null ? void 0 : _d2.show_code_dir);
setForbidCopy((_f2 = (_e2 = shixunsDetail.setting) == null ? void 0 : _e2.shixun) == null ? void 0 : _f2.forbid_copy);
@ -616,6 +618,7 @@ function Setting({
setcourse_workspace_file_time((_I = (_H = shixunsDetail.setting) == null ? void 0 : _H.shixun) == null ? void 0 : _I.course_workspace_file_time);
setPodSwitch((_K = (_J = shixunsDetail.setting) == null ? void 0 : _J.shixun) == null ? void 0 : _K.exit_delete_pod_switch);
setai_user((_M = (_L = shixunsDetail.setting) == null ? void 0 : _L.shixun) == null ? void 0 : _M.ai_user);
setOpenLocalEvaluate((_O = (_N = shixunsDetail.setting) == null ? void 0 : _N.shixun) == null ? void 0 : _O.open_local_evaluate);
};
console.log("----", ai_user);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
@ -656,7 +659,8 @@ function Setting({
disableAI,
openCodeDebugger,
startPermanent,
openSelfRun
openSelfRun,
openLocalEvaluate
]);
function handSubmeit(flag = false, type = 1) {
return __async(this, null, function* () {
@ -686,7 +690,8 @@ function Setting({
is_disable_discuss: disableDiscuss,
open_code_debugger: openCodeDebugger,
open_self_run: openSelfRun,
exit_delete_pod_switch: podSwitch
exit_delete_pod_switch: podSwitch,
open_local_evaluate: openLocalEvaluate
},
sync_origin_shixun: flag
}
@ -971,7 +976,13 @@ function Setting({
checked: openSelfRun,
onChange: (e) => setOpenSelfRun(e)
}
), /* @__PURE__ */ React.createElement("span", { className: "c-grey-999" }, "\uFF08\u5F00\u542F\u540E\uFF0C\u5B66\u5458\u5728\u5B9E\u8DF5\u9879\u76EE\u6311\u6218\u9875\u9762\uFF0C\u53EF\u4EE5\u4F7F\u7528\u81EA\u6D4B\u8FD0\u884C\u529F\u80FD\uFF09")))), ((_m = user == null ? void 0 : user.userInfo) == null ? void 0 : _m.role) === 1 && /* @__PURE__ */ React.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.labelWrap, style: { alignItems: "center" } }, /* @__PURE__ */ React.createElement("label", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.label }, "\u4EE3\u7801\u4ED3\u5E93\u5BB9\u91CF \uFF1A"), /* @__PURE__ */ React.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.labelContent }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
), /* @__PURE__ */ React.createElement("span", { className: "c-grey-999" }, "\uFF08\u5F00\u542F\u540E\uFF0C\u5B66\u5458\u5728\u5B9E\u8DF5\u9879\u76EE\u6311\u6218\u9875\u9762\uFF0C\u53EF\u4EE5\u4F7F\u7528\u81EA\u6D4B\u8FD0\u884C\u529F\u80FD\uFF09")))), /* @__PURE__ */ React.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.labelWrap }, /* @__PURE__ */ React.createElement("label", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.label }, "\u672C\u5730\u8BC4\u6D4B\uFF1A"), /* @__PURE__ */ React.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.labelContent }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
antd__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .Z,
{
checked: openLocalEvaluate,
onChange: (e) => setOpenLocalEvaluate(e)
}
), /* @__PURE__ */ React.createElement("span", { className: "c-grey-999" }, "\uFF08\u5F00\u542F\u540E\uFF0C\u5B9E\u8BAD\u6311\u6218\u7528\u6237\u5728\u4F7F\u7528\u5BA2\u6237\u7AEF\u8FDB\u884C\u8BC4\u6D4B\u65F6\uFF0C\u5C06\u4F7F\u7528\u7528\u6237\u672C\u5730\u7684\u7B97\u529B\u8D44\u6E90\uFF0C\u51CF\u5C11\u7F51\u7EDC\u5E26\u6765\u7684\u5F71\u54CD\u3002\u76EE\u524D\u4EC5\u652F\u6301Python3\u8BED\u8A00 ", /* @__PURE__ */ React.createElement("a", { target: "_blank", href: "/download" }, "\xA0\u4E0B\u8F7D\u5BA2\u6237\u7AEF\xA0"), "\uFF09")))), ((_m = user == null ? void 0 : user.userInfo) == null ? void 0 : _m.role) === 1 && /* @__PURE__ */ React.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.labelWrap, style: { alignItems: "center" } }, /* @__PURE__ */ React.createElement("label", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.label }, "\u4EE3\u7801\u4ED3\u5E93\u5BB9\u91CF \uFF1A"), /* @__PURE__ */ React.createElement("div", { className: _index_less_modules__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z.labelContent }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
antd__WEBPACK_IMPORTED_MODULE_21__/* ["default"] */ .Z,
{
style: { width: 150 },

@ -10455,7 +10455,7 @@ function tasks_reducer(state, action) {
}
/* harmony default export */ var tasks = ((_a) => {
var props = tasks_objRest(_a, []);
var _a2;
var _a2, _b;
const userInfo = (0,_umi_production_exports.useSelector)((state2) => {
var _a3;
return (_a3 = state2 == null ? void 0 : state2.user) == null ? void 0 : _a3.userInfo;
@ -10547,7 +10547,7 @@ function tasks_reducer(state, action) {
tpi_type
} = tabActiveParams;
const prevCurrentPath = (0,_react_17_0_2_react.useRef)("");
const isLocalFetch = ["python"].includes(language) && (0,util/* isLocalApp */.WX)();
const isLocalFetch = ((_a2 = taskData == null ? void 0 : taskData.local_evaluate_languages) == null ? void 0 : _a2.includes(language)) && (0,util/* isLocalApp */.WX)() && (taskData == null ? void 0 : taskData.open_local_evaluate);
const isUpdateScript = (tpm_modified || tpm_script_modified) && st === 0;
const isNotice = (tpm_cases_modified || isUpdateScript) && myshixun.system_tip === true;
const isHtml = (mirror_name || []).indexOf("Html") !== -1;
@ -10571,7 +10571,7 @@ function tasks_reducer(state, action) {
}
return false;
}, [currentPath, paths]);
const showReleaseResource = (taskData == null ? void 0 : taskData.exit_delete_pod_switch) && (userInfo == null ? void 0 : userInfo.user_id) === ((_a2 = taskData == null ? void 0 : taskData.user) == null ? void 0 : _a2.user_id) && tabs.some((item) => item.tab_type !== 1);
const showReleaseResource = (taskData == null ? void 0 : taskData.exit_delete_pod_switch) && (userInfo == null ? void 0 : userInfo.user_id) === ((_b = taskData == null ? void 0 : taskData.user) == null ? void 0 : _b.user_id) && tabs.some((item) => item.tab_type !== 1);
(0,_react_17_0_2_react.useEffect)(() => {
if (resizeYFlag.current || resizeXFlag.current) {
let onMove = function(e) {
@ -10732,7 +10732,7 @@ function tasks_reducer(state, action) {
(0,_react_17_0_2_react.useEffect)(() => {
function init2() {
return tasks_async(this, null, function* () {
var _a3, _b, _c;
var _a3, _b2, _c;
setCodeLoading(true);
const data = yield (0,service/* fetchCode */.li)(taskId, { path: currentPath });
if (data == null ? void 0 : data.content) {
@ -10743,7 +10743,7 @@ function tasks_reducer(state, action) {
escape(window.atob((_a3 = data == null ? void 0 : data.content) == null ? void 0 : _a3.content))
);
} else {
content2 = (_b = data == null ? void 0 : data.content) == null ? void 0 : _b.content;
content2 = (_b2 = data == null ? void 0 : data.content) == null ? void 0 : _b2.content;
}
} catch (e) {
content2 = window.atob((_c = data == null ? void 0 : data.content) == null ? void 0 : _c.content);
@ -10772,12 +10772,12 @@ function tasks_reducer(state, action) {
}
}, [st, currentPath, lastedGetTaskInfoTime, timestamp]);
const onUpdateCode = (evaluate = 0) => tasks_async(void 0, null, function* () {
var _a3, _b;
var _a3, _b2;
if (st === 0 && lastedUpdateTime > 0 && isEditPath || evaluate) {
const paramsFromExercise = _params.courseId && _params.exerciseId ? { exercise_id: _params.exerciseId } : {};
let ip;
if (searchParams.get("ip_limit") === "inner" || searchParams.get("ip_bind") === "true")
ip = yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit"), ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_b = (_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) == null ? void 0 : _b.ip_bind_type });
ip = yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit"), ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_b2 = (_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) == null ? void 0 : _b2.ip_bind_type });
const response = yield (0,service/* updateCode */.n4)(myshixun.identifier, tasks_spreadValues({
path: currentPath,
evaluate,
@ -10807,7 +10807,7 @@ function tasks_reducer(state, action) {
return true;
});
const onSaveContent = () => tasks_async(void 0, null, function* () {
var _a3, _b;
var _a3, _b2;
if (codeLoading)
return;
if (game) {
@ -10826,7 +10826,7 @@ function tasks_reducer(state, action) {
evaluate: 0,
content: (_a3 = stateRef.current.codeRepData) == null ? void 0 : _a3.content,
game_id: game.id,
tab_type: (_b = tabActiveParamsRef.current) == null ? void 0 : _b.tab_type,
tab_type: (_b2 = tabActiveParamsRef.current) == null ? void 0 : _b2.tab_type,
ip
}, paramsFromExercise);
let headers = {
@ -11120,7 +11120,7 @@ function tasks_reducer(state, action) {
}
function onEvalCode() {
return tasks_async(this, null, function* () {
var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
var _a3, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
try {
dispatch({ type: constant/* SHOW_EVALUATE_LOADING */.Ui });
const response = yield onUpdateCode(1);
@ -11130,7 +11130,7 @@ function tasks_reducer(state, action) {
type: "exercise/setActionTabs",
payload: {
key: "student-unlock",
exerciseParams: tasks_spreadProps(tasks_spreadValues({}, ((_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) || {}), { errorMessage: response == null ? void 0 : response.message, exercise_user_id: (_c = (_b = exerciseDataRef.current) == null ? void 0 : _b.exercise) == null ? void 0 : _c.exercise_user_id, id: searchParams.get("exercisesId") })
exerciseParams: tasks_spreadProps(tasks_spreadValues({}, ((_a3 = exerciseDataRef.current) == null ? void 0 : _a3.exercise) || {}), { errorMessage: response == null ? void 0 : response.message, exercise_user_id: (_c = (_b2 = exerciseDataRef.current) == null ? void 0 : _b2.exercise) == null ? void 0 : _c.exercise_user_id, id: searchParams.get("exercisesId") })
}
});
return;
@ -11224,7 +11224,7 @@ function tasks_reducer(state, action) {
let time_out = false;
function getGameStatus(intervalTime2, finalTime, count2) {
return tasks_async(this, null, function* () {
var _a4, _b2;
var _a4, _b3;
const excuteTime = count2++ * intervalTime2;
if (excuteTime / 1e3 > finalTime) {
time_out = true;
@ -11240,7 +11240,7 @@ function tasks_reducer(state, action) {
const ds = source;
const { status, running_code_message, port, web_route } = ds;
if ((ds == null ? void 0 : ds.status) == 0) {
if (((_b2 = ds == null ? void 0 : ds.shixuns) == null ? void 0 : _b2.length) > 0) {
if (((_b3 = ds == null ? void 0 : ds.shixuns) == null ? void 0 : _b3.length) > 0) {
setshixuns(ds == null ? void 0 : ds.shixuns);
setvisible(true);
}
@ -11330,7 +11330,7 @@ function tasks_reducer(state, action) {
}
function onLocalRun(input) {
return tasks_async(this, null, function* () {
var _a3, _b, _c, _d, _e, _f, _g, _h, _i;
var _a3, _b2, _c, _d, _e, _f, _g, _h, _i;
yield onUpdateCode();
const params = {};
if (searchParams.get("type") === "exercises") {
@ -11343,7 +11343,7 @@ function tasks_reducer(state, action) {
// 关卡id
subject_id: searchParams.get("subject_id") || "",
commitID: "",
ip: yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit") || "no", ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_c = (_b = exerciseDataRef.current) == null ? void 0 : _b.exercise) == null ? void 0 : _c.ip_bind_type })
ip: yield (0,Exercise_ip/* findLocalIp */.y)({ ip_limit: searchParams.get("ip_limit") || "no", ip_bind: searchParams.get("ip_bind") === "true" ? true : false, ip_bind_type: (_c = (_b2 = exerciseDataRef.current) == null ? void 0 : _b2.exercise) == null ? void 0 : _c.ip_bind_type })
};
} else if (searchParams.get("type") === "competitions") {
params.extras = {
@ -11592,7 +11592,7 @@ function tasks_reducer(state, action) {
}
function onGetUnity3dMessage(mes) {
return tasks_async(this, null, function* () {
var _a3, _b, _c;
var _a3, _b2, _c;
const { GameState, Data, challenge: challenge2 } = mes;
if (challenge2 === "info") {
mediator/* default */.Z.publish("evaluate-unity3d-result", {
@ -11642,7 +11642,7 @@ function tasks_reducer(state, action) {
dispatch({
type: constant/* SHOW_EVALUATE_RESULT */.m5
});
(_c = (_b = (_a3 = window == null ? void 0 : window.frames) == null ? void 0 : _a3[0]) == null ? void 0 : _b.contentWindow) == null ? void 0 : _c.postMessage({
(_c = (_b2 = (_a3 = window == null ? void 0 : window.frames) == null ? void 0 : _a3[0]) == null ? void 0 : _b2.contentWindow) == null ? void 0 : _c.postMessage({
taskIdentifier: game == null ? void 0 : game.identifier
}, "*");
}
@ -11651,11 +11651,11 @@ function tasks_reducer(state, action) {
}
function onAddVncTime() {
return tasks_async(this, null, function* () {
var _a3, _b;
var _a3, _b2;
const res2 = yield (0,service/* addVncTime */.Kl)(
(_a3 = taskData == null ? void 0 : taskData.myshixun) == null ? void 0 : _a3.identifier,
{
game_id: (_b = taskData == null ? void 0 : taskData.game) == null ? void 0 : _b.id,
game_id: (_b2 = taskData == null ? void 0 : taskData.game) == null ? void 0 : _b2.id,
shixun_environment_id,
tab_type
}

Loading…
Cancel
Save