ClawHub
SkillsPluginsTemplatesDocsSupport
K
SkillsChaoxing Auto Grade

Chaoxing Auto Grade

chenghaozhangswu@chenghaozhangswu
Install in OpenClaw
Requires OpenClaw desktop app
超星学习通(MOOC)作业下载、自动批改与成绩处理。支持(1)通过Chrome CDP从超星教师端批量下载学生批阅HTML,(2)自动勾选显示客观题,(3)AI批改主观题,(4)清理HTML只保留题目-答案-分数。触发词:超星、学习通、自动批改、作业下载、成绩处理、主观题评分、填空题提取。
Security check
Review
Version
2.0.1
Updated
Jul 4, 2026
License
MIT-0

Latest: v2.0.1

  • Updated config.json configuration.
  • No code or workflow changes; documentation remains the same.
AutomationResearch
#playwright#学习

超星学习通 作业自动批改

工作流总览

text
① 配置 config.json → ② 下载作业HTML → ③ 提取主观题 → ④ AI批改 → ⑤ 写回评分 → ⑥ 清理输出

0. 前置准备

Chrome 远程调试

bash
# 以CDP模式启动Chrome(关闭所有Chrome窗口后运行)
chrome.exe --remote-debugging-port=9222 --remote-allow-origins=* --user-data-dir="C:\ChromeDebug"

安装依赖

bash
pip install websockets

1. 下载作业 HTML

bash
python scripts/download_homework.py --config config.json --login

--login 会在浏览器打开超星登录页,等待手动登录(或自动登录若密码已配置)。

无 --login 则假设已有登录态,直接开始下载。

参数

参数说明
--login首次运行需登录
--course "数据标注"只下载指定课程
--students "张三,李四"只下载指定学生

config.json 下载相关配置

json
{
  "login": {
    "chrome_port": 9222,
    "script_base": "https://mooc2-ans.chaoxing.com",
    "account": "手机号",
    "password": "密码",
    "cpi": "cpi参数(从超星URL获取)"
  },
  "download": {
    "target_students": ["学生A", "学生B"],
    "courses": [
      {"name": "课程名", "courseid": 123, "classes": [
        {"name": "班级名", "clazzid": 456}
      ]}
    ],
    "output_dir": "下载目录"
  }
}

获取 courseid / clazzid / cpi:登录后打开任意作业列表页,URL中 courseid=xxx&clazzid=xxx&cpi=xxx。

下载说明

  • 每个学生按姓名创建子目录,文件命名 学生名_课程_作业名.html
  • 自动勾选"显示客观题"checkbox + JS强制移除 display:none
  • 支持作业列表分页 + 学生列表分页
  • 已存在的文件自动跳过(断点续传)

2. 提取主观题 → JSON

bash
python scripts/extract_subj.py --config config.json

读取 paths.input_dir 下所有HTML → 提取主观题(简答题)题干、学生答案、满分 → 输出 {work_dir}/subj_questions.json


3. AI 批改主观题

bash
python scripts/grade_subj.py --config config.json

读取 subj_questions.json → 逐题调用LLM API评分 → 输出 {work_dir}/subj_graded.json

特性:

  • 断点续评(已有记录跳过)
  • 每 save_every 题自动保存
  • API限流控制 rate_limit_seconds

4. 写回评分到原始HTML

bash
python scripts/apply_scores.py --config config.json

读取 subj_graded.json → 在原始HTML的 <input class="inputBranch questionScore"> 更新 value → 原地修改


5. 清理HTML(最终输出)

bash
python scripts/clean_html.py --config config.json

读取 paths.input_dir → 输出到 paths.output_dir

处理内容:

  • 剥离 <script>、<style>、编辑器垃圾
  • 客观题(选择/判断):学生答案、正确答案、得分、✓/✗标记
  • 填空题:多空答案 | 分隔(<dd class="fillBox"> → <p>)
  • 主观题:读取AI评分后的分数
  • 文件头显示 总分汇总

缩减效果:~75MB → ~2.5MB(~97%)


HTML结构说明

清理后HTML

html
<div class="header">
  <div class="title">学生名 — 作业名</div>
  <div class="meta">总分: XX.Y / ZZZ 分</div>
</div>
<div class="section-title">客观题 (N题)</div>
<div class="q-block">
  <div class="q-title">✓/✗ N. (题型, 分数)</div>
  <div class="q-stem">题目</div>
  <div class="answer-row">学生答案: xxx</div>
  <div class="answer-row">正确答案: xxx</div>
  <div class="score-row">得分: X / Y 分</div>
</div>
<div class="section-title">主观题 (N题)</div>
<div class="q-block">
  <div class="subj-answer">学生答案: ...</div>
  <div class="score-row">得分: X.X / Y 分</div>
</div>

关键DOM约束(原始HTML)

  • 填空题学生答案:<dd class="fillBox"> → <p>,非旧版 学生答案:A 格式
  • 客观题对错标记基于得分对比(满分=✓)
  • 主观题分数从 <input class="inputBranch questionScore"> 的 value 读取

目录约定

text
output_dir/                  ← config.json → download.output_dir
├── 学生A/
│   ├── 学生A_课程_作业一.html
│   └── ...

work_dir/                    ← config.json → paths.work_dir
├── subj_questions.json      ← Step 2 输出
├── subj_graded.json         ← Step 3 输出

Related skills

More in Automation
ClawHub

Skills and plugins for OpenClaw agents. Part of the wider OpenClaw ecosystem.

Explore docs

SkillsPluginsTemplatesOfficialAudits

Publish SkillPublish PluginCreate org

OverviewOpenClawDocsBlog

SupportGitHubDiscord

Built alongside the OpenClaw ecosystem

LobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projectsLobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projects

© 2026 OpenClaw Foundation

Privacy policy·Status·Deployed on Vercel·Powered by Convex

....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals