- 新增 llm_guidance 策略层,根据源码、判题结果与通过率评估完成度分级 - llm-review.php 改为服务端缓冲上游输出,仅下发白名单分类的固定模板 - 新增 llm_review 与 llm_review_rate_limit 表,实现结果缓存与账户/提交两级限流 - ceinfo 模板渲染编译器标出的源码行号/列号,reinfo 仅向高完成度提交展示结构化 diff - download.php 按完成度授权测试点下载,封堵白卷提交套取隐藏用例 - judge_client 在 ACM 非比赛场景下记录已通过测试点数,前端可显示进度 - 附 llm_guidance_policy_test 单测覆盖空白卷、注释卷、隐藏 SPJ、OJ_FULL_DIFF 等关键路径
112 lines
5.3 KiB
PHP
112 lines
5.3 KiB
PHP
<?php $show_title=$id." - $MSG_COMPILE_INFO - $OJ_NAME"; ?>
|
|
<?php include("template/$OJ_TEMPLATE/header.php");?>
|
|
|
|
<script src="include/vditor-adapter.js"></script>
|
|
<link href='<?php echo $OJ_CDN_URL?>highlight/styles/shCore.css' rel='stylesheet' type='text/css'/>
|
|
<link href='<?php echo $OJ_CDN_URL?>highlight/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
|
|
<style>
|
|
#compile-location-section { margin: 0 0 18px; }
|
|
.compile-location-card { border-left: 4px solid #db2828 !important; margin-bottom: 12px !important; }
|
|
.compile-location-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
|
|
.compile-source-excerpt {
|
|
border: 1px solid #e0e0e0;
|
|
border-radius: 5px;
|
|
overflow-x: auto;
|
|
background: #fafafa;
|
|
font-family: 'Fira Mono', 'Cascadia Code', Consolas, monospace;
|
|
font-size: 0.9em;
|
|
line-height: 1.55;
|
|
}
|
|
.compile-source-line { display: flex; min-width: max-content; white-space: pre; }
|
|
.compile-source-line.is-error { background: rgba(219, 40, 40, 0.12); }
|
|
.compile-source-lineno {
|
|
width: 50px;
|
|
padding: 1px 10px;
|
|
text-align: right;
|
|
color: #999;
|
|
background: #f1f1f1;
|
|
border-right: 1px solid #ddd;
|
|
user-select: none;
|
|
flex-shrink: 0;
|
|
}
|
|
.compile-source-line.is-error .compile-source-lineno { color: #db2828; font-weight: 700; }
|
|
.compile-source-text { padding: 1px 12px; }
|
|
</style>
|
|
|
|
<div class="padding">
|
|
<div style="margin:0 0 14px;">
|
|
<p class="transition visible"><strong><?php echo $MSG_SOURCE_CODE ?></strong></p>
|
|
<div class="ui existing segment">
|
|
<pre style="margin:0;"><code><div class="brush:c" id="source" name="source"></div></code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin:0 0 14px;">
|
|
<p class="transition visible"><strong><?php echo $MSG_COMPILE_INFO ?></strong></p>
|
|
<div class="ui existing segment">
|
|
<pre style="margin:0; white-space:pre-wrap; word-break:break-word;"><code><div id="errtxt"><?php echo $view_reinfo?></div></code></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if (!empty($compile_locations) && is_array($compile_locations)): ?>
|
|
<div id="compile-location-section">
|
|
<h3 class="ui header">
|
|
<i class="map marker alternate icon"></i>
|
|
<div class="content">
|
|
编译错误定位
|
|
<div class="sub header">只标出你的源码行号和列号,不提供修改答案</div>
|
|
</div>
|
|
</h3>
|
|
<?php foreach ($compile_locations as $location): ?>
|
|
<div class="ui segment compile-location-card">
|
|
<div class="compile-location-title">
|
|
<span class="ui red label">第 <?php echo intval($location['line']); ?> 行<?php
|
|
if (!empty($location['column'])) echo ',第 ' . intval($location['column']) . ' 列';
|
|
?></span>
|
|
<span>编译器在这里报告错误</span>
|
|
</div>
|
|
<div class="compile-source-excerpt">
|
|
<?php foreach ($location['excerpt'] as $source_line): ?>
|
|
<div class="compile-source-line<?php echo $source_line['is_error'] ? ' is-error' : ''; ?>">
|
|
<span class="compile-source-lineno"><?php echo intval($source_line['number']); ?></span>
|
|
<span class="compile-source-text"><?php echo htmlspecialchars($source_line['text'], ENT_QUOTES, 'UTF-8'); ?></span>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($OJ_LLM_ENABLED) && $OJ_LLM_ENABLED) {
|
|
require("template/$OJ_TEMPLATE/llm-guidance.php");
|
|
} ?>
|
|
</div>
|
|
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shCore.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushCpp.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushCss.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushJava.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushDelphi.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushRuby.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushBash.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushPython.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushPhp.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushPerl.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushCSharp.js' type='text/javascript'></script>
|
|
<script src='<?php echo $OJ_CDN_URL?>highlight/scripts/shBrushVb.js' type='text/javascript'></script>
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
$('#source').load('showsource2.php?id=<?php echo intval($id)?>', function(response, status){
|
|
if (status === 'success') {
|
|
SyntaxHighlighter.config.bloggerMode = false;
|
|
SyntaxHighlighter.config.clipboardSwf = '<?php echo $OJ_CDN_URL?>highlight/scripts/clipboard.swf';
|
|
SyntaxHighlighter.highlight();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<?php include("template/$OJ_TEMPLATE/footer.php");?>
|