远程提交 ID: {$content['remote_submission_id']}
源代码请在「详细信息」选项卡查看。
EOD;
return true;
}
$zip_file = new ZipArchive();
if ($zip_file->open(UOJContext::storagePath() . $content['file_name'], ZipArchive::RDONLY) !== true) {
echo <<
木有
EOD;
return false;
}
$config = [];
foreach ($content['config'] as $val) {
$config[$val[0]] = $val[1];
}
foreach ($this->problem->getSubmissionRequirement() as $req) {
if ($req['type'] == "source code") {
$file_content = $zip_file->getFromName("{$req['name']}.code");
if ($file_content === false) {
$file_content = '';
}
if (isset($config["{$req['name']}_language"])) {
$file_language = $config["{$req['name']}_language"];
} else {
$file_language = '?';
}
$file_content = uojTextEncode($file_content, array('allow_CR' => true, 'html_escape' => true));
$footer_text = UOJLocale::get('problems::source code') . ': ';
$footer_text .= UOJLang::getLanguageDisplayName($file_language);
$sh_class = UOJLang::getLanguagesCSSClass($file_language);
echo <<
EOD;
} elseif ($req['type'] == "text") {
$file_content = $zip_file->getFromName("{$req['file_name']}", 504);
if ($file_content === false) {
$file_content = '';
}
$file_content = strOmit($file_content, 500);
$file_content = uojTextEncode($file_content, array('allow_CR' => true, 'html_escape' => true));
$footer_text = UOJLocale::get('problems::text file');
echo <<
EOD;
}
}
$zip_file->close();
return true;
}
protected function echoStatusBarTDBase($name, array $cfg) {
$cfg += [
'time_format' => 'normal',
'time_font_size' => 'small',
'unknown_char' => '/',
'contest_problem_letter' => false,
'problem_title' => [],
];
switch ($name) {
case 'id':
echo $this->getLink();
break;
case 'problem':
if ($this->problem) {
if ($cfg['contest_problem_letter'] && $this->problem instanceof UOJContestProblem) {
echo $this->problem->getLink($cfg['problem_title'] + ['with' => 'letter', 'simplify' => true]);
} else {
echo $this->problem->getLink($cfg['problem_title']);
}
} else {
echo '?';
}
break;
case 'contest':
if ($this->problem && $this->problem instanceof UOJContestProblem) {
echo $this->problem->contest->getLink();
} else {
echo '?';
}
case 'submitter':
case 'owner':
case 'hacker':
echo UOJUser::getLink($this->info[$name]);
break;
case 'used_time':
if ($cfg['show_actual_score']) {
if ($this->info['used_time'] < 1000) {
echo $this->info['used_time'] . ' ms';
} else {
echo sprintf("%.2f", $this->info['used_time'] / 1000) . ' s';
}
} else {
echo $cfg['unknown_char'];
}
break;
case 'used_memory':
if ($cfg['show_actual_score']) {
if ($this->info['used_memory'] < 1024) {
echo $this->info['used_memory'] . ' KB';
} else {
echo sprintf("%.2f", $this->info['used_memory'] / 1024) . ' MB';
}
} else {
echo $cfg['unknown_char'];
}
break;
case 'tot_size':
if ($this->info['tot_size'] < 1024) {
echo $this->info['tot_size'] . ' B';
} else {
echo sprintf("%.2f", $this->info['tot_size'] / 1024) . ' KB';
}
break;
case 'submit_time':
case 'judge_time':
if ($cfg['time_font_size'] == 'small') {
echo '';
}
if ($cfg['time_format'] == 'friendly') {
echo UOJTime::userFriendlyFormat($this->info[$name]);
} else {
echo $this->info[$name];
}
if ($cfg['time_font_size'] == 'small') {
echo '';
}
break;
default:
echo '?';
break;
}
}
}