feat(ui): 重新设计判题结果页与提交页

- 判题结果页引入友好错误解释面板,按 verdict 类型给出提示与改进建议
- 新增 dedup_runtimeinfo() 函数将重复 RE 测试点折叠为区间汇总
- 区分管理员/源浏览者与普通用户视图,原始错误默认折叠
- 错误模式匹配扩展至 28 条,覆盖 glibc/Java/Python/Go 等常见运行时异常
- 提交页改用卡片式布局,编辑器工具栏与测试运行区交互优化
- 中英文语言文件补充相关文案与快捷操作标签
- 切换 LLM 点评 API 至 newapi.klarkxy.xyz,模型改为 minimax-m3
- 新增 .codegraph/.gitignore 忽略本地调试数据
This commit is contained in:
2026-07-08 20:56:17 +08:00
parent c4e0f104b4
commit 6c462655b9
7 changed files with 1236 additions and 419 deletions

View File

@@ -358,7 +358,39 @@
$MSG_YOURS="你的程序输出";
$MSG_FILENAME="文件名";
$MSG_SIZE="大小";
// reinfo.php 友好提示
$MSG_RUNTIME_GENERIC_ERROR="程序运行时发生了未明确的错误。建议:检查边界条件、空输入、特殊值处理。";
$MSG_FORBIDDEN_SYSCALL="使用了系统禁止的操作系统调用,看看是否越权访问了文件或进程等资源。";
$MSG_HINT_TLE="程序运行超过了题目设定的时间限制 (TLE)。常见原因:算法复杂度过高(如 O() n 10、死循环、I/O 效率低(建议用 scanf/printf 或更快 I/O";
$MSG_HINT_MLE="程序使用的内存超过了题目设定的限制 (MLE)。常见原因:数组开得过大、递归过深未释放、全局变量占用空间过多。";
$MSG_HINT_OLE="输出内容超过了限制 (OLE)。常见原因:死循环输出、忘记换行、调试信息未删除。";
$MSG_RAW_ERROR="查看原始错误信息";
$MSG_RESULT_BANNER="判题结果";
$MSG_QUICK_ACTIONS="快捷操作";
$MSG_RESUBMIT="重新提交";
$MSG_VIEW_SOURCE="查看我的代码";
$MSG_VIEW_PROBLEM="查看题目";
$MSG_DOWNLOAD_DATA="下载测试数据";
$MSG_FRIENDLY_EXPLAIN="错误解释";
$MSG_DEDUP_HINT="已折叠 %d 个相同测试点";
$MSG_AI_REVIEW_DESC="基于你的代码和判题结果分析";
$MSG_DEDUP_GROUP="%s: %s ( %d 个测试点)";
// 新增 RE 模式(覆盖 glibc / Java / Python / Go
$MSG_STACK_SMASHING_DETECTED="栈保护触发stack smashing detected通常是数组越界写入了栈上的数据。检查字符数组、循环写入是否越界。";
$MSG_TERMINATE_CALLED="C++ 抛出未捕获的异常terminate called after throwing an instance of...)。检查代码中的 throw 语句是否有对应的 try/catch";
$MSG_NULL_POINTER_EXCEPTION="空指针异常NullPointerException。某处对未初始化的对象调用了方法或访问了字段。";
$MSG_NUMBER_FORMAT_EXCEPTION="数字格式异常NumberFormatException。把非数字字符串转换成数字时出错检查输入解析逻辑。";
$MSG_CLASS_CAST_EXCEPTION="类型转换异常ClassCastException。把对象强制转换为不兼容的类型。";
$MSG_NEGATIVE_ARRAY_SIZE_EXCEPTION="数组长度为负数NegativeArraySizeException。检查计算数组长度时是否出现负值。";
$MSG_PYTHON_TRACEBACK="Python 抛出异常,下方是调用栈,从下往上读就是异常发生的位置。";
$MSG_PYTHON_RECURSION_ERROR="递归层数过多RecursionError。递归深度超过了默认限制1000考虑改为迭代或手动加深递归限制。";
$MSG_PYTHON_INDENTATION_ERROR="缩进错误IndentationError。Python 用缩进表示代码块,请检查空格/Tab 是否混用。";
$MSG_PYTHON_ZERO_DIVISION="除以零错误ZeroDivisionError";
$MSG_PYTHON_NAME_ERROR="使用了未定义的变量或函数NameError。检查拼写、是否忘记 import。";
$MSG_GO_PANIC="Go 运行时报错panic通常是越界访问、nil 指针或类型断言失败。";
$MSG_ABORTED_CORE_DUMPED="程序被 abort() 终止Aborted通常源于 assert 失败或 std::terminate。";
// template/../ceinfo.php
$MSG_ERROR_EXPLAIN="辅助解释";

