|
|
@ -97,12 +97,12 @@ class JudgeState extends Model { |
|
|
|
type: 0, |
|
|
|
type: 0, |
|
|
|
type_info: 0, |
|
|
|
type_info: 0, |
|
|
|
|
|
|
|
|
|
|
|
pending: true, |
|
|
|
pending: false, |
|
|
|
|
|
|
|
|
|
|
|
score: null, |
|
|
|
score: null, |
|
|
|
total_time: null, |
|
|
|
total_time: null, |
|
|
|
max_memory: null, |
|
|
|
max_memory: null, |
|
|
|
status: 'Waiting', |
|
|
|
status: 'Unknown', |
|
|
|
result: null, |
|
|
|
result: null, |
|
|
|
task_id: randomstring.generate(10) |
|
|
|
task_id: randomstring.generate(10) |
|
|
|
}, val))); |
|
|
|
}, val))); |
|
|
@ -154,14 +154,14 @@ class JudgeState extends Model { |
|
|
|
|
|
|
|
|
|
|
|
let oldStatus = this.status; |
|
|
|
let oldStatus = this.status; |
|
|
|
|
|
|
|
|
|
|
|
this.status = 'Waiting'; |
|
|
|
this.status = 'Unknown'; |
|
|
|
|
|
|
|
this.pending = false; |
|
|
|
this.score = null; |
|
|
|
this.score = null; |
|
|
|
if (this.language) { |
|
|
|
if (this.language) { |
|
|
|
// language is empty if it's a submit-answer problem
|
|
|
|
// language is empty if it's a submit-answer problem
|
|
|
|
this.total_time = null; |
|
|
|
this.total_time = null; |
|
|
|
this.max_memory = null; |
|
|
|
this.max_memory = null; |
|
|
|
} |
|
|
|
} |
|
|
|
this.pending = true; |
|
|
|
|
|
|
|
this.result = {}; |
|
|
|
this.result = {}; |
|
|
|
this.task_id = randomstring.generate(10); |
|
|
|
this.task_id = randomstring.generate(10); |
|
|
|
await this.save(); |
|
|
|
await this.save(); |
|
|
@ -190,6 +190,9 @@ class JudgeState extends Model { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
await Judger.judge(this, this.problem, 1); |
|
|
|
await Judger.judge(this, this.problem, 1); |
|
|
|
|
|
|
|
this.pending = true; |
|
|
|
|
|
|
|
this.status = 'Waiting'; |
|
|
|
|
|
|
|
await this.save(); |
|
|
|
} catch (err) { |
|
|
|
} catch (err) { |
|
|
|
throw new ErrorMessage("无法开始评测。"); |
|
|
|
throw new ErrorMessage("无法开始评测。"); |
|
|
|
} |
|
|
|
} |
|
|
|