feat(remote_judger): sample test

This commit is contained in:
Baoshuo Ren 2023-01-20 16:43:49 +08:00
parent 3d6102a3f9
commit 6407895ae2
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -65,6 +65,24 @@ export default async function daemon(config: UOJConfig) {
const config = Object.fromEntries(content.config); const config = Object.fromEntries(content.config);
const tmpdir = `/tmp/s2oj_rmj/${id}/`; const tmpdir = `/tmp/s2oj_rmj/${id}/`;
if (config.test_sample_only === 'on') {
await request('/submit', {
submit: true,
fetch_new: false,
id,
result: JSON.stringify({
status: 'Judged',
score: 100,
time: 0,
memory: 0,
details: '<info-block>Sample test is not available.</info-block>',
}),
judge_time,
});
continue;
}
fs.ensureDirSync(tmpdir); fs.ensureDirSync(tmpdir);
const reportError = async (error: string, details: string) => { const reportError = async (error: string, details: string) => {