Merge Yuxi teacher support with classroom discussions
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
鲨鱼辣椒
2026-09-24 10:27:36 +08:00
34 changed files with 2333 additions and 105 deletions

View File

@@ -4,6 +4,7 @@ import type {
TeacherAvailability,
TeacherCheckInInput,
TeacherCheckInResult,
TeacherCatalog,
TeacherDefinition,
TeacherDiscussionAction,
TeacherSend,
@@ -17,6 +18,7 @@ export function teacherTopicsPath(projectId: string, sourceId: string, role?: Co
: `/api/coding/projects/${encodeURIComponent(projectId)}/conversations/${encodeURIComponent(sourceId)}/teacher-topics`;
}
export const teacherApi = {
catalog: () => hostApiFetch<TeacherCatalog>('/api/coding/teacher/teachers'),
checkIn: (projectId: string, input: TeacherCheckInInput) =>
hostApiFetch<TeacherCheckInResult>(`/api/coding/projects/${encodeURIComponent(projectId)}/teacher-check-in`, {
method: 'POST',
@@ -31,10 +33,10 @@ export const teacherApi = {
'/api/coding/teacher-preview?draftRevision=' + draftRevision
),
list: (base: string) => hostApiFetch<TeacherTopicList>(base),
create: (base: string, draftRevision?: number, sampleContext?: string) =>
create: (base: string, draftRevision?: number, sampleContext?: string, teacherVersion?: number) =>
hostApiFetch<TeacherTopic>(base, {
method: 'POST',
body: JSON.stringify({ draftRevision, sampleContext }),
body: JSON.stringify({ draftRevision, sampleContext, teacherVersion }),
}),
read: (base: string, id: string, select = true) =>
hostApiFetch<TeacherTopic>(base + '/' + encodeURIComponent(id) + (select ? '' : '?select=false')),