judge: provide score & subtaskId

This commit is contained in:
undefined committed 2022-05-13 00:00:55 +08:00
1 parent 60aa0e1611
commit a585c13a72
19 files changed
+118 -186

No files matched your search

+14 -25
View File
@@ -2,7 +2,6 @@ import type fs from 'fs';
import type { Dictionary, NumericDictionary } from 'lodash';
import type { ItemBucketMetadata } from 'minio';
import type { Cursor, ObjectID } from 'mongodb';
import type { Readable, Writable } from 'stream';
import type { ProblemDoc } from './model/problem';
type document = typeof import('./model/document');
@@ -208,6 +207,7 @@ export interface SampleContentNode {
sectionTitle: string,
payload: [string, string],
}
// TODO drop contentNode support
export type ContentNode = PlainContentNode | TextContentNode | SampleContentNode;
export type Content = string | ContentNode[] | Record<string, ContentNode[]>;
@@ -272,6 +272,8 @@ export interface ProblemStatusDoc extends StatusDoc {
export interface TestCase {
id?: number;
subtaskId?: number;
score?: number;
time: number;
memory: number;
status: number;
@@ -288,9 +290,9 @@ export interface RecordDoc {
score: number;
memory: number;
time: number;
judgeTexts: string[];
judgeTexts: (string | JudgeMessage)[];
compilerTexts: string[];
testCases: TestCase[];
testCases: Required<TestCase>[];
rejudged: boolean;
source?: string;
/** judge uid */
@@ -497,24 +499,25 @@ export interface Script {
validate: any,
}
export interface JudgeMessage {
message: string;
params?: string[];
stack?: string;
}
export interface JudgeResultBody {
key: string;
domainId: string;
rid: ObjectID;
judger?: number;
progress?: number;
addProgress?: number;
case?: {
id?: number;
status: number;
time: number;
memory: number;
message?: string;
},
case?: TestCase,
status?: number;
score?: number;
time?: number;
memory?: number;
message?: string;
message?: string | JudgeMessage;
compilerText?: string,
}
@@ -527,19 +530,6 @@ export interface Task {
[key: string]: any;
}
export interface UploadStream extends Writable {
id: ObjectID;
}
export interface HydroFileSystem {
openUploadStream: (filename: string) => UploadStream
openDownloadStream: (_id: ObjectID) => Readable
// TODO
find: (...args: any[]) => any
}
export type PathComponent = [string, string, Dictionary<any>?, boolean?];
export interface BaseService {
started: boolean;
error?: Error | string;
@@ -637,7 +627,6 @@ export interface Model {
export interface Service {
bus: typeof import('./service/bus'),
db: typeof import('./service/db'),
fs: HydroFileSystem,
monitor: typeof import('./service/monitor'),
server: typeof import('./service/server'),
storage: typeof import('./service/storage'),