mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: disable pretest for remote_judge
This commit is contained in:
1 parent
520da964b6
commit
38b5d8d1ac
5 files changed
+31
-26
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.33.15",
|
"version": "2.33.16",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
|||||||
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes(lang)) {
|
if (this.response.body.pdoc.config?.langs && !this.response.body.pdoc.config.langs.includes(lang)) {
|
||||||
throw new BadRequestError('Language not allowed.');
|
throw new BadRequestError('Language not allowed.');
|
||||||
}
|
}
|
||||||
|
if (pretest && this.response.body.pdoc.config?.type !== 'default') throw new BadRequestError('unable to run pretest');
|
||||||
await this.limitRate('add_record', 60, system.get('limit.submission'));
|
await this.limitRate('add_record', 60, system.get('limit.submission'));
|
||||||
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, lang, code, true, pretest ? input : undefined);
|
const rid = await record.add(domainId, this.pdoc.docId, this.user._id, lang, code, true, pretest ? input : undefined);
|
||||||
const rdoc = await record.get(domainId, rid);
|
const rdoc = await record.get(domainId, rid);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const acm: ContestRule = {
|
|||||||
let time = 0;
|
let time = 0;
|
||||||
for (const j of journal) {
|
for (const j of journal) {
|
||||||
if (tdoc.pids.includes(j.pid)
|
if (tdoc.pids.includes(j.pid)
|
||||||
&& !(effective[j.pid]?.status === STATUS.STATUS_ACCEPTED)) {
|
&& effective[j.pid]?.status !== STATUS.STATUS_ACCEPTED) {
|
||||||
effective[j.pid] = j;
|
effective[j.pid] = j;
|
||||||
if (![STATUS.STATUS_ACCEPTED, STATUS.STATUS_COMPILE_ERROR].includes(j.status)) {
|
if (![STATUS.STATUS_ACCEPTED, STATUS.STATUS_COMPILE_ERROR].includes(j.status)) {
|
||||||
naccept[j.pid] = (naccept[j.pid] || 0) + 1;
|
naccept[j.pid] = (naccept[j.pid] || 0) + 1;
|
||||||
|
|||||||
@@ -92,19 +92,21 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
|
|||||||
if (!keys.includes(this.props.editorLang)) this.props.setEditorLanguage(keys[0]);
|
if (!keys.includes(this.props.editorLang)) this.props.setEditorLanguage(keys[0]);
|
||||||
return (
|
return (
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
<ToolbarButton
|
{UiContext.pdoc.config?.type === 'default' && (
|
||||||
disabled={this.props.isPosting || this.props.isRunning}
|
<ToolbarButton
|
||||||
className="scratchpad__toolbar__pretest"
|
disabled={this.props.isPosting || this.props.isRunning}
|
||||||
onClick={() => this.props.postPretest(this.props)}
|
className="scratchpad__toolbar__pretest"
|
||||||
data-global-hotkey="f9"
|
onClick={() => this.props.postPretest(this.props)}
|
||||||
data-tooltip={`${i18n('Pretest Your Code')} (F9)`}
|
data-global-hotkey="f9"
|
||||||
>
|
data-tooltip={`${i18n('Pretest Your Code')} (F9)`}
|
||||||
<Icon name="debug" />
|
>
|
||||||
{' '}
|
<Icon name="debug" />
|
||||||
{i18n('Run Pretest')}
|
{' '}
|
||||||
{' '}
|
{i18n('Run Pretest')}
|
||||||
(F9)
|
{' '}
|
||||||
</ToolbarButton>
|
(F9)
|
||||||
|
</ToolbarButton>
|
||||||
|
)}
|
||||||
<ToolbarButton
|
<ToolbarButton
|
||||||
disabled={this.props.isPosting}
|
disabled={this.props.isPosting}
|
||||||
className="scratchpad__toolbar__submit"
|
className="scratchpad__toolbar__submit"
|
||||||
@@ -154,16 +156,18 @@ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadTool
|
|||||||
</select>
|
</select>
|
||||||
</ToolbarItem>
|
</ToolbarItem>
|
||||||
<ToolbarSplit />
|
<ToolbarSplit />
|
||||||
<ToolbarButton
|
{UiContext.pdoc.config?.type === 'default' && (
|
||||||
activated={this.props.pretestVisible}
|
<ToolbarButton
|
||||||
onClick={() => this.props.togglePanel('pretest')}
|
activated={this.props.pretestVisible}
|
||||||
data-global-hotkey="alt+p"
|
onClick={() => this.props.togglePanel('pretest')}
|
||||||
data-tooltip={`${i18n('Toggle Pretest Panel')} (Alt+P)`}
|
data-global-hotkey="alt+p"
|
||||||
>
|
data-tooltip={`${i18n('Toggle Pretest Panel')} (Alt+P)`}
|
||||||
<Icon name="edit" />
|
>
|
||||||
{' '}
|
<Icon name="edit" />
|
||||||
{i18n('Pretest')}
|
{' '}
|
||||||
</ToolbarButton>
|
{i18n('Pretest')}
|
||||||
|
</ToolbarButton>
|
||||||
|
)}
|
||||||
{UiContext.canViewRecord && (
|
{UiContext.canViewRecord && (
|
||||||
<ToolbarButton
|
<ToolbarButton
|
||||||
activated={this.props.recordsVisible}
|
activated={this.props.recordsVisible}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.18.12",
|
"version": "4.18.13",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user