Browse Source

Fix ranklist rank

pull/6/head
Menci 7 years ago
parent
commit
a846a14de2
  1. 6
      views/contest_ranklist.ejs

6
views/contest_ranklist.ejs

@ -54,9 +54,7 @@
<tr> <tr>
<% <%
if (contest.type === 'noi' || contest.type === 'ioi') { if (contest.type === 'noi' || contest.type === 'ioi') {
console.log(i); if (i === 1 || item.player.score !== lastItem.player.score) rank = i;
console.log(lastItem);
if (i === 1 || item.player.score !== lastItem.player.score) rank++;
} else if (contest.type === 'acm') { } else if (contest.type === 'acm') {
for (let problem of problems) { for (let problem of problems) {
if (item.player.score_details[problem.id] && item.player.score_details[problem.id].accepted) { if (item.player.score_details[problem.id] && item.player.score_details[problem.id].accepted) {
@ -66,7 +64,7 @@
} }
item.player.timeSum = timeSum; item.player.timeSum = timeSum;
if (i === 1 || item.player.score !== lastItem.player.score || item.player.timeSum !== lastItem.player.timeSum) rank++; if (i === 1 || item.player.score !== lastItem.player.score || item.player.timeSum !== lastItem.player.timeSum) rank = i;
} }
%> %>
<td> <td>

Loading…
Cancel
Save