Skip to content

Refactor ExportUtil#301

Open
ZnPdCo wants to merge 10 commits into
Project-LemonLime:masterfrom
ZnPdCo:rewrite-export
Open

Refactor ExportUtil#301
ZnPdCo wants to merge 10 commits into
Project-LemonLime:masterfrom
ZnPdCo:rewrite-export

Conversation

@ZnPdCo
Copy link
Copy Markdown
Contributor

@ZnPdCo ZnPdCo commented May 7, 2026

这个 pr 做了什么

  • 将 HTML 导出从 C++ 拼接 HTML 字符串重写为 JSON + 模板方案:C++ 端通过 buildExportJson() 构建数据 JSON,嵌入 export_template.html%%DATA%% 占位符,由浏览器端 JS 完成渲染
  • 移除 XLS 导出
  • 移除 .htm 导出
  • 对导出支持了按每道题排序

测试了 CSP 2025 J,并添加了一个题答题作为测试:result.html

感觉,打开会慢一点,不过还可以接受。

ZnPdCo and others added 7 commits April 26, 2026 13:25
- Removed the HTML generation logic from ExportUtil::exportHtml and replaced it with JSON output.
- Introduced a new method, ExportUtil::buildExportJson, to construct a JSON representation of contest results.
- Updated the exportHtml method to read from an HTML template and insert the generated JSON data.
- Cleaned up unused methods and includes related to HTML generation.
- Enhanced the structure of the JSON output to include contestant details, task scores, and additional metadata.
@ZnPdCo ZnPdCo marked this pull request as draft May 13, 2026 08:36
ZnPdCo and others added 3 commits May 31, 2026 10:17
- Remove redundant "what" comments from buildExportJson
- Simplify updateHeaderIndicators by reducing nesting
- Unify DOM construction in template (innerHTML -> DOM API)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Use C++-side info string for status text instead of template-side file/no_source check
- Add compile_message field for compile error details
- AnswersOnly without info no longer shows spurious text

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ZnPdCo ZnPdCo marked this pull request as ready for review May 31, 2026 04:13
info = tr("Cannot find valid source file");
break;
case CompileTimeLimitExceeded:
info = tr("Source file: ") + contestant->getSourceFile(j) + QString(", ") +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这边改成 tr("Source file: %1, Compile time limit exceeded").arg(xxx) 是不是会好一点,做翻译也比较容易调整语序,下同。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants