|
|
@ -69,7 +69,6 @@ class ContestPlayer extends Model { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async updateScore(judge_state) { |
|
|
|
async updateScore(judge_state) { |
|
|
|
await syzoj.utils.lock(['ContestPlayer::updateScore', this.id], async () => { |
|
|
|
|
|
|
|
await this.loadRelationships(); |
|
|
|
await this.loadRelationships(); |
|
|
|
if (this.contest.type === 'ioi') { |
|
|
|
if (this.contest.type === 'ioi') { |
|
|
|
if (!judge_state.pending) { |
|
|
|
if (!judge_state.pending) { |
|
|
@ -107,10 +106,13 @@ class ContestPlayer extends Model { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (this.contest.type === 'noi') { |
|
|
|
} else if (this.contest.type === 'noi') { |
|
|
|
|
|
|
|
if (this.score_details[judge_state.problem_id] && this.score_details[judge_state.problem_id].judge_id > judge_state.id) return; |
|
|
|
|
|
|
|
|
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
score: judge_state.score, |
|
|
|
score: judge_state.score, |
|
|
|
judge_id: judge_state.id |
|
|
|
judge_id: judge_state.id |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.score = 0; |
|
|
|
this.score = 0; |
|
|
|
for (let x in this.score_details) { |
|
|
|
for (let x in this.score_details) { |
|
|
|
this.score += this.score_details[x].score; |
|
|
|
this.score += this.score_details[x].score; |
|
|
@ -161,7 +163,6 @@ class ContestPlayer extends Model { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getModel() { return model; } |
|
|
|
getModel() { return model; } |
|
|
|