Skip to content

Commit 1a35d4e

Browse files
committed
feat: 增加账户级录入年级识别规则
1 parent 55beed9 commit 1a35d4e

49 files changed

Lines changed: 921 additions & 67 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.en.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The home page offers photo upload, manual input and direct entry, with drag-and-
5959

6060
![Photo upload, manual input, direct entry, clipboard paste and screenshot on the home page](doc/screenshots/en/upload.png)
6161

62-
General settings control review before import, SVG animated explanations, GeoGebra demos, the similarity threshold for duplicate detection and the mastered threshold.
62+
General settings control review before import, the per-user grade rule (fixed grade or AI recognition), SVG animated explanations, GeoGebra demos, the similarity threshold for duplicate detection and the mastered threshold.
6363

6464
![Review before import, animated explanations, GeoGebra and duplicate threshold in General settings](doc/screenshots/en/preferences.png)
6565

@@ -133,6 +133,7 @@ Practice statistics show total practice, accuracy and active months, with distri
133133

134134
- **📷 Many ways to add questions**: upload images, paste from the clipboard (Ctrl/⌘+V), take a screenshot, or type the question (Markdown and LaTeX supported). Crop images (zoom with the mouse wheel, a pinch or the zoom buttons for precise selection), or select several questions on one image to import them in a batch.
135135
- **🤖 AI recognition and solving**: AI extracts the question text, answer, analysis, the student's wrong answer and the cause of the mistake, identifies the subject and picks tags from the knowledge library. Turn on "Review before importing" in **Settings → General** to check and edit results before saving.
136+
- **🎓 Grade rule for new questions**: choose a fixed grade or AI recognition per account under **Settings → General**. Fixed mode uses the selected grade and semester, falling back to the account's current grade if unset. AI infers the grade from the question and leaves it unset when uncertain. Applies to images, text, batch selection and Openclaw; manual choices take priority. Direct entry without a grade uses one short AI request, counted toward your daily limit; duplicates do not trigger it. Existing questions and restored grades are preserved.
136137
- **🔁 Duplicate detection**: on import, question text is compared by similarity. Above the threshold (90% by default, adjustable in settings) the question is not imported again; a new wrong attempt is recorded on the original instead.
137138
- **🆔 Question ID**: every question has a 6-digit ID you can copy or type into the notebook to open it directly. Printed questions and exams show the source ID so you can find the original when entering results.
138139

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
![首页的拍照上传、手动输入、直接录入、剪贴板粘贴和截屏入口](doc/screenshots/upload.png)
6161

62-
通用设置可调整导入前人工确认、SVG 动画讲解、GeoGebra 动态演示、题目判重相似度阈值和已掌握阈值。
62+
通用设置可调整导入前人工确认、录入题目的年级识别规则(固定年级或 AI 识别)、SVG 动画讲解、GeoGebra 动态演示、题目判重相似度阈值和已掌握阈值。
6363

6464
![通用设置中的导入确认、动画讲解、GeoGebra 和判重阈值](doc/screenshots/preferences.png)
6565

@@ -133,6 +133,7 @@
133133

134134
- **📷 多种录入方式**:上传图片、从剪贴板粘贴(Ctrl/⌘+V)、屏幕截图,或直接输入题目文字(支持 Markdown 和 LaTeX);图片可裁剪(支持滚轮、双指捏合或按钮缩放图片,方便精确框选),也可在一张图上框选多道题批量导入。
135135
- **🤖 AI 识别与解答**:识别题目文字、答案、解析、学生的错误解答和错因,判断学科,并从知识点库中选择标签。可在「设置 → 通用」中开启「导入前人工确认」,先在校对页修改再保存。
136+
- **🎓 录入年级规则**:在「设置 → 通用」按账户选择固定年级或 AI 识别。固定模式使用指定年级学期,未指定时沿用账户当前年级;AI 模式根据题目内容判断,无法确定时保持未设置。图片、文字、框选批量与 Openclaw 录入统一生效,手工选择优先。直接录入未填年级时会补充一次 AI 识别并计入每日用量,重复题不重复识别;已有题目和备份恢复的年级不受影响。
136137
- **🔁 重复题判定**:导入时比较题干相似度,超过阈值(默认 90%,可在设置中调整)的题目不会重复导入,而是在原题下记一次做错。
137138
- **🆔 题目 ID**:每道题有 6 位 ID,可复制,也可在错题本中输入 ID 直接打开该题;打印的错题和试卷都标有「来源 ID」,方便做完后定位原题录入结果。
138139

