Skip to content

Kevinxyk/RUC-YOJ-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOJ 状态助手

alt text

觉得好用记得给个 star 哦

这是一个基于 Chromium Manifest V3 的 YOJ 状态标记插件项目,当前按浏览器拆成两套独立目录:

  • chrome/:Chrome 版本
  • edge/:Edge 版本

两套插件功能保持一致,都会在 YOJ 题库页直接标记:

  • 已通过题目
  • 已尝试但尚未通过的题目
  • 最近一次非 AC 状态
  • 非 AC 题目的最高分

适用页面

  • 题库页:http://yoj.ruc.edu.cn/index.php/index/problem/index.html

工作方式

插件只在登录后的 YOJ 页面上工作,依赖浏览器当前的登录态:

  1. 读取个人数据页 /index.php/index/user/detail.html,提取“通过的题目”列表。
  2. 读取提交记录页 /index.php/index/submissions/index.html 及其分页,汇总每道题的提交状态。
  3. 在题库页每道题后插入状态徽标,并将结果缓存到浏览器本地存储。

当前实现

  • 自动在题库页同步数据
  • 本地缓存 6 小时
  • 弹窗支持手动刷新
  • 最多扫描最近 80 页提交记录

如果个人提交记录超过 80 页:

  • AC 标记仍然可靠,因为来自个人数据页的通过题目列表
  • “做过但没过”的识别仅覆盖最近 80 页记录

目录结构

yoj plugin/
├─ chrome/
│  ├─ manifest.json
│  ├─ content-script.js
│  ├─ content-style.css
│  ├─ popup.html
│  └─ popup.js
├─ edge/
│  ├─ manifest.json
│  ├─ content-script.js
│  ├─ content-style.css
│  ├─ popup.html
│  └─ popup.js
├─ .gitignore
└─ README.md

加载方式

Chrome

  1. 打开 Chrome。
  2. 进入 chrome://extensions/
  3. 打开“开发者模式”。
  4. 选择“加载已解压的扩展程序”。
  5. 选择目录 chrome/

Edge

  1. 打开 Edge。
  2. 进入 edge://extensions/
  3. 打开“开发人员模式”。
  4. 选择“加载解压缩的扩展”。
  5. 选择目录 edge/

已知限制

  • 目前只对题库页做 UI 标记。
  • 依赖 YOJ 当前 HTML 结构;如果内网页面模板改动,需要同步调整解析规则。

About

RUC YOJ 平台状态助手

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors