fps: support latest format

This commit is contained in:
undefined committed 2021-05-05 19:08:29 +08:00
1 parent 6c0c2c5bf1
commit a03a77bd52
2 files changed
+9 -3

No files matched your search

+8 -2
View File
@@ -39,8 +39,14 @@ class FpsProblemImportHandler extends Handler {
await problem.addTestdata(domainId, pid, 'config.yaml', Buffer.from(`time: ${config.time}\nmemory: ${config.memory}`));
if (p.test_output) {
for (let i = 0; i < p.test_input.length; i++) {
await problem.addTestdata(domainId, pid, `${i + 1}.in`, Buffer.from(p.test_input[i]));
await problem.addTestdata(domainId, pid, `${i + 1}.out`, Buffer.from(p.test_output[i]));
await problem.addTestdata(
domainId, pid, `${i + 1}.in`,
Buffer.from(p.test_input[i]._ || p.test_input[i]),
);
await problem.addTestdata(
domainId, pid, `${i + 1}.out`,
Buffer.from(p.test_output[i]._ || p.test_output[i]),
);
}
} else if (p.test_input) {
for (let i = 0; i < p.test_input.length / 2; i++) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/fps-importer",
"version": "1.1.12",
"version": "1.1.13",
"description": "Import FPS problems",
"main": "package.json",
"repository": "https://github.com/hydro-dev/Hydro.git",