View File

@@ -357,6 +357,39 @@
$MSG_INVALID_CONVERSION="The implicit type conversion is invalid, try to use explicit coercion such as (int *)malloc(....)";
$MSG_NO_RETURN_TYPE_IN_MAIN="In the C++ standard, the main function must have a return value.";
$MSG_NOT_DECLARED_IN_SCOPE="The variable has not been declared, check for spelling errors!";
// reinfo.php friendly hints
$MSG_RUNTIME_GENERIC_ERROR="An unspecified runtime error occurred. Check boundary conditions, empty inputs, and edge cases.";
$MSG_FORBIDDEN_SYSCALL="A forbidden system call was used. Check if you tried to access files, network, or processes directly.";
$MSG_HINT_TLE="Time Limit Exceeded (TLE). Common causes: high algorithm complexity (e.g. O(n²) when n ≤ 10⁵), infinite loops, slow I/O. Use scanf/printf or faster I/O.";
$MSG_HINT_MLE="Memory Limit Exceeded (MLE). Common causes: oversized arrays, deep recursion, unreleased memory.";
$MSG_HINT_OLE="Output Limit Exceeded (OLE). Common causes: infinite output loops, missing newlines, leftover debug prints.";
$MSG_RAW_ERROR="View raw error information";
$MSG_RESULT_BANNER="Verdict";
$MSG_QUICK_ACTIONS="Quick actions";
$MSG_RESUBMIT="Resubmit";
$MSG_VIEW_SOURCE="View my code";
$MSG_VIEW_PROBLEM="View problem";
$MSG_DOWNLOAD_DATA="Download test data";
$MSG_FRIENDLY_EXPLAIN="Error explanation";
$MSG_DEDUP_HINT="Collapsed %d duplicate test cases";
$MSG_AI_REVIEW_DESC="Analyzing your code and verdict";
$MSG_DEDUP_GROUP="%s: %s (in %d test cases)";
// Additional RE patterns
$MSG_STACK_SMASHING_DETECTED="Stack smashing detected. Usually means an out-of-bounds write into a stack buffer. Check char arrays and loop write bounds.";
$MSG_TERMINATE_CALLED="C++ exception was thrown but not caught (terminate called after throwing). Check that all throw statements are wrapped in try/catch.";
$MSG_NULL_POINTER_EXCEPTION="NullPointerException. A method or field was called on an uninitialized object.";
$MSG_NUMBER_FORMAT_EXCEPTION="NumberFormatException. Failed to parse a non-numeric string as a number. Check your input parsing.";
$MSG_CLASS_CAST_EXCEPTION="ClassCastException. Tried to cast an object to an incompatible type.";
$MSG_NEGATIVE_ARRAY_SIZE_EXCEPTION="NegativeArraySizeException. The array size computed to a negative value.";
$MSG_PYTHON_TRACEBACK="Python raised an exception. The traceback below shows the call stack — read from bottom to top to find the origin.";
$MSG_PYTHON_RECURSION_ERROR="RecursionError: maximum recursion depth exceeded. Consider converting to iteration or raising the limit.";
$MSG_PYTHON_INDENTATION_ERROR="IndentationError. Python uses indentation for code blocks. Check for mixed tabs/spaces.";
$MSG_PYTHON_ZERO_DIVISION="ZeroDivisionError.";
$MSG_PYTHON_NAME_ERROR="NameError. Used an undefined name (variable or function). Check spelling and imports.";
$MSG_GO_PANIC="Go panic — usually out-of-bounds access, nil pointer, or failed type assertion.";
$MSG_ABORTED_CORE_DUMPED="Aborted. Usually caused by a failed assert or std::terminate.";
$MSG_MAIN_MUST_RETURN_INT="In the standard C language, the return value type of the main function must be int, and the use of void in teaching materials and VC is a non-standard usage.";
$MSG_PRINTF_NOT_DECLARED_IN_SCOPE="The printf function is called without a declaration, and check whether the <stdio.h> or <cstdio> header file is imported.";
$MSG_IGNOREING_RETURN_VALUE="Warning: Ignore the return value of the function, it may be that the function is used incorrectly or the return value is not considered abnormal.";