mirror of
https://github.com/renbaoshuo/UOJ-Luogu-RemoteJudge.git
synced 2024-11-27 14:36:28 +00:00
fix: disable custom test in remote problem
This commit is contained in:
parent
b8e84f43f1
commit
2889b6df81
29
web/app/libs/uoj-utility-lib.php
Normal file
29
web/app/libs/uoj-utility-lib.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
function getProblemCustomTestRequirement($problem) {
|
||||
$extra_config = json_decode($problem['extra_config'], true);
|
||||
if ($problem['type'] != 'local') {
|
||||
return array();
|
||||
} elseif (isset($extra_config['custom_test_requirement'])) {
|
||||
return $extra_config['custom_test_requirement'];
|
||||
} else {
|
||||
$answer = array(
|
||||
'name' => 'answer',
|
||||
'type' => 'source code',
|
||||
'file_name' => 'answer.code'
|
||||
);
|
||||
foreach (getProblemSubmissionRequirement($problem) as $req) {
|
||||
if ($req['name'] == 'answer' && $req['type'] == 'source code' && isset($req['languages'])) {
|
||||
$answer['languages'] = $req['languages'];
|
||||
}
|
||||
}
|
||||
return array(
|
||||
$answer,
|
||||
array(
|
||||
'name' => 'input',
|
||||
'type' => 'text',
|
||||
'file_name' => 'input.txt'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
13
web/app/libs/uoj-utility-lib.php.patch
Normal file
13
web/app/libs/uoj-utility-lib.php.patch
Normal file
@ -0,0 +1,13 @@
|
||||
--- UOJ-System/web/app/libs/uoj-utility-lib.php 2022-12-30 09:54:05.452022649 +0800
|
||||
+++ UOJ-Luogu-RemoteJudge/web/app/libs/uoj-utility-lib.php 2023-03-20 15:17:40.943109445 +0800
|
||||
@@ -150,7 +150,9 @@
|
||||
}
|
||||
function getProblemCustomTestRequirement($problem) {
|
||||
$extra_config = json_decode($problem['extra_config'], true);
|
||||
- if (isset($extra_config['custom_test_requirement'])) {
|
||||
+ if ($problem['type'] != 'local') {
|
||||
+ return array();
|
||||
+ } elseif (isset($extra_config['custom_test_requirement'])) {
|
||||
return $extra_config['custom_test_requirement'];
|
||||
} else {
|
||||
$answer = array(
|
Loading…
Reference in New Issue
Block a user