+
+
+
+
+ {profile.currentGrade && (
+
+
+
+
+ )}
+
+ )}
+
+ {profile.currentGrade && profile.currentSemester && (
+
+ {t.settings?.account?.gradeAppliedHint || "New questions will default to this grade. You can also configure AI grade recognition in General Settings."}
+
+ )}
+
diff --git a/src/lib/grade-options.ts b/src/lib/grade-options.ts
index 6a89fa93..ffcab4a6 100644
--- a/src/lib/grade-options.ts
+++ b/src/lib/grade-options.ts
@@ -2,3 +2,25 @@
export const GRADE_NAMES = ['一年级', '二年级', '三年级', '四年级', '五年级', '六年级', '初一', '初二', '初三', '高一', '高二', '高三', '大一', '大二', '大三', '大四'] as const;
export const GRADE_SEMESTERS = GRADE_NAMES.flatMap((grade) => [`${grade}上`, `${grade}下`]);
+
+/** 各教育阶段对应的年级名列表(索引区间,与 GRADE_NAMES 对齐) */
+export const STAGE_GRADE_RANGES: Record = {
+ primary: { start: 0, end: 6 },
+ junior_high: { start: 6, end: 9 },
+ senior_high: { start: 9, end: 12 },
+ university: { start: 12, end: 16 },
+};
+
+/** 某学段下的全部年级名 */
+export function gradesForStage(educationStage: string): string[] {
+ const range = STAGE_GRADE_RANGES[educationStage];
+ if (!range) return [];
+ return GRADE_NAMES.slice(range.start, range.end);
+}
+
+/** 从年级学期值(如「四年级上」「初一下」)解析出年级名和学期 */
+export function parseGradeSemester(value: string): { grade: string; semester: '上' | '下' } | null {
+ if (value.endsWith('上')) return { grade: value.slice(0, -1), semester: '上' };
+ if (value.endsWith('下')) return { grade: value.slice(0, -1), semester: '下' };
+ return null;
+}
diff --git a/src/lib/translations.ts b/src/lib/translations.ts
index e3de35a2..d8cfad84 100644
--- a/src/lib/translations.ts
+++ b/src/lib/translations.ts
@@ -268,7 +268,10 @@ export const translations = {
dialog: {
stageLabel: "Stage",
subjectLabel: "Subject",
- scopeHint: "Stage and subject cannot be changed after creation. AI picks knowledge tags only from this stage and subject.",
+ tagSetLabel: "Tag System",
+ tagSetDefault: "Built-in",
+ tagSetNames: { cnm: "People's Education Press Curriculum Standard" } as Record,
+ scopeHint: "Stage, subject and tag system cannot be changed after creation. AI picks knowledge tags only from this scope and tag system.",
title: "Create New Notebook",
desc: "Create separate notebooks for different subjects or chapters",
nameLabel: "Notebook Name",
@@ -524,6 +527,12 @@ export const translations = {
account: {
changePassword: "Change Password (Leave empty to keep)",
update: "Update Profile",
+ currentGrade: "Current Grade & Semester",
+ selectGrade: "Select Grade",
+ selectSemester: "Select Semester",
+ firstSemester: "1st Semester",
+ secondSemester: "2nd Semester",
+ gradeAppliedHint: "New questions will default to this grade. You can also configure AI grade recognition in General Settings.",
},
ai: {
anthropicBaseUrlHint: "Leave empty for the official API. For compatible services enter the base URL without /v1 (e.g. https://api.example.com/anthropic).",
@@ -1615,7 +1624,10 @@ export const translations = {
dialog: {
stageLabel: "学段",
subjectLabel: "学科",
- scopeHint: "学段和学科创建后不可修改,AI 只会从该学段、该学科的知识点中选择标签。",
+ tagSetLabel: "标签体系",
+ tagSetDefault: "内置体系",
+ tagSetNames: { cnm: "人教版课标体系" } as Record,
+ scopeHint: "学段、学科和标签体系创建后不可修改,AI 只会从该范围内选择知识点标签。",
title: "创建新错题本",
desc: "为不同科目或章节创建独立的错题本",
nameLabel: "错题本名称",
@@ -1871,6 +1883,12 @@ export const translations = {
account: {
changePassword: "修改密码 (留空不修改)",
update: "更新个人信息",
+ currentGrade: "当前年级学期",
+ selectGrade: "选择年级",
+ selectSemester: "选择学期",
+ firstSemester: "上学期",
+ secondSemester: "下学期",
+ gradeAppliedHint: "新录入的错题将默认使用该年级,也可在常规设置中配置 AI 年级识别。",
},
ai: {
anthropicBaseUrlHint: "留空使用官方接口;兼容服务请填写不含 /v1 的地址(如 https://api.example.com/anthropic)。",