homework-grade
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "homework-grade" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-240d42a3b0f8dd77df742cc13eebeee3cd3f25e94f5ca6028ea7e963089f6a17. Verify the upstream source and version against https://skillhub.cn/skills/user_56dd517d/homework-grade before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Homework grading tool: reads an Excel roster and student assignment folders from a directory, grades with AI, and writes the scores back to the Excel file.
Introduction source: third_party · user_56dd517d · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: homework-grader
description: "判作业:读取目录下的Excel名单和学生作业文件夹,AI批改评分后回写Excel"
version: "v1"
date: "2026-07-13"homework-grader — 判作业技能
概述
自动批改学生作业并登记分数到 Excel 成绩表。支持多次作业,每次评分自动创建新列。
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
homework_dir |
string | 是 | 作业存放目录的绝对路径 |
目录约定
作业目录结构必须如下:
{homework_dir}/
├── 成绩单.xlsx # 学生名单(作为判定基准)
├── 张三_作业1/ # 学生张三的作业文件夹
│ ├── 张三_作业1.py
│ └── ...
├── 李四_作业1/
│ ├── 李四_作业1.py
│ └── ...
├── 张三_作业2/
│ └── ...
└── ...
成绩单 Excel 格式要求
- 必须包含 学号 和 姓名 两列(表头名中文字段即可)
- 后续每次评分的分数,按新列追加,列名格式为
作业X得分(如作业1得分、作业2得分) - 程序自动识别已有作业列数,新作业自动创建下一列
学生作业文件夹命名规则
- 文件夹名必须包含学生姓名(用于匹配成绩单中的姓名)
- 建议格式:
{姓名}_{作业标识}(如张三_作业1) - 文件夹内容不限(Python 脚本、文档、图片等均可),技能会根据文件后缀选择读取方式
工作流程
Step 1 — 扫描目录结构
列出 homework_dir 下的所有子文件夹,每个视作一份学生作业提交。确认目录中有且只有一个 .xlsx 文件作为成绩单。
Step 2 — 读取成绩单
使用 pandas 或 openpyxl 读取 Excel,提取学生列表(学号、姓名)。确保姓名列无多余空格。
Step 3 — 匹配学生与作业
遍历每个子文件夹:
- 提取文件夹名中的姓名,与成绩单中的姓名做匹配(支持模糊匹配:去空格、去后缀)
- 读取文件夹内的作业文件:
.py/.js/.cpp/.java→ 代码文件,全文读取.md/.txt/.pdf→ 文字类作业,全文或摘要读取.jpg/.png→ 图片类作业,通过image工具分析
- 如果文件夹名无法匹配任何学生,记录到未匹配列表
Step 4 — AI 批改评分
对每份已匹配的作业:
- 将作业内容 + 作业要求(如果目录中有
要求.md或用户提供)作为上下文 - 调用模型能力进行批改,检查:
- 正确性(是否满足作业要求)
- 完整性(是否所有题目都做了)
- 规范性(代码风格 / 格式)
- 创新性(可选加分项)
- 输出评分(百分制或自定义评分标准),附带简要评语
Step 5 — 回写 Excel
- 检查成绩单中是否存在本作业的得分列
- 如果不存在,添加新列
作业N得分(N 自动递增) - 使用学号或姓名作为行索引,填入对应学生的分数
- 对于未提交作业的学生,填入
缺交或0 - 保存 Excel
Step 6 — 输出汇总报告
返回 Markdown 格式的批改报告,包含:
| 学号 | 姓名 | 提交状态 | 得分 | 评语 |
|---|---|---|---|---|
| 001 | 张三 | 已提交 | 95 | 完成良好 |
| 002 | 李四 | 未提交 | 缺交 | - |
同时给出整体统计:平均分、最高分、最低分、缺交人数。
注意事项
- Excel 文件锁定:操作前确保 Excel 未被其他程序打开
- 姓名匹配:使用精确匹配优先;模糊匹配时记录匹配日志供人工复核
- 评分标准:默认百分制;可在调用时通过参数
max_score自定义满分值 - 增量追加:多次判作业时,自动追加新列,不会覆盖已有分数
- 备份:修改 Excel 前自动创建备份文件
成绩单.bak.xlsx - 容错:单个作业判分失败不影响其他作业;失败项记录到错误日志
依赖
- Python 3.8+
- pandas / openpyxl(处理 Excel)
- python-docx(如需解析 Word 文档)
- PyMuPDF(如需解析 PDF)
可通过 pip install pandas openpyxl python-docx PyMuPDF 安装。
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决教师作业批改重复性痛点,实用价值高
- 支持多种文件类型(代码/文档/图片)批改
- 具备完整工作流和增量追加能力
Highlights
- 触发词精准覆盖核心功能(判作业/Excel/AI批改)
- 边界清晰不易混淆
Areas to improve
-
缺少When to Use章节 Reported severity: Minor
文档结构完整但缺少明确的适用场景说明章节
Recommendation: 建议补充When to Use章节说明典型使用场景
Highlights
- Phase划分清晰(6个Step)
- 目录约定和Excel格式要求明确
- frontmatter完整
Highlights
- 关键异常处理完善(Excel锁定/姓名匹配/备份)
- 容错设计合理(单作业失败不影响整体)
- 不可逆操作有备份机制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 118
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.