Commit Graph

2285 Commits

Author SHA1 Message Date
70fed2d15d fix 2026-07-05 01:33:33 -06:00
10af0256b8 移除 OI 残留:UserProfile 的 oi_problems_status / total_score / add_score
判题不再写入 OI 相关状态后,UserProfile 上的 OI 字段永远为空/为 0:
- 删除 oi_problems_status、total_score 两列及 add_score() 方法
- ProfileProblemDisplayIDRefreshAPI 去掉 oi_problems 合并分支

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 11:40:45 -06:00
9535b64a4b 精简 Problem 模型:移除 rule_type / total_score / io_mode
系统只用 ACM 模式且题目固定标准 IO,这三列已无实际用途:
- rule_type / total_score:OI 专用,删除后 judge/dispatcher 的 OI 分支全部塌缩为 ACM
- io_mode:判题改为固定发送 Standard IO 常量;languages.py 的 seccomp_rule
  保留 dict 形态但改用字面量 key,不改判题机 wire 契约
- prompt 字段保留(预留给未来 AI 分析)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 11:40:38 -06:00
4743b0398a update 2026-07-04 11:07:24 -06:00
deae73cd88 feat: SQL 题测试点脚本回显接口
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 19:29:51 -06:00
803d6ca58d feat: SQL 题测试点预览接口
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 19:25:47 -06:00
f77b98d4d7 fix 2026-07-03 18:34:12 -06:00
fc09d291a7 fix 2026-07-03 18:28:25 -06:00
979c709333 fix 2026-07-03 18:19:16 -06:00
16ec78beae feat: SQL 提交前自动格式化(sqlparse)
- format_code 新增 sql 分支,reindent + 关键字大写
- FormatCodeSerializer 的 language choices 加入 sql

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:05:38 -06:00
2ec036ac37 feat: 新增 rebuild_sql_display 管理命令,为存量 SQL 题回填展示数据
生成逻辑从 ProblemBase._build_sql_display 提取为 problem.utils.generate_sql_display,
管理端保存与回填命令共用。命令支持 --dry-run / --force。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 09:42:11 -06:00
5af9d67fe2 fix: 终审修复——test_case_id 格式校验、modify 空变更报错、异常兜底与文档补充
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 06:26:00 -06:00
67079b5304 fix: _build_sql_display 兜底 info 结构损坏,避免 KeyError 导致 500
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:22:27 -06:00
06642b8131 feat: 保存 SQL 题时自动生成 sql_display 展示数据
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:15:58 -06:00
90531720bb fix: build_display modify 模式补齐被 DROP 的表条目
标准答案 DROP 表后该表不在 sqlite_master 中,changed_tables 会静默
遗漏;用初始展示数据补齐并标记 dropped=True。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:10:04 -06:00
09501469e2 feat: SQL 题展示数据生成 build_display
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:01:32 -06:00
caec69c809 docs: SQL 题数据化展示实施计划
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 00:56:10 -06:00
e244030e7a docs: SQL 题数据化展示设计文档
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 00:49:03 -06:00
1e6041d13d fix 2026-07-02 19:16:09 -06:00
9f7f818d51 新增 SQL 题型:SQLite 内联判题(不依赖外部沙箱)
- SQL 作为语言接入现有提交流程,judge_task 按 language 分流到 SQLJudgeDispatcher
- judge/sql_runner.py:内存 SQLite 判题核心,查询题比结果集/增删改题比表状态,
  authorizer + progress_handler + max_page_count 三重防护
- dispatcher 提取 _process_judge_result/_push_status 供 SQL 判题复用(行为不变)
- 测试点通道支持 1.sql..N.sql 压缩包,出题只需数据脚本+标准答案
- Problem 增加 sql_config 字段;options 数据迁移注册 SQL 语言

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 17:23:13 -06:00
d1a1c05b9f add new type of self-learning 2026-06-29 19:37:59 -06:00
180d75cb97 fix 2026-06-29 06:41:18 -06:00
c1ec9eab8f update 2026-06-14 09:43:33 -06:00
124a1d84d3 update 2026-06-14 09:42:25 -06:00
9949ebf1c5 fix 2026-06-14 09:27:21 -06:00
90d1a2aa30 fix 2026-06-14 09:19:01 -06:00
dab6734d03 switch docker image 2026-06-14 09:13:05 -06:00
fa6736b855 docs: design Debian slim backend image 2026-06-14 09:08:36 -06:00
322acc543f build: install clang-extra-tools for clang-format in backend image
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 08:07:50 -06:00
7974d12475 build: move ruff from dev to main dependencies (needed at runtime for code formatting)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 08:05:12 -06:00
f7fbfdba7d fix(submission): revert unnecessary CSRF exemption on FormatCodeAPI
The CSRF 403 error was expected Django behavior (no CSRF cookie in curl).
FormatCodeAPI should follow SubmissionAPI's pattern (APIView, not CSRF-exempt).
Verified with GET request: /api/format_code returns 405 (correct route resolution).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 08:02:06 -06:00
5cc5c64625 feat(submission): register /api/format_code route and fix CSRF exemption
Task 4: Register the FormatCodeAPI view to the /api/format_code endpoint.

Also fix: Make FormatCodeAPI extend CSRFExemptAPIView instead of APIView
so that the manual verification curl commands receive JSON responses
(login-required error) instead of HTML 403 Forbidden responses. This is
necessary for the view to work with the @login_required decorator which
expects to return JSON errors, not be blocked by CSRF middleware.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:57:24 -06:00
be1610faa6 feat(submission): add FormatCodeAPI view 2026-06-14 07:51:41 -06:00
bfeb69434e feat(submission): add FormatCodeSerializer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:48:58 -06:00
4cd37cef78 feat(submission): add ruff/clang-format code formatting helper 2026-06-14 07:46:41 -06:00
69eb15ac27 Add implementation plan for pre-submit code auto-formatting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:43:51 -06:00
1bbc149e55 Add design spec for pre-submit code auto-formatting
Plan: ruff for Python3, clang-format (LLVM/4-space/Attach) for C/C++,
called via new /api/format_code endpoint before submission.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:41:03 -06:00
95949e565c update 2026-06-09 05:04:43 -06:00
69bd6af6ec update 2026-06-05 09:58:52 -06:00
d7e04adf07 fix 2026-06-05 09:46:49 -06:00
2b65acf91a update 2026-06-05 08:51:57 -06:00
84e972b174 update 2026-06-05 00:58:51 -06:00
6a7be0e97a fix 2026-06-04 23:59:20 -06:00
513743c767 update 2026-06-04 08:44:58 -06:00
6a870875ee add ai report 2026-06-04 08:06:31 -06:00
3d5ace65f2 feat: register ai admin URL routes 2026-06-04 07:31:14 -06:00
baed3b80f1 feat: add AIAnalysisAdminAPI for listing and reading reports 2026-06-04 07:27:24 -06:00
39f1e8b35e fix: use utils.api serializers import instead of rest_framework directly 2026-06-04 07:26:08 -06:00
f8cbcf28c1 feat: add AIAnalysis serializers for admin list/detail 2026-06-04 07:25:45 -06:00
b28301bbb1 fix 2026-06-04 05:31:23 -06:00