judge: add communication problem support (#834) (#925)

Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
Milmonandundefined authored and GitHub committed 2025-01-21 07:33:39 +08:00
1 parent abf1c7205e
commit ebc586daba
15 files changed
+151 -33

No files matched your search

@@ -29,9 +29,9 @@ interface Props {
const configKey = [
'type', 'subType', 'target', 'score', 'time',
'memory', 'filename', 'checker_type', 'checker', 'interactor',
'validator', 'user_extra_files', 'judge_extra_files', 'detail', 'outputs',
'redirect', 'cases', 'subtasks', 'langs', 'key',
'time_limit_rate', 'memory_limit_rate',
'manager', 'num_processes', 'validator', 'user_extra_files', 'judge_extra_files',
'detail', 'outputs', 'redirect', 'cases', 'subtasks',
'langs', 'key', 'time_limit_rate', 'memory_limit_rate',
];
const subtasksKey = [
@@ -12,6 +12,7 @@ export default function ProblemType() {
const Type = useSelector((state: RootState) => state.config.type);
const checkerType = useSelector((state: RootState) => state.config.checker_type);
const filename = useSelector((state: RootState) => state.config.filename);
const numProcesses = useSelector((state: RootState) => state.config.num_processes);
const subType = useSelector((state: RootState) => state.config.subType);
const checker = useSelector((state: RootState) => state.config.checker);
const [category, setCategory] = React.useState('');
@@ -133,6 +134,25 @@ export default function ProblemType() {
</div>
)}
/>
<Tab
id="communication"
title={i18n('problem_type.communication')}
panel={(
<div className="row">
<FormItem columns={6} label="Manager">
<SingleFileSelect formKey="manager" />
</FormItem>
<FormItem columns={6} label="Number of Processes">
<input
defaultValue={numProcesses || 2}
placeholder="2"
onChange={(ev) => dispatch(({ type: 'CONFIG_FORM_UPDATE', key: 'num_processes', value: +ev.currentTarget.value }))}
className="textbox"
/>
</FormItem>
</div>
)}
/>
<Tab
id="submit_answer"
title={i18n('problem_type.submit_answer')}