@xcpcio/core 0.28.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -249,7 +249,7 @@ class CodeforcesGymGhostDATConverter {
249
249
  }
250
250
  const status = this.submissionStatusToCodeforcesGymDatStatus(submission.status);
251
251
  submissionsIdMap.get(teamId).set(problemId, submissionsIdMap.get(teamId).get(problemId) + 1);
252
- res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestamp},${status}
252
+ res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}
253
253
  `;
254
254
  });
255
255
  return res;
@@ -1258,6 +1258,22 @@ class Rank {
1258
1258
  this.rankStatistics = new RankStatistics();
1259
1259
  this.options = new RankOptions();
1260
1260
  this.balloons = [];
1261
+ {
1262
+ const se = /* @__PURE__ */ new Set();
1263
+ this.submissions.forEach((s) => {
1264
+ if (s.language) {
1265
+ se.add(s.language);
1266
+ }
1267
+ });
1268
+ this.languages = [...se].sort();
1269
+ }
1270
+ {
1271
+ const se = /* @__PURE__ */ new Set();
1272
+ this.submissions.forEach((s) => {
1273
+ se.add(s.status);
1274
+ });
1275
+ this.statuses = [...se].sort();
1276
+ }
1261
1277
  }
1262
1278
  cleanRank() {
1263
1279
  (() => {
package/dist/index.d.ts CHANGED
@@ -247,6 +247,8 @@ declare class Rank {
247
247
  rankStatistics: RankStatistics;
248
248
  options: RankOptions;
249
249
  balloons: Balloons;
250
+ languages: Array<string>;
251
+ statuses: Array<SubmissionStatus>;
250
252
  constructor(contest: Contest, teams: Teams, submissions: Submissions);
251
253
  cleanRank(): void;
252
254
  buildRank(): this;
package/dist/index.mjs CHANGED
@@ -219,7 +219,7 @@ class CodeforcesGymGhostDATConverter {
219
219
  }
220
220
  const status = this.submissionStatusToCodeforcesGymDatStatus(submission.status);
221
221
  submissionsIdMap.get(teamId).set(problemId, submissionsIdMap.get(teamId).get(problemId) + 1);
222
- res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestamp},${status}
222
+ res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}
223
223
  `;
224
224
  });
225
225
  return res;
@@ -1228,6 +1228,22 @@ class Rank {
1228
1228
  this.rankStatistics = new RankStatistics();
1229
1229
  this.options = new RankOptions();
1230
1230
  this.balloons = [];
1231
+ {
1232
+ const se = /* @__PURE__ */ new Set();
1233
+ this.submissions.forEach((s) => {
1234
+ if (s.language) {
1235
+ se.add(s.language);
1236
+ }
1237
+ });
1238
+ this.languages = [...se].sort();
1239
+ }
1240
+ {
1241
+ const se = /* @__PURE__ */ new Set();
1242
+ this.submissions.forEach((s) => {
1243
+ se.add(s.status);
1244
+ });
1245
+ this.statuses = [...se].sort();
1246
+ }
1231
1247
  }
1232
1248
  cleanRank() {
1233
1249
  (() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "description": "XCPCIO Core",
5
5
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "lodash": "^4.17.21",
45
45
  "string-width": "^6.1.0",
46
46
  "xlsx-js-style": "^1.2.0",
47
- "@xcpcio/types": "0.28.0"
47
+ "@xcpcio/types": "0.30.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/types": "^7.22.4",
package/src/export/cf.ts CHANGED
@@ -72,7 +72,7 @@ export class CodeforcesGymGhostDATConverter {
72
72
  const status = this.submissionStatusToCodeforcesGymDatStatus(submission.status);
73
73
  submissionsIdMap.get(teamId)!.set(problemId, submissionsIdMap.get(teamId)!.get(problemId)! + 1);
74
74
 
75
- res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestamp},${status}\n`;
75
+ res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}\n`;
76
76
  });
77
77
 
78
78
  return res;
package/src/rank.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import _ from "lodash";
2
2
 
3
+ import type { SubmissionStatus } from "@xcpcio/types";
4
+
3
5
  import type { Contest } from "./contest";
4
6
  import type { Teams } from "./team";
5
7
  import { Team } from "./team";
@@ -129,6 +131,9 @@ export class Rank {
129
131
 
130
132
  balloons: Balloons;
131
133
 
134
+ languages: Array<string>;
135
+ statuses: Array<SubmissionStatus>;
136
+
132
137
  constructor(contest: Contest, teams: Teams, submissions: Submissions) {
133
138
  this.contest = contest;
134
139
 
@@ -162,6 +167,28 @@ export class Rank {
162
167
  this.options = new RankOptions();
163
168
 
164
169
  this.balloons = [];
170
+
171
+ {
172
+ const se = new Set<string>();
173
+
174
+ this.submissions.forEach((s) => {
175
+ if (s.language) {
176
+ se.add(s.language);
177
+ }
178
+ });
179
+
180
+ this.languages = [...se].sort();
181
+ }
182
+
183
+ {
184
+ const se = new Set<SubmissionStatus>();
185
+
186
+ this.submissions.forEach((s) => {
187
+ se.add(s.status);
188
+ });
189
+
190
+ this.statuses = [...se].sort();
191
+ }
165
192
  }
166
193
 
167
194
  cleanRank() {