mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-25 06:28:40 +00:00
feat(problem): disable custom_test for remote problem
This commit is contained in:
parent
8cfa371af5
commit
4d54fdf705
@ -464,10 +464,16 @@ class UOJProblem {
|
|||||||
return $key === null ? $extra_config : $extra_config[$key];
|
return $key === null ? $extra_config : $extra_config[$key];
|
||||||
}
|
}
|
||||||
public function getCustomTestRequirement() {
|
public function getCustomTestRequirement() {
|
||||||
|
if ($this->type() == 'remote') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
$extra_config = json_decode($this->info['extra_config'], true);
|
$extra_config = json_decode($this->info['extra_config'], true);
|
||||||
|
|
||||||
if (isset($extra_config['custom_test_requirement'])) {
|
if (isset($extra_config['custom_test_requirement'])) {
|
||||||
return $extra_config['custom_test_requirement'];
|
return $extra_config['custom_test_requirement'];
|
||||||
} else {
|
}
|
||||||
|
|
||||||
$answer = [
|
$answer = [
|
||||||
'name' => 'answer',
|
'name' => 'answer',
|
||||||
'type' => 'source code',
|
'type' => 'source code',
|
||||||
@ -486,7 +492,6 @@ class UOJProblem {
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function userCanView(array $user = null, array $cfg = []) {
|
public function userCanView(array $user = null, array $cfg = []) {
|
||||||
$cfg += ['ensure' => false];
|
$cfg += ['ensure' => false];
|
||||||
|
Loading…
Reference in New Issue
Block a user