From 6407895ae20373d08bdec4876ca512a3b6cca5d3 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Fri, 20 Jan 2023 16:43:49 +0800 Subject: [PATCH] feat(remote_judger): sample test --- remote_judger/src/daemon.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/remote_judger/src/daemon.ts b/remote_judger/src/daemon.ts index 2d31d11..c38e01e 100644 --- a/remote_judger/src/daemon.ts +++ b/remote_judger/src/daemon.ts @@ -65,6 +65,24 @@ export default async function daemon(config: UOJConfig) { const config = Object.fromEntries(content.config); 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: 'Sample test is not available.', + }), + judge_time, + }); + + continue; + } + fs.ensureDirSync(tmpdir); const reportError = async (error: string, details: string) => {