Skip to content

Commit cb49f95

Browse files
committed
submission setup for downloading testcase
Signed-off-by: Tathagat Thapliyal <tathagat.thapliyal@gmail.com>
1 parent a2a47ee commit cb49f95

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/tasks/submission.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@ class SubmissionScenario implements Scenario {
2727

2828
fs.writeFileSync(path.join(currentJobDir, LANG_CONFIG.SOURCE_FILE),
2929
(new Buffer(job.source, 'base64')).toString('ascii'))
30-
fs.writeFileSync(path.join(currentJobDir, ),
31-
(new Buffer(job.testcases)))
30+
const testCasesDir = path.join(currentJobDir, 'testcases')
31+
mkdir('-p', testCasesDir)
32+
33+
job.testcases.map(async testcase => {
34+
const rootDir = path.join(testCasesDir, '' + testcase.id)
35+
mkdir('-p', rootDir)
36+
const input = await download(testcase.input, rootDir)
37+
const output = await download(testcase.output, rootDir)
38+
})
39+
3240
}
3341

3442
async result(currentJobDir: string): Promise<SubmissionResult> {

0 commit comments

Comments
 (0)