@' . $user['username'] . ''; } } }, $str); $referrers_list = array(); foreach ($referrers as $referrer => $val) { $referrers_list[] = $referrer; } return array($res, $referrers_list); } function uojStringPreview($str, $output_limit, $type = 'text') { switch ($type) { case 'text': return strOmit($str, $output_limit); case 'binary': return strOmit(chunk_split(chunk_split(bin2hex($str), 8, ' '), (8 + 1) * 8, "\n"), $output_limit * 2); default: return false; } } function uojFilePreview($file_name, $output_limit, $file_type = 'text') { return uojStringPreview(file_get_contents($file_name, false, null, 0, $output_limit + 4), $output_limit, $file_type); } function uojIncludeView($name, $view_params = array()) { extract($view_params); include $_SERVER['DOCUMENT_ROOT'] . '/app/views/' . $name . '.php'; } function redirectTo(string $url) { header('Location: ' . $url); die(); } function permanentlyRedirectTo(string $url) { header("HTTP/1.1 301 Moved Permanently"); header('Location: ' . $url); die(); } function permanentlyRedirectToHTTPS() { if (UOJContext::isUsingHttps()) { return false; } permanentlyRedirectTo('https://' . UOJContext::httpHost() . UOJContext::requestURI()); die(); } function permanentlyRedirectToHTTP() { if (!UOJContext::isUsingHttps()) { return false; } permanentlyRedirectTo('http://' . UOJContext::httpHost() . UOJContext::requestURI()); die(); } function redirectToLogin() { if (UOJContext::isAjax()) { die('please login'); } else { header('Location: ' . HTML::url('/login', ['params' => ['to' => UOJContext::requestPath()]])); die(); } } function becomeMsgPage($msg, $title = '消息') { global $REQUIRE_LIB; if (UOJContext::isAjax()) { die($msg); } else { $REQUIRE_LIB['bootstrap5'] = ''; echoUOJPageHeader($title); echo $msg; echoUOJPageFooter(); die(); } } function become404Page($message = '未找到页面。') { header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found", true, 404); becomeMsgPage('
' . $message . '
' . $message . '
ID | '; } if (!isset($config['problem_hidden'])) { echo '' . UOJLocale::get('problems::problem') . ' | '; } if (!isset($config['submitter_hidden'])) { echo '' . UOJLocale::get('problems::submitter') . ' | '; } if (!isset($config['result_hidden'])) { echo '' . UOJLocale::get('problems::result') . ' | '; } if (!isset($config['used_time_hidden'])) { echo '' . UOJLocale::get('problems::used time') . ' | '; } if (!isset($config['used_memory_hidden'])) { echo '' . UOJLocale::get('problems::used memory') . ' | '; } echo '' . UOJLocale::get('problems::language') . ' | '; echo '' . UOJLocale::get('problems::file size') . ' | '; if (!isset($config['submit_time_hidden'])) { echo '' . UOJLocale::get('problems::submit time') . ' | '; } if (!isset($config['judge_time_hidden'])) { echo '' . UOJLocale::get('problems::judge time') . ' | '; } echo '
---|
' . $file_content . "\n" . '
';
echo '', "\n" . $file_content . "\n" . ''; echo '
远端评测 ID:' . HTML::tag( 'a', [ 'href' => $remote_provider['url'] . '/record/' . $config['luogu_submission_id'] ], 'R' . $config['luogu_submission_id'] ) . '
'; } HTML::echoPanel('', '远端评测记录', $content); } } $zip_file->close(); } class JudgmentDetailsPrinter { private $name; private $styler; private DOMDocument $dom; private $subtask_num; private function _get_attr(DOMElement $node, string $attr, $default = '') { $val = $node->getAttribute($attr); if ($val === '') { $val = $default; } return $val; } private function _print_c(DOMElement $node) { foreach ($node->childNodes as $child) { if ($child->nodeName == '#text') { echo htmlspecialchars($child->nodeValue); } else { $this->_print($child); } } } private function _print(DOMElement $node) { if ($node->nodeName == 'error') { echo '', "\n"; $this->_print_c($node); echo "\n"; } elseif ($node->nodeName == 'tests') { if ($node->hasAttribute("errcode")) { echo "
", "Judgment Failed. Error Code: ", $node->getAttribute("errcode"), "."; } echo '
', "\n"; $this->_print_c($node); echo "\n"; } elseif ($node->nodeName == 'out') { echo '
', "\n"; $this->_print_c($node); echo "\n"; } elseif ($node->nodeName == 'ans') { echo '
', "\n"; $this->_print_c($node); echo "\n"; } elseif ($node->nodeName == 'res') { echo '
', "\n"; if ($node->hasChildNodes()) { $this->_print_c($node); } else { echo "\n"; } echo ""; } elseif ($node->nodeName == "info-block") { echo '
', "\n"; $this->_print_c($node); echo "\n"; echo '
ID | '; } if (!isset($config['submission_id_hidden'])) { echo '' . UOJLocale::get('problems::submission id') . ' | '; } if (!isset($config['problem_hidden'])) { echo '' . UOJLocale::get('problems::problem') . ' | '; } if (!isset($config['hacker_hidden'])) { echo '' . UOJLocale::get('problems::hacker') . ' | '; } if (!isset($config['owner_hidden'])) { echo '' . UOJLocale::get('problems::owner') . ' | '; } if (!isset($config['result_hidden'])) { echo '' . UOJLocale::get('problems::result') . ' | '; } if (!isset($config['submit_time_hidden'])) { echo '' . UOJLocale::get('problems::submit time') . ' | '; } if (!isset($config['judge_time_hidden'])) { echo '' . UOJLocale::get('problems::judge time') . ' | '; } echo '
---|