Browse Source

Add score display in IOI contests

pull/6/head
Pisces000221 7 years ago
parent
commit
248ad699ab
  1. 3
      modules/contest.js
  2. 2
      views/contest.ejs

3
modules/contest.js

@ -176,6 +176,9 @@ app.get('/contest/:id', async (req, res) => {
let judge_state = await JudgeState.fromID(player.score_details[problem.problem.id].judge_id);
problem.status = judge_state.status;
problem.judge_id = player.score_details[problem.problem.id].judge_id;
await contest.loadRelationships();
let multiplier = contest.ranklist.ranking_params[problem.problem.id] || 1.0;
problem.feedback = (judge_state.score * multiplier).toString() + ' / ' + (100 * multiplier).toString();
}
} else if (contest.type === 'acm') {
if (player.score_details[problem.problem.id]) {

2
views/contest.ejs

@ -76,7 +76,7 @@
<% if (typeof problem.status === 'string') { %>
<span class="status <%= problem.status.toLowerCase().split(' ').join('_') %>">
<i class="<%= icon[getStatusMeta(problem.status)] || 'remove' %> icon"></i>
<%= problem.status %>
<%= problem.feedback || problem.status %>
</span>
<% } else if (typeof problem.status === 'object') { %>
<% if (problem.status.accepted) { %>

Loading…
Cancel
Save