From 8b37595bc6010814a3173ce042bde92eb3660b01 Mon Sep 17 00:00:00 2001 From: zjz1993 <1429595365@qq.com> Date: Tue, 23 Jul 2019 22:58:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=94=B9=E5=8F=98=E8=A1=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E9=87=8D=E5=81=9A=E6=B5=8B=E8=AF=84=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models-built/judge_state.js | 10 ---------- models-built/judge_state.js.map | 2 +- models-built/user_to_practice.js | 5 +++++ models-built/user_to_practice.js.map | 2 +- models/judge_state.ts | 7 ------- models/user_to_practice.ts | 4 ++++ modules/practice.js | 8 ++++++-- modules/submission.js | 26 +++++++++++++++++++------- views/submission_practice.ejs | 11 +++++++---- 9 files changed, 43 insertions(+), 32 deletions(-) diff --git a/models-built/judge_state.js b/models-built/judge_state.js index b105d2a..1afe4a4 100644 --- a/models-built/judge_state.js +++ b/models-built/judge_state.js @@ -354,16 +354,6 @@ var JudgeState = /** @class */ (function (_super) { TypeORM.Column({ nullable: true, type: "integer" }), __metadata("design:type", Number) ], JudgeState.prototype, "submit_time"); - __decorate([ - TypeORM.Index(), - TypeORM.Column({ nullable: true, type: "integer" }), - __metadata("design:type", Number) - ], JudgeState.prototype, "c_id"); - __decorate([ - TypeORM.Index(), - TypeORM.Column({ nullable: true, type: "integer" }), - __metadata("design:type", Number) - ], JudgeState.prototype, "is_practice"); __decorate([ TypeORM.Column({ nullable: true, type: "integer" }), __metadata("design:type", Number) diff --git a/models-built/judge_state.js.map b/models-built/judge_state.js.map index dd8064e..19146cf 100644 --- a/models-built/judge_state.js.map +++ b/models-built/judge_state.js.map @@ -1 +1 @@ -{"version":3,"file":"judge_state.js","sourceRoot":"","sources":["../models/judge_state.ts"],"names":[],"mappings":";;;;;;;;;;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;2CAChC;IAQpB;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;oCACvC;IAGb;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAClC;IAIlB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCACjC;IAInB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACnC;IAtEE,UAAU;QAP9B,OAAO,CAAC,MAAM,EAAE;QAChB,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QACxE,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC5D,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QAClD,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QAC9D,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;OACrC,UAAU,CAwK9B;IAAD,iBAAC;CAAA,AAxKD,CAAwC,mBAAK,GAwK5C;qBAxKoB,UAAU"} \ No newline at end of file diff --git a/models-built/user_to_practice.js b/models-built/user_to_practice.js index c9a949d..47c8c0e 100644 --- a/models-built/user_to_practice.js +++ b/models-built/user_to_practice.js @@ -49,6 +49,11 @@ var UserToPractice = /** @class */ (function (_super) { TypeORM.Column({ nullable: true, type: "integer" }), __metadata("design:type", Number) ], UserToPractice.prototype, "p_id"); + __decorate([ + TypeORM.Index(), + TypeORM.Column({ nullable: true, type: "integer" }), + __metadata("design:type", Number) + ], UserToPractice.prototype, "s_id"); __decorate([ TypeORM.Index(), TypeORM.Column({ type: "integer" }), diff --git a/models-built/user_to_practice.js.map b/models-built/user_to_practice.js.map index 5344603..74da9b8 100644 --- a/models-built/user_to_practice.js.map +++ b/models-built/user_to_practice.js.map @@ -1 +1 @@ -{"version":3,"file":"user_to_practice.js","sourceRoot":"","sources":["../models/user_to_practice.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAG7B;IAA4C,kCAAK;IAAjD;;IA6BA,CAAC;IA5BU,oBAAK,GAAG,IAAI,CAAC;IAGpB;QADC,OAAO,CAAC,sBAAsB,EAAE;;sCACtB;IAIX;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CAChB;IAIpB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CAChB;IAIpB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;gDACf;IA5BJ,cAAc;QADlC,OAAO,CAAC,MAAM,EAAE;OACI,cAAc,CA6BlC;IAAD,qBAAC;CAAA,AA7BD,CAA4C,mBAAK,GA6BhD;qBA7BoB,cAAc"} \ No newline at end of file +{"version":3,"file":"user_to_practice.js","sourceRoot":"","sources":["../models/user_to_practice.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAG7B;IAA4C,kCAAK;IAAjD;;IAiCA,CAAC;IAhCU,oBAAK,GAAG,IAAI,CAAC;IAGpB;QADC,OAAO,CAAC,sBAAsB,EAAE;;sCACtB;IAIX;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CAChB;IAIpB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CAChB;IAIpB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;gDACf;IAhCJ,cAAc;QADlC,OAAO,CAAC,MAAM,EAAE;OACI,cAAc,CAiClC;IAAD,qBAAC;CAAA,AAjCD,CAA4C,mBAAK,GAiChD;qBAjCoB,cAAc"} \ No newline at end of file diff --git a/models/judge_state.ts b/models/judge_state.ts index 8328128..81f7fc7 100644 --- a/models/judge_state.ts +++ b/models/judge_state.ts @@ -87,13 +87,6 @@ export default class JudgeState extends Model { @TypeORM.Column({ nullable: true, type: "integer" }) submit_time: number; - @TypeORM.Index() - @TypeORM.Column({ nullable: true, type: "integer" }) - c_id: number; - - @TypeORM.Index() - @TypeORM.Column({ nullable: true, type: "integer" }) - is_practice: number; /* * "type" indicate it's contest's submission(type = 1) or normal submission(type = 0) * if it's contest's submission (type = 1), the type_info is contest_id diff --git a/models/user_to_practice.ts b/models/user_to_practice.ts index b36ae0a..696c1bd 100644 --- a/models/user_to_practice.ts +++ b/models/user_to_practice.ts @@ -20,6 +20,10 @@ export default class UserToPractice extends Model { @TypeORM.Column({ nullable: true, type: "integer" }) p_id: number; + @TypeORM.Index() + @TypeORM.Column({ nullable: true, type: "integer" }) + s_id: number; + @TypeORM.Index() @TypeORM.Column({ type: "integer" }) is_practice: number; diff --git a/modules/practice.js b/modules/practice.js index c21d7d6..35b937d 100644 --- a/modules/practice.js +++ b/modules/practice.js @@ -162,11 +162,12 @@ app.get('/api/practice/classify/:id', async (req, res) => { } }); -app.get('/api/pass/:cid/:pid',async (req, res) => { +app.get('/api/pass/:cid/:pid/:sid',async (req, res) => { try { const c_id = parseInt(req.params.cid); const p_id = parseInt(req.params.pid); const u_id = res.locals.user.id; + const s_id = parseInt(req.params.sid); let utopQuery = UToP.createQueryBuilder(); let query = Classify.createQueryBuilder(); let userQuery = User.createQueryBuilder(); @@ -185,6 +186,7 @@ app.get('/api/pass/:cid/:pid',async (req, res) => { u_id, c_id, p_id, + s_id, is_practice: 1, is_finished: 1, practice_num: 1 @@ -205,11 +207,12 @@ app.get('/api/pass/:cid/:pid',async (req, res) => { } }); -app.get('/api/nopass/:cid/:pid',async (req, res) => { +app.get('/api/nopass/:cid/:pid/:sid',async (req, res) => { try { const c_id = parseInt(req.params.cid); const p_id = parseInt(req.params.pid); const u_id = res.locals.user.id; + const s_id = parseInt(req.params.sid); let utopQuery = UToP.createQueryBuilder(); let query = Classify.createQueryBuilder(); let utopResult = await utopQuery.where("c_id = :c_id", { c_id }).andWhere("u_id=:u_id", {u_id}).andWhere("p_id=:p_id", {p_id}).getOne(); @@ -223,6 +226,7 @@ app.get('/api/nopass/:cid/:pid',async (req, res) => { u_id, c_id, p_id, + s_id, is_practice: 1, practice_num: 1, is_finished: 0 diff --git a/modules/submission.js b/modules/submission.js index e24acf9..9cab27a 100644 --- a/modules/submission.js +++ b/modules/submission.js @@ -3,6 +3,7 @@ let FormattedCode = syzoj.model('formatted_code'); let User = syzoj.model('user'); let Contest = syzoj.model('contest'); let Problem = syzoj.model('problem'); +let UToP = syzoj.model('user_to_practice'); const jwt = require('jsonwebtoken'); const { getSubmissionInfo, getRoughResult, processOverallResult } = require('../libs/submissions_process'); @@ -125,10 +126,17 @@ app.get('/submissions', async (req, res) => { await judge_state.forEachAsync(async obj => { await obj.loadRelationships(); }); - - res.render('submissions', { - items: judge_state.map(x => ({ - info: getSubmissionInfo(x, displayConfig), + + const items = await judge_state.mapAsync(async x => { + let utopQuery = UToP.createQueryBuilder(); + let practiceInfo = await utopQuery.where("s_id = :s_id", { s_id:x.id }).getOne(); + let info = getSubmissionInfo(x, displayConfig); + if (practiceInfo) { + info.isPractice = true; + info.c_id = practiceInfo.c_id; + } + return { + info, token: (x.pending && x.task_id != null) ? jwt.sign({ taskId: x.task_id, type: 'rough', @@ -136,7 +144,11 @@ app.get('/submissions', async (req, res) => { }, syzoj.config.session_secret) : null, result: getRoughResult(x, displayConfig, true), running: false, - })), + } + }) + + res.render('submissions', { + items, paginate: paginate, pushType: 'rough', form: req.query, @@ -161,7 +173,6 @@ app.get('/submission/practice/:id/:pid/:cid', async (req, res) => { if (!judge) throw new ErrorMessage("提交记录 ID 不正确。"); const curUser = res.locals.user; if (!await judge.isAllowedVisitBy(curUser)) throw new ErrorMessage('您没有权限进行此操作。'); - await judge.loadRelationships(); if (judge.problem.type !== 'submit-answer') { @@ -208,7 +219,8 @@ app.get('/submission/practice/:id/:pid/:cid', async (req, res) => { }, syzoj.config.session_secret) : null, displayConfig: currentConfig, cid, - pid + pid, + sid: id }); } catch (e) { syzoj.log(e); diff --git a/views/submission_practice.ejs b/views/submission_practice.ejs index acd314b..79fcf77 100644 --- a/views/submission_practice.ejs +++ b/views/submission_practice.ejs @@ -57,6 +57,7 @@
<%= cid %>
<%= pid %>
+
<%= sid %>
<% if (formattedCode !== null) { %> @@ -319,6 +320,8 @@ if (token != null) { const loadSocketIO = function () { const cid = parseInt(document.getElementById('cid').innerHTML); const pid = parseInt(document.getElementById('pid').innerHTML); + const sid = parseInt(document.getElementById('sid').innerHTML); + console.log(sid); let currentVersion = 0; const socket = io(socketUrl); socket.on('connect', function () { @@ -345,7 +348,7 @@ if (token != null) { vueApp.roughData.result = p.roughResult; if (p.roughResult.result === 'Accepted') { $.ajax({ - url: `/api/pass/${cid}/${pid}`, + url: `/api/pass/${cid}/${pid}/${sid}`, type: 'GET', success: function (data) { }, @@ -355,7 +358,7 @@ if (token != null) { }); } else { $.ajax({ - url: `/api/nopass/${cid}/${pid}`, + url: `/api/nopass/${cid}/${pid}/${sid}`, type: 'GET', success: function (data) { }, @@ -386,7 +389,7 @@ if (token != null) { vueApp.roughData.running = false; // if (data.roughResult.result === 'Accepted') { // $.ajax({ - // url: `/api/pass/${cid}/${pid}`, + // url: `/api/pass/${cid}/${pid}/${sid}`, // type: 'GET', // success: function (data) { // }, @@ -396,7 +399,7 @@ if (token != null) { // }); // } else { // $.ajax({ - // url: `/api/nopass/${cid}/${pid}`, + // url: `/api/nopass/${cid}/${pid}/${sid}`, // type: 'GET', // success: function (data) { // },