‎doc/wiki/Backup-and-Restore.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
在设置的数据管理入口导出 JSON,并妥善保存。普通用户导入时,导出文件中的用户邮箱必须与当前账户一致;管理员可以使用管理范围的全部数据导入导出。
1717

18-
错题的配图、GeoGebra 演示、中英文 SVG 动画讲解及其已合成的云端语音(MP3)、最近一次举一反三和掌握概率都会随导出文件还原,SVG 在导入时重新净化;没有掌握概率的题目导入后会重新评估。试卷连同题目和每次录入的结果一起还原;导出时仍在生成的题目导入后显示为失败,可在试卷页重新生成。导入本人的导出文件时,还会还原导入前人工校对、判重阈值、GeoGebra 演示、SVG 动画讲解和界面主题等偏好设置。
18+
错题的配图、GeoGebra 演示、中英文 SVG 动画讲解及其已合成的云端语音(MP3)、最近一次举一反三和掌握概率都会随导出文件还原,SVG 在导入时重新净化;没有掌握概率的题目导入后会重新评估。试卷连同题目和每次录入的结果一起还原;导出时仍在生成的题目导入后显示为失败,可在试卷页重新生成。导入本人的导出文件时,还会还原录入年级识别规则及固定年级、导入前人工校对、判重阈值、GeoGebra 演示、SVG 动画讲解和界面主题等偏好设置。
19+
20+
恢复备份时保留题目原有年级,不应用当前录入年级规则;旧文件未包含规则时不会覆盖当前账户设置。
1921

2022
导入时会合并已有错题本、标签,并按题干相似度处理重复题目。重复题可能在已有题目下新增一次做错记录,因此反复导入同一份文件可能改变练习历史。
2123

