625f2466e50c4501de3f2955ceba3e7f26449785
同一个剥前缀函数在 submission 和 flowchart 的管理端各有一份逐字相同的
拷贝,conf 里还有一份内联写法,合并到 utils/shortcuts.strip_class_prefix。
改名是因为原名 get_real_name 和 UserProfile.real_name 字段、以及三个
serializer 里的同名方法都容易混。
行为上修了两处:
- 剥前缀改用 removeprefix,不再按长度硬切。班级号对不上时原样返回,
旧写法会从中间截出乱码(ks999王五 配 class_name=251 会切成「王五」)
- get_class_name 的正则从 \d+ 收紧到 \d{3,4},与前端
ButtonWithSearch 的 /^ks\d{3,4}/ 对齐。旧的贪婪匹配在姓名部分是纯
数字时会吃掉整串(ks251001 返回 251001 而不是 251)。顺带 re.search
换成 re.match,外层的 startswith 判断并进正则
正常数据(ks251张三、ks2510李四)新旧结果一致,已逐例对拍。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
OnlineJudge 2.0
An onlinejudge system based on Python and Vue. Demo
Overview
- Based on Docker; One-click deployment
- Separated backend and frontend; Modular programming; Micro service
- ACM/OI rule support; realtime/non-realtime rank support
- Amazing charting and visualization
- Template-problem support
- More reasonable permission control
- Multi-language support:
C,C++,Java,Python2,Python3 - Markdown & MathJax support
- Contest participants IP limit(CIDR)
Main modules are available below:
- Backend(Django): https://github.com/QingdaoU/OnlineJudge
- Frontend(Vue): https://github.com/QingdaoU/OnlineJudgeFE
- Judger Sandbox(Seccomp): https://github.com/QingdaoU/Judger
- JudgeServer(A wrapper for Judger): https://github.com/QingdaoU/JudgeServer
Installation
Follow me: https://github.com/QingdaoU/OnlineJudgeDeploy/tree/2.0
Documents
Screenshots
Frontend:
You can control the menu and chart status in rankings.
Admin:
Browser Support
Modern browsers(chrome, firefox) and Internet Explorer 10+.
Thanks
- I'd appreciate a star if you find this helpful.
- Thanks to everyone that contributes to this project.
- Special thanks to heb1c, who has given us a lot of suggestions.
License
Description












