core&ui: pretest support for remote_judge

This commit is contained in:
undefined committed 2022-02-13 18:07:56 +08:00
1 parent 3762bb31f5
commit af994325b5
7 files changed
+16 -7

No files matched your search

@@ -87,7 +87,10 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
}
const keys = Object.keys(LANGS);
if (!keys.includes(this.props.editorLang)) this.props.setEditorLanguage(keys[0]);
const canUsePretest = ['default', 'fileio'].includes(UiContext.pdoc.config?.type);
let canUsePretest = ['default', 'fileio'].includes(UiContext.pdoc.config?.type);
if (UiContext.pdoc.config?.type === 'remote_judge') {
if (window.LANGS[this.props.editorLang].pretest) canUsePretest = true;
}
return (
<Toolbar>
{canUsePretest && (