‎doc/wiki/Openclaw-Integration.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,16 @@ curl --fail-with-body http://localhost:3000/api/openclaw/batch-upload \
9696
"answerText": "答案",
9797
"analysis": "解析",
9898
"knowledgePoints": ["知识点名称"],
99-
"difficultyStars": 3
99+
"difficultyStars": 3,
100+
"gradeSemester": "四年级上"
100101
}
101102
}
102103
```
103104

104105
还可返回 `wrongAnswerText`、`mistakeAnalysis`、`subject`、`errorType` 和 `source`;失败时返回 `success: false` 与 `error`。
105106

107+
录入年级遵循目标用户在「设置 → 通用」保存的规则。固定模式使用所选值,未指定时按账户当前年级计算;AI 模式使用识别结果中的 `gradeSemester`(如「四年级上」「初二下」),无法确定时可返回 `null`。省略该字段时,错题本会为非重复题补充一次 AI 年级识别,计入目标用户的每日 AI 用量;达到上限或识别失败时,该题返回失败,需读取逐项结果。
108+
106109
## 结果判断
107110

108111
| 结果 | 判断方式 |

‎doc/wiki/Settings-and-Users.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
| 设置 | 默认行为 |
88
| --- | --- |
99
| 导入前人工确认 | 开启后先校对再保存,适合需要逐题核对的场景 |
10+
| 录入题目的年级识别规则 | 默认固定模式,使用所选年级学期;未指定时沿用账户当前年级,也可切换为 AI 识别 |
1011
| SVG 动画讲解 | 默认开启 |
1112
| GeoGebra 动态演示 | 默认关闭 |
1213
| 题目判重相似度阈值 | 默认 90%,相似度严格大于阈值时判重 |
@@ -16,6 +17,16 @@
1617

1718
个人偏好按用户保存。AI 服务配置和应用时区属于全局设置,需要管理员权限。
1819

20+
## 录入题目的年级识别规则
21+
22+
在「设置 → 通用」选择规则后点击「保存年级规则」,普通用户和管理员均可修改自己的规则。
23+
24+
- **固定年级**:新题使用所选年级学期;未指定时,按账户的学段、入学年份和应用时区推算当前年级。明确指定的固定值不会随学年变化。
25+
- **AI 识别**:根据题目内容、知识点和教材进度判断,识别时不注入学生当前年级;无法确定时保持未设置。
26+
- 规则适用于图片识别、文字解题、框选批量、直接录入和 Openclaw 批量上传。手工填写或在校对页修改的年级优先。
27+
- 图片和文字解题会在原有 AI 请求中返回年级;直接录入或外部识别结果缺少年级时,补充一次短请求并计入每日 AI 用量。重复题不再识别年级,已识别但无法确定的结果不会反复请求。
28+
- 只影响新录入的题目;修改规则不会批量改动已有题目,恢复备份时保留题目原年级。规则及固定值会随本人的 JSON 备份保存和恢复。
29+
1930
## 应用时区
2031

2132
应用默认使用北京时间 `Asia/Shanghai`。管理员在“设置 → 通用 → 应用时区”输入有效的 IANA 时区名称并保存,例如 `UTC`、`Europe/London` 或 `America/New_York`。

‎doc/wiki/User-Guide.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050

5151
![题干、知识点、难度与试题信息](https://raw.githubusercontent.com/margrop/wrong-notebook/70b66950931f6f723083e3726fbc97f2f65d2ea8/doc/screenshots/question-detail.png)
5252

53+
新题目的年级可以在「设置 → 通用」选择固定或 AI 识别规则,手工选择优先,详情见[设置与用户管理](Settings-and-Users)。
54+
5355
## 配图和动态讲解
5456

5557
- **SVG 配图**:由 AI 根据题目生成静态 SVG,供详情、练习和打印使用;原图可单独查看。

‎doc/wiki/en/Backup-and-Restore-en.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ The JSON export does not include full user accounts with passwords or the server
1515

1616
Export JSON from the data management section in the settings and keep it safe. When a regular user imports, the email in the export file must match the current account; admins can import and export data for all users.
1717

18-
Question figures, GeoGebra demos, Chinese and English SVG animations with their synthesized cloud voice (MP3), the latest similar question and mastery probability are all restored from the export file; SVG is sanitized again on import, and questions without a mastery probability are re-evaluated after import. Exam papers are restored together with their questions and every recorded result; questions still being generated at export time show as failed after import and can be regenerated on the exam page. Importing your own export file also restores preferences such as review before import, the duplicate threshold, GeoGebra demos, SVG animations and the interface theme.
18+
Question figures, GeoGebra demos, Chinese and English SVG animations with their synthesized cloud voice (MP3), the latest similar question and mastery probability are all restored from the export file; SVG is sanitized again on import, and questions without a mastery probability are re-evaluated after import. Exam papers are restored together with their questions and every recorded result; questions still being generated at export time show as failed after import and can be regenerated on the exam page. Importing your own export file also restores preferences such as the question grade rule and fixed grade, review before import, the duplicate threshold, GeoGebra demos, SVG animations and the interface theme.
1919

2020
Import merges existing notebooks and tags and handles duplicates by question similarity. A duplicate may add another wrong attempt under the existing question, so importing the same file repeatedly can change the practice history.
2121

2222
Keep the original backup before importing, and afterwards check the new questions, tags, duplicate count and answer history. To restore to an exact point in time, use a file backup.
2323

24+
Restoring a backup keeps each question's original grade and does not apply the current entry rule. Old backups without a grade rule leave your current account settings unchanged.
25+
2426
## Docker full-site backup
2527

2628
This example uses the directory layout from the [deployment guide](Deployment-en). Stopping the app before archiving keeps the SQLite data file, its WAL/SHM files and the configuration consistent.

‎doc/wiki/en/Openclaw-Integration-en.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,16 @@ The basic successful response:
9696
"answerText": "Answer",
9797
"analysis": "Analysis",
9898
"knowledgePoints": ["Knowledge point name"],
99-
"difficultyStars": 3
99+
"difficultyStars": 3,
100+
"gradeSemester": "四年级上"
100101
}
101102
}
102103
```
103104

