1
0
mirror of https://github.com/renbaoshuo/UOJ-Luogu-RemoteJudge.git synced 2024-10-18 10:08:49 +00:00
UOJ-Luogu-RemoteJudge/web/app/libs/uoj-utility-lib.php

30 lines
750 B
PHP
Raw Normal View History

<?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'
)
);
}
}