feat(classes): optimize teacher dashboard ui and implement grade management

This commit is contained in:
SpecialX
2026-01-14 13:59:11 +08:00
parent ade8d4346c
commit 9bfc621d3f
104 changed files with 12793 additions and 2309 deletions

View File

@@ -9,10 +9,28 @@ import {
createKnowledgePoint,
deleteKnowledgePoint,
updateTextbook,
deleteTextbook
deleteTextbook,
reorderChapters
} from "./data-access";
import { CreateTextbookInput, UpdateTextbookInput } from "./types";
// ... existing code ...
export async function reorderChaptersAction(
chapterId: string,
newIndex: number,
parentId: string | null,
textbookId: string
): Promise<ActionState> {
try {
await reorderChapters(chapterId, newIndex, parentId);
revalidatePath(`/teacher/textbooks/${textbookId}`);
return { success: true, message: "Chapters reordered successfully" };
} catch {
return { success: false, message: "Failed to reorder chapters" };
}
}
export type ActionState = {
success: boolean;
message?: string;