Skip to content

Commit 46b395f

Browse files
committed
move result to different file
1 parent f17c6b8 commit 46b395f

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

src/tasks/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { RunJob, SubmissionJob, RunResult, SubmissionResult, Job, Result } from "types/job";
1+
import { RunJob, SubmissionJob, Job } from "types/job";
2+
import { RunResult, SubmissionResult, Result } from 'types/result'
23
import config = require('../../config.js')
34
import {exec, mkdir, rm} from 'shelljs'
45
import * as path from 'path'

src/tasks/run.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import config = require('../../config.js')
22
import {cat, exec, mkdir, rm, touch, head} from 'shelljs'
3-
import {RunJob, RunResult} from '../types/job'
3+
import { RunJob } from 'types/job'
4+
import { RunResult } from 'types/result'
45
import * as path from 'path'
56
import * as fs from 'fs'
67
import { Scenario } from 'types/scenario'

src/tasks/submission.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import config = require('../../config.js')
22
import { cat, exec, mkdir, rm } from 'shelljs'
3-
import { SubmissionJob, SubmissionResult } from '../types/job'
3+
import { SubmissionJob } from 'types/job'
4+
import { SubmissionResult } from 'types/result'
45
import * as path from 'path'
56
import * as fs from 'fs'
67
import * as https from 'https'

src/types/job.d.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,16 @@ export interface Job {
55
timelimit?: number
66
}
77

8-
export interface Result {
9-
id: number,
10-
stderr: string
11-
}
12-
138
export interface TestcaseJob {
149
id: number,
1510
input: string,
1611
output: string
1712
}
1813

19-
export interface TestcaseResult {
20-
id: number,
21-
score: number,
22-
time: string,
23-
result: string
24-
}
25-
2614
export interface RunJob extends Job {
2715
stdin: string
2816
}
2917

30-
export interface RunResult extends Result {
31-
stdout: string,
32-
time: number,
33-
code: number
34-
}
35-
3618
export interface SubmissionJob extends Job {
3719
testcases: Array<TestcaseJob>
3820
}
39-
40-
export interface SubmissionResult extends Result {
41-
testcases: Array<TestcaseResult>
42-
}

src/types/result.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export interface Result {
2+
id: number,
3+
stderr: string
4+
}
5+
6+
export interface TestcaseResult {
7+
id: number,
8+
score: number,
9+
time: string,
10+
result: string
11+
}
12+
13+
export interface RunResult extends Result {
14+
stdout: string,
15+
time: number,
16+
code: number
17+
}
18+
19+
export interface SubmissionResult extends Result {
20+
testcases: Array<TestcaseResult>
21+
}

0 commit comments

Comments
 (0)