Browse Source

bugfix:再次修复某些测评单项时间为0的情况

pull/20/head
zjz1993 5 years ago
parent
commit
97db034af6
  1. 12
      modules/socketio.js
  2. 5
      views/admin_classify.ejs
  3. 8
      views/submission.ejs
  4. 8
      views/submission_contest.ejs

12
modules/socketio.js

@ -27,11 +27,12 @@ function processOverallResult(source, config) {
}
return {
compile: source.compile,
judge: config.showDetailResult ? (source.judge && {
subtasks: source.judge.subtasks && source.judge.subtasks.map(st => ({
judge: {
subtasks: source.judge && source.judge.subtasks ? source.judge.subtasks.map(st => ({
score: st.score,
cases: st.cases.map(cs => ({
status: cs.status,
errorMessage: cs.errorMessage,
result: cs.result && {
type: cs.result.type,
time: config.showUsage ? cs.result.time : undefined,
@ -45,8 +46,8 @@ function processOverallResult(source, config) {
spjMessage: config.showTestdata ? cs.result.spjMessage : undefined,
}
}))
}))
}) : null
})) : null
}
};
}
function getCompileStatus(status) {
@ -149,7 +150,8 @@ function initializeSocketIO(s) {
return {
ok: true,
finished: false,
running: false
running: false,
result: processOverallResult(finishedJudgeList[taskId], clientDisplayConfigList[socket.id])
};
}
}

5
views/admin_classify.ejs

@ -160,7 +160,6 @@
return !this.disabledId.includes(row.id);
},
toggleSelection(rows) {
console.log(rows);
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
@ -237,7 +236,7 @@
}
that.disabledId = findDifference(currentIdArray, that.usedProblemId);
that.multipleSelection = that.problemIdArray;
that.toggleSelection(that.multipleSelection)
that.getProblemPagination(1);
that.order = order;
}
},
@ -249,7 +248,6 @@
},
show: function(id){
let that = this;
this.getProblemPagination(1);
if (id) {
this.classifyId = id;
this.getClassifyInfos(id);
@ -274,7 +272,6 @@
order: this.order,
problemIdArray: this.multipleSelection.map(item=>item.id)
}
console.log(obj.problemIdArray);
if (this.classifyId === -1) {
$.ajax({
url: '/api/practice/create',

8
views/submission.ejs

@ -351,17 +351,17 @@ if (token != null) {
});
socket.emit('join', token, function (data) {
console.log("join! ", data);
if (data && data.ok) {
if (data.finished && data.result && data.result.judge) {
let max=0;
if (data && data.result && data.result.judge) {
data.result.judge.subtasks.forEach(function (item) {
item.cases.forEach(function (one) {
max = one.result.time
});
});
}
if (data && data.ok) {
if (data.finished) {
if (max !== 0) {
data.roughResult.maxItemTime = max;
}
vueApp.roughData.result = data.roughResult;
// if (!data.result) location.reload(true);
vueApp.detailResult = data.result;

8
views/submission_contest.ejs

@ -352,17 +352,17 @@ if (token != null) {
});
socket.emit('join', token, function (data) {
console.log("join! ", data);
if (data && data.ok) {
if (data.finished && data.result && data.result.judge) {
let max=0;
if (data && data.result && data.result.judge) {
data.result.judge.subtasks.forEach(function (item) {
item.cases.forEach(function (one) {
max = one.result.time
});
});
}
if (data && data.ok) {
if (data.finished) {
if (max !== 0) {
data.roughResult.maxItemTime = max;
}
vueApp.roughData.result = data.roughResult;
// if (!data.result) location.reload(true);
vueApp.detailResult = data.result;

Loading…
Cancel
Save