|
|
@ -69,10 +69,11 @@ class ContestPlayer extends Model { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async updateScore(judge_state) { |
|
|
|
async updateScore(judge_state) { |
|
|
|
|
|
|
|
await syzoj.utils.lock('ContestPlayer::updateScore', this.id); |
|
|
|
|
|
|
|
|
|
|
|
await this.loadRelationships(); |
|
|
|
await this.loadRelationships(); |
|
|
|
if (this.contest.type === 'ioi') { |
|
|
|
if (this.contest.type === 'ioi') { |
|
|
|
if (judge_state.pending) return; |
|
|
|
if (!judge_state.pending) { |
|
|
|
|
|
|
|
|
|
|
|
if (!this.score_details[judge_state.problem_id]) { |
|
|
|
if (!this.score_details[judge_state.problem_id]) { |
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
score: judge_state.score, |
|
|
|
score: judge_state.score, |
|
|
@ -105,6 +106,7 @@ class ContestPlayer extends Model { |
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else if (this.contest.type === 'noi') { |
|
|
|
} else if (this.contest.type === 'noi') { |
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
score: judge_state.score, |
|
|
|
score: judge_state.score, |
|
|
@ -115,8 +117,7 @@ class ContestPlayer extends Model { |
|
|
|
this.score += this.score_details[x].score; |
|
|
|
this.score += this.score_details[x].score; |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (this.contest.type === 'acm') { |
|
|
|
} else if (this.contest.type === 'acm') { |
|
|
|
if (judge_state.pending) return; |
|
|
|
if (!judge_state.pending) { |
|
|
|
|
|
|
|
|
|
|
|
if (!this.score_details[judge_state.problem_id]) { |
|
|
|
if (!this.score_details[judge_state.problem_id]) { |
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
this.score_details[judge_state.problem_id] = { |
|
|
|
accepted: false, |
|
|
|
accepted: false, |
|
|
@ -160,6 +161,9 @@ class ContestPlayer extends Model { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
syzoj.utils.unlock('ContestPlayer::updateScore', this.id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getModel() { return model; } |
|
|
|
getModel() { return model; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|