104105
It may also return `wrongAnswerText`, `mistakeAnalysis`, `subject`, `errorType` and `source`. On failure, return `success: false` with `error`.
105106

107+
The target user’s grade rule under **Settings → General** applies. Fixed mode uses the selected value, or the current account grade when unset. AI mode uses `gradeSemester` from the recognition result, stored in Chinese (for example, `四年级上` or `初二下`); return `null` when uncertain. If the field is omitted, the app makes one short AI grade request for a non-duplicate question, counted toward that user’s daily limit. A quota or recognition failure fails that item; inspect the per-item results.
108+
106109
## Interpreting results
107110

108111
| Result | How to tell |

‎doc/wiki/en/Settings-and-Users-en.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ After signing in, open "Settings → General" to adjust your own preferences:
77
| Setting | Default |
88
| --- | --- |
99
| Review before import | When on, review before saving; useful when every question must be checked |
10+
| Grade recognition for new questions | Fixed mode by default: use the chosen grade and semester, or the current account grade if unset; AI recognition is also available |
1011
| SVG animated explanations | On |
1112
| GeoGebra interactive demos | Off |
1213
| Duplicate similarity threshold | 90%; a question is a duplicate when the similarity is strictly greater |
@@ -16,6 +17,16 @@ The interface theme is not in Settings; switch it with the theme button in the t
1617

1718
Personal preferences are saved per user. The AI service configuration and the app time zone are global settings that require admin rights.
1819

20+
## Grade recognition for new questions
21+
22+
Choose a rule under **Settings → General** and click **Save grade rule**. Regular users and admins each manage their own rule.
23+
24+
- **Fixed grade**: use the selected grade and semester. If unset, calculate the current grade from the account's school stage, enrollment year and app time zone. An explicitly selected fixed value stays the same across school years.
25+
- **AI recognition**: infer the grade and semester from the question, knowledge points and curriculum progress, without injecting the student's current grade. Leave them unset when uncertain.
26+
- Applies to image recognition, text solving, batch selection, direct entry and Openclaw uploads. A grade entered manually or changed during review takes priority.
27+
- Image recognition and text solving return the grade in the same AI request. Direct entry and external results missing a grade use one short additional request, counted toward the daily AI limit. Duplicates do not trigger it; an attempted but uncertain result is not requested again.
28+
- Affects new questions only. Existing questions and grades restored from backups stay as they were. Your rule and fixed value are included in your JSON backup.
29+
1930
## App time zone
2031

2132
The app uses Beijing time, `Asia/Shanghai`, by default. Admins enter a valid IANA time zone name in "Settings → General → App time zone" and save, for example `UTC`, `Europe/London` or `America/New_York`.

‎doc/wiki/en/User-Guide-en.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Unrated questions are not assigned a paper level by the default rule alone. Rege
5050

5151
![Question text, knowledge points, difficulty and question info](https://raw.githubusercontent.com/margrop/wrong-notebook/a5f816515e3dc31dcdb90c9fa456baed12eef94d/doc/screenshots/en/question-detail.png)
5252

53+
Choose a fixed grade or AI recognition for new questions under **Settings → General**. Manual choices take priority; see [Settings and Users](Settings-and-Users-en).
54+
5355
## Figures and animated explanations
5456

5557
- **SVG figures**: static SVG generated by the AI from the question, used on the detail page, in practice and in printouts; the original image can still be viewed separately.

0 commit comments

Comments
 (0)