@studious-lms/server 1.2.46 → 1.2.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/index.js +22 -18
  2. package/dist/index.js.map +1 -1
  3. package/dist/middleware/auth.d.ts.map +1 -1
  4. package/dist/middleware/auth.js +3 -2
  5. package/dist/middleware/auth.js.map +1 -1
  6. package/dist/middleware/security.d.ts.map +1 -1
  7. package/dist/middleware/security.js +4 -4
  8. package/dist/middleware/security.js.map +1 -1
  9. package/dist/routers/_app.d.ts +126 -26
  10. package/dist/routers/_app.d.ts.map +1 -1
  11. package/dist/routers/assignment.d.ts +10 -0
  12. package/dist/routers/assignment.d.ts.map +1 -1
  13. package/dist/routers/assignment.js +18 -3
  14. package/dist/routers/assignment.js.map +1 -1
  15. package/dist/routers/class.d.ts +18 -0
  16. package/dist/routers/class.d.ts.map +1 -1
  17. package/dist/routers/class.js +56 -2
  18. package/dist/routers/class.js.map +1 -1
  19. package/dist/routers/conversation.d.ts +1 -0
  20. package/dist/routers/conversation.d.ts.map +1 -1
  21. package/dist/routers/labChat.d.ts +1 -0
  22. package/dist/routers/labChat.d.ts.map +1 -1
  23. package/dist/routers/labChat.js +5 -321
  24. package/dist/routers/labChat.js.map +1 -1
  25. package/dist/routers/message.d.ts +1 -0
  26. package/dist/routers/message.d.ts.map +1 -1
  27. package/dist/routers/message.js +3 -2
  28. package/dist/routers/message.js.map +1 -1
  29. package/dist/routers/newtonChat.d.ts.map +1 -1
  30. package/dist/routers/newtonChat.js +6 -183
  31. package/dist/routers/newtonChat.js.map +1 -1
  32. package/dist/routers/section.d.ts +10 -0
  33. package/dist/routers/section.d.ts.map +1 -1
  34. package/dist/routers/section.js +21 -3
  35. package/dist/routers/section.js.map +1 -1
  36. package/dist/routers/worksheet.d.ts +22 -13
  37. package/dist/routers/worksheet.d.ts.map +1 -1
  38. package/dist/routers/worksheet.js +16 -3
  39. package/dist/routers/worksheet.js.map +1 -1
  40. package/dist/seedDatabase.d.ts.map +1 -1
  41. package/dist/seedDatabase.js +34 -8
  42. package/dist/seedDatabase.js.map +1 -1
  43. package/dist/server/pipelines/aiLabChat.d.ts +12 -1
  44. package/dist/server/pipelines/aiLabChat.d.ts.map +1 -1
  45. package/dist/server/pipelines/aiLabChat.js +388 -15
  46. package/dist/server/pipelines/aiLabChat.js.map +1 -1
  47. package/dist/server/pipelines/aiNewtonChat.d.ts +30 -0
  48. package/dist/server/pipelines/aiNewtonChat.d.ts.map +1 -0
  49. package/dist/server/pipelines/aiNewtonChat.js +280 -0
  50. package/dist/server/pipelines/aiNewtonChat.js.map +1 -0
  51. package/dist/server/pipelines/gradeWorksheet.d.ts +14 -1
  52. package/dist/server/pipelines/gradeWorksheet.d.ts.map +1 -1
  53. package/dist/server/pipelines/gradeWorksheet.js +6 -5
  54. package/dist/server/pipelines/gradeWorksheet.js.map +1 -1
  55. package/dist/utils/inference.d.ts +3 -1
  56. package/dist/utils/inference.d.ts.map +1 -1
  57. package/dist/utils/inference.js +34 -4
  58. package/dist/utils/inference.js.map +1 -1
  59. package/package.json +1 -1
  60. package/prisma/schema.prisma +2 -0
  61. package/src/index.ts +24 -22
  62. package/src/middleware/auth.ts +1 -0
  63. package/src/middleware/security.ts +2 -2
  64. package/src/routers/assignment.ts +17 -2
  65. package/src/routers/class.ts +55 -0
  66. package/src/routers/labChat.ts +3 -366
  67. package/src/routers/message.ts +1 -1
  68. package/src/routers/newtonChat.ts +8 -231
  69. package/src/routers/section.ts +21 -1
  70. package/src/routers/worksheet.ts +17 -1
  71. package/src/seedDatabase.ts +38 -6
  72. package/src/server/pipelines/aiLabChat.ts +434 -19
  73. package/src/server/pipelines/aiNewtonChat.ts +338 -0
  74. package/src/server/pipelines/gradeWorksheet.ts +3 -4
  75. package/src/utils/inference.ts +40 -5
@@ -36,6 +36,15 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
36
36
  title: string;
37
37
  dueDate: Date;
38
38
  }[];
39
+ members: {
40
+ id: string;
41
+ username: string;
42
+ profile: {
43
+ displayName: string | null;
44
+ profilePicture: string | null;
45
+ profilePictureThumbnail: string | null;
46
+ } | null;
47
+ }[];
39
48
  color: string | null;
40
49
  }[];
41
50
  studentInClass: {
@@ -55,6 +64,15 @@ export declare const classRouter: import("@trpc/server").TRPCBuiltRouter<{
55
64
  title: string;
56
65
  dueDate: Date;
57
66
  }[];
67
+ members: {
68
+ id: string;
69
+ username: string;
70
+ profile: {
71
+ displayName: string | null;
72
+ profilePicture: string | null;
73
+ profilePictureThumbnail: string | null;
74
+ } | null;
75
+ }[];
58
76
  color: string | null;
59
77
  }[];
60
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"class.d.ts","sourceRoot":"/","sources":["routers/class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAguCtB,CAAC"}
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="90bd2ed8-f6aa-5bb5-b0f5-4d2643587610")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="767877f8-1e76-552f-92f2-c3b39f1302ec")}catch(e){}}();
3
3
  import { z } from "zod";
4
4
  import { createTRPCRouter, protectedProcedure, protectedTeacherProcedure, protectedClassMemberProcedure } from "../trpc.js";
5
5
  import { prisma } from "../lib/prisma.js";
@@ -32,6 +32,32 @@ export const classRouter = createTRPCRouter({
32
32
  dueDate: true,
33
33
  },
34
34
  },
35
+ students: {
36
+ select: {
37
+ id: true,
38
+ username: true,
39
+ profile: {
40
+ select: {
41
+ displayName: true,
42
+ profilePicture: true,
43
+ profilePictureThumbnail: true,
44
+ },
45
+ },
46
+ },
47
+ },
48
+ teachers: {
49
+ select: {
50
+ id: true,
51
+ username: true,
52
+ profile: {
53
+ select: {
54
+ displayName: true,
55
+ profilePicture: true,
56
+ profilePictureThumbnail: true,
57
+ },
58
+ },
59
+ },
60
+ },
35
61
  },
36
62
  }),
37
63
  prisma.class.findMany({
@@ -57,6 +83,32 @@ export const classRouter = createTRPCRouter({
57
83
  dueDate: true,
58
84
  },
59
85
  },
86
+ students: {
87
+ select: {
88
+ id: true,
89
+ username: true,
90
+ profile: {
91
+ select: {
92
+ displayName: true,
93
+ profilePicture: true,
94
+ profilePictureThumbnail: true,
95
+ },
96
+ },
97
+ },
98
+ },
99
+ teachers: {
100
+ select: {
101
+ id: true,
102
+ username: true,
103
+ profile: {
104
+ select: {
105
+ displayName: true,
106
+ profilePicture: true,
107
+ profilePictureThumbnail: true,
108
+ },
109
+ },
110
+ },
111
+ },
60
112
  },
61
113
  }),
62
114
  ]);
@@ -68,6 +120,7 @@ export const classRouter = createTRPCRouter({
68
120
  subject: cls.subject,
69
121
  dueToday: cls.assignments,
70
122
  assignments: cls.assignments,
123
+ members: [...cls.students, ...cls.teachers],
71
124
  color: cls.color,
72
125
  })),
73
126
  studentInClass: studentClasses.map(cls => ({
@@ -77,6 +130,7 @@ export const classRouter = createTRPCRouter({
77
130
  subject: cls.subject,
78
131
  dueToday: cls.assignments,
79
132
  assignments: cls.assignments,
133
+ members: [...cls.students, ...cls.teachers],
80
134
  color: cls.color,
81
135
  })),
82
136
  };
@@ -1109,4 +1163,4 @@ export const classRouter = createTRPCRouter({
1109
1163
  }),
1110
1164
  });
1111
1165
  //# sourceMappingURL=class.js.map
1112
- //# debugId=90bd2ed8-f6aa-5bb5-b0f5-4d2643587610
1166
+ //# debugId=767877f8-1e76-552f-92f2-c3b39f1302ec
@@ -1 +1 @@
1
- {"version":3,"file":"class.js","sources":["routers/class.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure, protectedTeacherProcedure, protectedClassMemberProcedure } from \"../trpc.js\";\nimport { prisma } from \"../lib/prisma.js\";\nimport { TRPCError } from \"@trpc/server\";\nimport { generateInviteCode } from \"../utils/generateInviteCode.js\";\n\nexport const classRouter = createTRPCRouter({\n getAll: protectedProcedure\n \n .query(async ({ ctx }) => {\n const [teacherClasses, studentClasses] = await Promise.all([\n prisma.class.findMany({\n where: {\n teachers: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: {\n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n },\n }),\n prisma.class.findMany({\n where: {\n students: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: { \n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n },\n }),\n ]);\n\n return {\n teacherInClass: teacherClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n color: cls.color,\n })),\n studentInClass: studentClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n color: cls.color,\n })),\n };\n }),\n get: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id },\n },\n },\n });\n\n const classData = await prisma.class.findUnique({\n where: {\n id: classId,\n },\n include: {\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n }\n }\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n announcements: {\n orderBy: {\n createdAt: 'desc',\n },\n select: {\n id: true,\n remarks: true,\n createdAt: true,\n modifiedAt: true,\n teacher: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n assignments: {\n ...(!isTeacher && {\n where: {OR: [\n {\n assignedTo: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n {\n assignedTo: {\n none: {},\n },\n },\n ],}\n }),\n select: {\n type: true,\n id: true,\n title: true,\n dueDate: true,\n createdAt: true,\n weight: true,\n order: true,\n graded: true,\n maxGrade: true,\n instructions: true,\n inProgress: true,\n template: false,\n section: {\n select: {\n id: true,\n name: true,\n },\n },\n markScheme: {\n select: {\n id: true,\n structured: true,\n },\n },\n gradingBoundary: {\n select: {\n id: true,\n structured: true,\n },\n },\n submissions: {\n ...(!isTeacher && {\n where: {\n studentId: ctx.user?.id,\n },\n }),\n select: {\n studentId: true,\n id: true,\n submitted: true,\n gradeReceived: true,\n rubricState: true,\n teacherComments: true,\n returned: true,\n submittedAt: true,\n },\n },\n },\n },\n },\n });\n\n\n if (!classData) {\n throw new Error('Class not found');\n }\n \n const formattedClassData = {\n ...classData,\n assignments: classData.assignments.map(assignment => ({\n ...assignment,\n late: assignment.dueDate < new Date(),\n submitted: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.submitted,\n returned: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.returned,\n })),\n }\n\n const sections = await prisma.section.findMany({\n where: {\n classId: classId,\n },\n });\n\n return {\n class: {\n ...formattedClassData,\n sections,\n },\n };\n }),\n update: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n name: z.string().optional(),\n section: z.string().optional(),\n subject: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...updateData } = input;\n \n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: updateData,\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n }\n }),\n create: protectedProcedure\n .input(z.object({\n students: z.array(z.string()).optional(),\n teachers: z.array(z.string()).optional(),\n name: z.string(),\n section: z.string(),\n subject: z.string(),\n color: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { students, teachers, name, section, subject, color } = input;\n \n if (teachers && teachers.length > 0 && students && students.length > 0) {\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: teachers.map(teacher => ({ id: teacher })),\n },\n students: {\n connect: students.map(student => ({ id: student })),\n },\n },\n include: {\n teachers: true,\n students: true,\n },\n });\n return newClass;\n }\n\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: {\n id: ctx.user?.id,\n },\n },\n },\n });\n \n return newClass;\n }),\n delete: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n id: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n // Verify user is the teacher of this class\n const classToDelete = await prisma.class.findFirst({\n where: {\n id: input.id,\n },\n });\n\n if (!classToDelete) {\n throw new Error(\"Class not found or you don't have permission to delete it\");\n }\n\n await prisma.class.delete({\n where: {\n id: input.id,\n },\n });\n\n return {\n deletedClass: {\n id: input.id,\n }\n }\n }),\n addStudent: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n studentId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, studentId } = input;\n\n const student = await prisma.user.findUnique({\n where: {\n id: studentId,\n },\n });\n\n if (!student) {\n throw new Error(\"Student not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: {\n students: {\n connect: {\n id: studentId,\n },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n newStudent: student,\n }\n }),\n changeRole: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n type: z.enum(['teacher', 'student']),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId, type } = input;\n\n const user = await prisma.user.findUnique({\n where: { id: userId },\n select: {\n id: true,\n username: true,\n },\n });\n\n if (!user) {\n throw new Error(\"User not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n [type === 'teacher' ? 'teachers' : 'students']: {\n connect: { id: userId },\n },\n [type === 'teacher' ? 'students' : 'teachers']: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n user: {\n ...user,\n type,\n },\n };\n }),\n removeMember: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n teachers: {\n disconnect: { id: userId },\n },\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n removedUserId: userId,\n };\n }),\n leaveClass: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n const userId = ctx.user?.id;\n\n if (!userId) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'User not authenticated',\n });\n }\n\n const classData = await prisma.class.findFirst({\n where: {\n id: classId,\n students: {\n some: { id: userId },\n },\n },\n });\n\n if (!classData) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Class not found or you are not a student in this class',\n });\n }\n\n await prisma.class.update({\n where: { id: classId },\n data: {\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n success: true,\n leftClassId: classId,\n };\n }),\n join: protectedProcedure\n .input(z.object({\n classCode: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classCode } = input;\n\n // Case-insensitive search for invite code\n const session = await prisma.session.findFirst({\n where: {\n id: {\n equals: classCode,\n mode: 'insensitive',\n },\n },\n });\n\n if (!session || !session.classId) {\n throw new Error(\"Class not found\");\n }\n\n if (session.expiresAt && session.expiresAt < new Date()) {\n throw new Error(\"Session expired\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: session.classId },\n data: {\n students: {\n connect: { id: ctx.user?.id },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return {\n joinedClass: updatedClass,\n }\n }),\n getInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const session = await prisma.session.findFirst({\n where: {\n classId,\n },\n });\n\n if ((session?.expiresAt && session.expiresAt < new Date()) || !session) {\n const newSession = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n return {\n code: newSession.id,\n }\n }\n\n return {\n code: session?.id,\n };\n }),\n createInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n\n await prisma.session.deleteMany({\n where: {\n classId,\n },\n });\n\n // Create a new session for the invite code\n const session = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n\n return {\n code: session.id,\n };\n }),\n getGrades: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id }\n }\n }\n });\n // If student, only allow viewing their own grades\n if (ctx.user?.id !== userId && !isTeacher) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'You can only view your own grades',\n });\n }\n\n const grades = await prisma.submission.findMany({\n where: {\n studentId: userId,\n assignment: {\n classId: classId,\n graded: true\n }\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n markSchemeId: true,\n markScheme: {\n select: {\n structured: true,\n }\n },\n gradingBoundaryId: true,\n gradingBoundary: {\n select: {\n structured: true,\n }\n },\n }\n },\n }\n });\n\n return {\n grades,\n };\n }),\n updateGrade: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n assignmentId: z.string(),\n submissionId: z.string(),\n gradeReceived: z.number().nullable(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, assignmentId, submissionId, gradeReceived } = input;\n\n // Update the grade\n const updatedSubmission = await prisma.submission.update({\n where: {\n id: submissionId,\n assignmentId: assignmentId,\n },\n data: {\n gradeReceived,\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n }\n }\n }\n });\n\n return updatedSubmission;\n }),\n getEvents: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const events = await prisma.event.findMany({\n where: {\n class: {\n id: classId,\n }\n },\n select: {\n name: true,\n startTime: true,\n endTime: true,\n }\n });\n\n return events;\n }),\n listMarkSchemes: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return markSchemes;\n }),\n createMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n updateMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.update({\n where: { id: markSchemeId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n deleteMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId } = input;\n\n const markScheme = await prisma.markScheme.delete({\n where: { id: markSchemeId },\n });\n\n return markScheme;\n }),\n listGradingBoundaries: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return gradingBoundaries;\n }),\n createGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n updateGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.update({\n where: { id: gradingBoundaryId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n deleteGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId } = input;\n\n const gradingBoundary = await prisma.gradingBoundary.delete({\n where: { id: gradingBoundaryId },\n });\n\n return gradingBoundary;\n }),\n getSyllabus: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({input}) => {\n const {classId} = input;\n\n const syllabus = (await prisma.class.findUnique({\n where: {\n id: classId,\n },\n }))?.syllabus;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n classId,\n }\n });\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n classId,\n }\n });\n\n return {syllabus, gradingBoundaries, markSchemes};\n }),\n updateSyllabus: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n contents: z.string(),\n }))\n .mutation(async ({ input }) => {\n const { contents, classId } = input;\n\n if (!contents) throw new TRPCError({\n code: 'BAD_REQUEST',\n message: \"Missing key contents\",\n });\n\n const updated = await prisma.class.update({\n where: {\n id: classId\n },\n data: {\n syllabus: contents,\n }\n });\n\n return updated;\n }),\n // Lab Management Endpoints (Assignment-based)\n listLabDrafts: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const labDrafts = await prisma.assignment.findMany({\n where: {\n classId: classId,\n teacherId: ctx.user?.id,\n inProgress: true,\n },\n orderBy: {\n modifiedAt: 'desc',\n },\n });\n\n return labDrafts;\n }),\n createLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n title: z.string(),\n type: z.enum(['LAB', 'HOMEWORK', 'QUIZ', 'TEST', 'PROJECT', 'ESSAY', 'DISCUSSION', 'PRESENTATION', 'OTHER']),\n instructions: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...draftData } = input;\n\n const labDraft = await prisma.assignment.create({\n data: {\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n graded: draftData.graded ?? false,\n maxGrade: draftData.maxGrade ?? 0,\n weight: draftData.weight ?? 1,\n dueDate: draftData.dueDate || new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Default 1 week from now\n title: draftData.title,\n instructions: draftData.instructions,\n type: draftData.type,\n ...(draftData.sectionId && { sectionId: draftData.sectionId }),\n ...(draftData.markSchemeId && { markSchemeId: draftData.markSchemeId }),\n ...(draftData.gradingBoundaryId && { gradingBoundaryId: draftData.gradingBoundaryId }),\n },\n });\n\n return labDraft;\n }),\n updateLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n title: z.string().optional(),\n instructions: z.string().optional(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...updateData } = input;\n\n const labDraft = await prisma.assignment.update({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n data: {\n ...(updateData.title && { title: updateData.title }),\n ...(updateData.instructions && { instructions: updateData.instructions }),\n ...(updateData.dueDate && { dueDate: updateData.dueDate }),\n ...(updateData.maxGrade !== undefined && { maxGrade: updateData.maxGrade }),\n ...(updateData.weight !== undefined && { weight: updateData.weight }),\n ...(updateData.graded !== undefined && { graded: updateData.graded }),\n ...(updateData.sectionId !== undefined && { sectionId: updateData.sectionId }),\n ...(updateData.markSchemeId !== undefined && { markSchemeId: updateData.markSchemeId }),\n ...(updateData.gradingBoundaryId !== undefined && { gradingBoundaryId: updateData.gradingBoundaryId }),\n modifiedAt: new Date(),\n },\n });\n\n return labDraft;\n }),\n deleteLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId } = input;\n\n const labDraft = await prisma.assignment.delete({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n return labDraft;\n }),\n publishLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...publishData } = input;\n\n // Get the lab draft\n const labDraft = await prisma.assignment.findUnique({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n if (!labDraft) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Lab draft not found',\n });\n }\n\n // Publish the draft by updating it to not be in progress\n const publishedAssignment = await prisma.assignment.update({\n where: { id: draftId },\n data: {\n inProgress: false,\n dueDate: publishData.dueDate || labDraft.dueDate,\n maxGrade: publishData.maxGrade || labDraft.maxGrade || 100,\n weight: publishData.weight || labDraft.weight || 1,\n graded: publishData.graded !== undefined ? publishData.graded : true,\n modifiedAt: new Date(),\n },\n });\n\n return publishedAssignment;\n }),\n getFiles: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n // Get all assignments with their files and submissions\n const assignments = await prisma.assignment.findMany({\n where: {\n classId: classId,\n },\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n submissions: {\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n annotations: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n student: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n teacher: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n orderBy: {\n createdAt: 'desc',\n },\n });\n\n // Organize files by assignment structure\n const organizedFiles = assignments.map(assignment => ({\n id: assignment.id,\n title: assignment.title,\n teacher: assignment.teacher,\n teacherAttachments: assignment.attachments,\n students: assignment.submissions.map(submission => ({\n id: submission.student.id,\n username: submission.student.username,\n attachments: submission.attachments,\n annotations: submission.annotations,\n })),\n }));\n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UAAU,CAAC,EAAE,CAAC,CAAC;YACpD,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,kBAAkB,EAAE,UAAU,CAAC,WAAW;YAC1C,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAClD,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE;gBACzB,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ;gBACrC,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,WAAW,EAAE,UAAU,CAAC,WAAW;aACpC,CAAC,CAAC;SACJ,CAAC,CAAC,CAAC;QAEJ,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC;CACP,CAAC,CAAC","debug_id":"90bd2ed8-f6aa-5bb5-b0f5-4d2643587610"}
1
+ {"version":3,"file":"class.js","sources":["routers/class.ts"],"sourceRoot":"/","sourcesContent":["import { z } from \"zod\";\nimport { createTRPCRouter, protectedProcedure, protectedTeacherProcedure, protectedClassMemberProcedure } from \"../trpc.js\";\nimport { prisma } from \"../lib/prisma.js\";\nimport { TRPCError } from \"@trpc/server\";\nimport { generateInviteCode } from \"../utils/generateInviteCode.js\";\n\nexport const classRouter = createTRPCRouter({\n getAll: protectedProcedure\n \n .query(async ({ ctx }) => {\n const [teacherClasses, studentClasses] = await Promise.all([\n prisma.class.findMany({\n where: {\n teachers: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: {\n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n }),\n prisma.class.findMany({\n where: {\n students: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n include: {\n assignments: {\n where: {\n dueDate: { \n lte: new Date(new Date().setHours(23, 59, 59, 999)),\n },\n template: false,\n },\n select: {\n id: true,\n title: true,\n type: true,\n dueDate: true,\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n }),\n ]);\n\n return {\n teacherInClass: teacherClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n })),\n studentInClass: studentClasses.map(cls => ({\n id: cls.id,\n name: cls.name,\n section: cls.section,\n subject: cls.subject,\n dueToday: cls.assignments,\n assignments: cls.assignments,\n members: [...cls.students, ...cls.teachers],\n color: cls.color,\n })),\n };\n }),\n get: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id },\n },\n },\n });\n\n const classData = await prisma.class.findUnique({\n where: {\n id: classId,\n },\n include: {\n teachers: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n }\n }\n },\n },\n students: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n announcements: {\n orderBy: {\n createdAt: 'desc',\n },\n select: {\n id: true,\n remarks: true,\n createdAt: true,\n modifiedAt: true,\n teacher: {\n select: {\n id: true,\n username: true,\n profile: {\n select: {\n displayName: true,\n profilePicture: true,\n profilePictureThumbnail: true,\n },\n },\n },\n },\n },\n },\n assignments: {\n ...(!isTeacher && {\n where: {OR: [\n {\n assignedTo: {\n some: {\n id: ctx.user?.id,\n },\n },\n },\n {\n assignedTo: {\n none: {},\n },\n },\n ],}\n }),\n select: {\n type: true,\n id: true,\n title: true,\n dueDate: true,\n createdAt: true,\n weight: true,\n order: true,\n graded: true,\n maxGrade: true,\n instructions: true,\n inProgress: true,\n template: false,\n section: {\n select: {\n id: true,\n name: true,\n },\n },\n markScheme: {\n select: {\n id: true,\n structured: true,\n },\n },\n gradingBoundary: {\n select: {\n id: true,\n structured: true,\n },\n },\n submissions: {\n ...(!isTeacher && {\n where: {\n studentId: ctx.user?.id,\n },\n }),\n select: {\n studentId: true,\n id: true,\n submitted: true,\n gradeReceived: true,\n rubricState: true,\n teacherComments: true,\n returned: true,\n submittedAt: true,\n },\n },\n },\n },\n },\n });\n\n\n if (!classData) {\n throw new Error('Class not found');\n }\n \n const formattedClassData = {\n ...classData,\n assignments: classData.assignments.map(assignment => ({\n ...assignment,\n late: assignment.dueDate < new Date(),\n submitted: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.submitted,\n returned: assignment.submissions.find(submission => submission.studentId === ctx.user?.id)?.returned,\n })),\n }\n\n const sections = await prisma.section.findMany({\n where: {\n classId: classId,\n },\n });\n\n return {\n class: {\n ...formattedClassData,\n sections,\n },\n };\n }),\n update: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n name: z.string().optional(),\n section: z.string().optional(),\n subject: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...updateData } = input;\n \n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: updateData,\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n }\n }),\n create: protectedProcedure\n .input(z.object({\n students: z.array(z.string()).optional(),\n teachers: z.array(z.string()).optional(),\n name: z.string(),\n section: z.string(),\n subject: z.string(),\n color: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { students, teachers, name, section, subject, color } = input;\n \n if (teachers && teachers.length > 0 && students && students.length > 0) {\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: teachers.map(teacher => ({ id: teacher })),\n },\n students: {\n connect: students.map(student => ({ id: student })),\n },\n },\n include: {\n teachers: true,\n students: true,\n },\n });\n return newClass;\n }\n\n const newClass = await prisma.class.create({\n data: {\n name,\n section,\n subject,\n color,\n teachers: {\n connect: {\n id: ctx.user?.id,\n },\n },\n },\n });\n \n return newClass;\n }),\n delete: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n id: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n // Verify user is the teacher of this class\n const classToDelete = await prisma.class.findFirst({\n where: {\n id: input.id,\n },\n });\n\n if (!classToDelete) {\n throw new Error(\"Class not found or you don't have permission to delete it\");\n }\n\n await prisma.class.delete({\n where: {\n id: input.id,\n },\n });\n\n return {\n deletedClass: {\n id: input.id,\n }\n }\n }),\n addStudent: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n studentId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, studentId } = input;\n\n const student = await prisma.user.findUnique({\n where: {\n id: studentId,\n },\n });\n\n if (!student) {\n throw new Error(\"Student not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: {\n id: classId,\n },\n data: {\n students: {\n connect: {\n id: studentId,\n },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n }\n });\n\n return {\n updatedClass,\n newStudent: student,\n }\n }),\n changeRole: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n type: z.enum(['teacher', 'student']),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId, type } = input;\n\n const user = await prisma.user.findUnique({\n where: { id: userId },\n select: {\n id: true,\n username: true,\n },\n });\n\n if (!user) {\n throw new Error(\"User not found\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n [type === 'teacher' ? 'teachers' : 'students']: {\n connect: { id: userId },\n },\n [type === 'teacher' ? 'students' : 'teachers']: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n user: {\n ...user,\n type,\n },\n };\n }),\n removeMember: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const updatedClass = await prisma.class.update({\n where: { id: classId },\n data: {\n teachers: {\n disconnect: { id: userId },\n },\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n updatedClass,\n removedUserId: userId,\n };\n }),\n leaveClass: protectedProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n const userId = ctx.user?.id;\n\n if (!userId) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'User not authenticated',\n });\n }\n\n const classData = await prisma.class.findFirst({\n where: {\n id: classId,\n students: {\n some: { id: userId },\n },\n },\n });\n\n if (!classData) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Class not found or you are not a student in this class',\n });\n }\n\n await prisma.class.update({\n where: { id: classId },\n data: {\n students: {\n disconnect: { id: userId },\n },\n },\n });\n\n return {\n success: true,\n leftClassId: classId,\n };\n }),\n join: protectedProcedure\n .input(z.object({\n classCode: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classCode } = input;\n\n // Case-insensitive search for invite code\n const session = await prisma.session.findFirst({\n where: {\n id: {\n equals: classCode,\n mode: 'insensitive',\n },\n },\n });\n\n if (!session || !session.classId) {\n throw new Error(\"Class not found\");\n }\n\n if (session.expiresAt && session.expiresAt < new Date()) {\n throw new Error(\"Session expired\");\n }\n\n const updatedClass = await prisma.class.update({\n where: { id: session.classId },\n data: {\n students: {\n connect: { id: ctx.user?.id },\n },\n },\n select: {\n id: true,\n name: true,\n section: true,\n subject: true,\n },\n });\n\n return {\n joinedClass: updatedClass,\n }\n }),\n getInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const session = await prisma.session.findFirst({\n where: {\n classId,\n },\n });\n\n if ((session?.expiresAt && session.expiresAt < new Date()) || !session) {\n const newSession = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n return {\n code: newSession.id,\n }\n }\n\n return {\n code: session?.id,\n };\n }),\n createInviteCode: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId } = input;\n\n await prisma.session.deleteMany({\n where: {\n classId,\n },\n });\n\n // Create a new session for the invite code\n const session = await prisma.session.create({\n data: {\n id: generateInviteCode(),\n classId,\n expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours from now\n }\n });\n\n return {\n code: session.id,\n };\n }),\n getGrades: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n userId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId, userId } = input;\n\n const isTeacher = await prisma.class.findFirst({\n where: {\n id: classId,\n teachers: {\n some: { id: ctx.user?.id }\n }\n }\n });\n // If student, only allow viewing their own grades\n if (ctx.user?.id !== userId && !isTeacher) {\n throw new TRPCError({\n code: 'UNAUTHORIZED',\n message: 'You can only view your own grades',\n });\n }\n\n const grades = await prisma.submission.findMany({\n where: {\n studentId: userId,\n assignment: {\n classId: classId,\n graded: true\n }\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n markSchemeId: true,\n markScheme: {\n select: {\n structured: true,\n }\n },\n gradingBoundaryId: true,\n gradingBoundary: {\n select: {\n structured: true,\n }\n },\n }\n },\n }\n });\n\n return {\n grades,\n };\n }),\n updateGrade: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n assignmentId: z.string(),\n submissionId: z.string(),\n gradeReceived: z.number().nullable(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, assignmentId, submissionId, gradeReceived } = input;\n\n // Update the grade\n const updatedSubmission = await prisma.submission.update({\n where: {\n id: submissionId,\n assignmentId: assignmentId,\n },\n data: {\n gradeReceived,\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n }\n }\n }\n });\n\n return updatedSubmission;\n }),\n getEvents: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const events = await prisma.event.findMany({\n where: {\n class: {\n id: classId,\n }\n },\n select: {\n name: true,\n startTime: true,\n endTime: true,\n }\n });\n\n return events;\n }),\n listMarkSchemes: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return markSchemes;\n }),\n createMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n updateMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const markScheme = await prisma.markScheme.update({\n where: { id: markSchemeId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return markScheme;\n }),\n deleteMarkScheme: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n markSchemeId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, markSchemeId } = input;\n\n const markScheme = await prisma.markScheme.delete({\n where: { id: markSchemeId },\n });\n\n return markScheme;\n }),\n listGradingBoundaries: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n class: {\n id: classId,\n },\n },\n });\n\n return gradingBoundaries;\n }),\n createGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.create({\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n updateGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n structure: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId, structure } = input;\n\n const validatedStructure = structure.replace(/\\\\n/g, '\\n');\n\n const gradingBoundary = await prisma.gradingBoundary.update({\n where: { id: gradingBoundaryId },\n data: {\n class: {\n connect: {\n id: classId,\n },\n },\n structured: validatedStructure,\n },\n });\n\n return gradingBoundary;\n }),\n deleteGradingBoundary: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n gradingBoundaryId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, gradingBoundaryId } = input;\n\n const gradingBoundary = await prisma.gradingBoundary.delete({\n where: { id: gradingBoundaryId },\n });\n\n return gradingBoundary;\n }),\n getSyllabus: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({input}) => {\n const {classId} = input;\n\n const syllabus = (await prisma.class.findUnique({\n where: {\n id: classId,\n },\n }))?.syllabus;\n\n const markSchemes = await prisma.markScheme.findMany({\n where: {\n classId,\n }\n });\n\n const gradingBoundaries = await prisma.gradingBoundary.findMany({\n where: {\n classId,\n }\n });\n\n return {syllabus, gradingBoundaries, markSchemes};\n }),\n updateSyllabus: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n contents: z.string(),\n }))\n .mutation(async ({ input }) => {\n const { contents, classId } = input;\n\n if (!contents) throw new TRPCError({\n code: 'BAD_REQUEST',\n message: \"Missing key contents\",\n });\n\n const updated = await prisma.class.update({\n where: {\n id: classId\n },\n data: {\n syllabus: contents,\n }\n });\n\n return updated;\n }),\n // Lab Management Endpoints (Assignment-based)\n listLabDrafts: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n const labDrafts = await prisma.assignment.findMany({\n where: {\n classId: classId,\n teacherId: ctx.user?.id,\n inProgress: true,\n },\n orderBy: {\n modifiedAt: 'desc',\n },\n });\n\n return labDrafts;\n }),\n createLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n title: z.string(),\n type: z.enum(['LAB', 'HOMEWORK', 'QUIZ', 'TEST', 'PROJECT', 'ESSAY', 'DISCUSSION', 'PRESENTATION', 'OTHER']),\n instructions: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, ...draftData } = input;\n\n const labDraft = await prisma.assignment.create({\n data: {\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n graded: draftData.graded ?? false,\n maxGrade: draftData.maxGrade ?? 0,\n weight: draftData.weight ?? 1,\n dueDate: draftData.dueDate || new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // Default 1 week from now\n title: draftData.title,\n instructions: draftData.instructions,\n type: draftData.type,\n ...(draftData.sectionId && { sectionId: draftData.sectionId }),\n ...(draftData.markSchemeId && { markSchemeId: draftData.markSchemeId }),\n ...(draftData.gradingBoundaryId && { gradingBoundaryId: draftData.gradingBoundaryId }),\n },\n });\n\n return labDraft;\n }),\n updateLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n title: z.string().optional(),\n instructions: z.string().optional(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n sectionId: z.string().optional(),\n markSchemeId: z.string().optional(),\n gradingBoundaryId: z.string().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...updateData } = input;\n\n const labDraft = await prisma.assignment.update({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n data: {\n ...(updateData.title && { title: updateData.title }),\n ...(updateData.instructions && { instructions: updateData.instructions }),\n ...(updateData.dueDate && { dueDate: updateData.dueDate }),\n ...(updateData.maxGrade !== undefined && { maxGrade: updateData.maxGrade }),\n ...(updateData.weight !== undefined && { weight: updateData.weight }),\n ...(updateData.graded !== undefined && { graded: updateData.graded }),\n ...(updateData.sectionId !== undefined && { sectionId: updateData.sectionId }),\n ...(updateData.markSchemeId !== undefined && { markSchemeId: updateData.markSchemeId }),\n ...(updateData.gradingBoundaryId !== undefined && { gradingBoundaryId: updateData.gradingBoundaryId }),\n modifiedAt: new Date(),\n },\n });\n\n return labDraft;\n }),\n deleteLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId } = input;\n\n const labDraft = await prisma.assignment.delete({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n return labDraft;\n }),\n publishLabDraft: protectedTeacherProcedure\n .input(z.object({\n classId: z.string(),\n draftId: z.string(),\n dueDate: z.date().optional(),\n maxGrade: z.number().optional(),\n weight: z.number().optional(),\n graded: z.boolean().optional(),\n }))\n .mutation(async ({ ctx, input }) => {\n const { classId, draftId, ...publishData } = input;\n\n // Get the lab draft\n const labDraft = await prisma.assignment.findUnique({\n where: {\n id: draftId,\n classId: classId,\n teacherId: ctx.user?.id!,\n inProgress: true,\n },\n });\n\n if (!labDraft) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: 'Lab draft not found',\n });\n }\n\n // Publish the draft by updating it to not be in progress\n const publishedAssignment = await prisma.assignment.update({\n where: { id: draftId },\n data: {\n inProgress: false,\n dueDate: publishData.dueDate || labDraft.dueDate,\n maxGrade: publishData.maxGrade || labDraft.maxGrade || 100,\n weight: publishData.weight || labDraft.weight || 1,\n graded: publishData.graded !== undefined ? publishData.graded : true,\n modifiedAt: new Date(),\n },\n });\n\n return publishedAssignment;\n }),\n getFiles: protectedClassMemberProcedure\n .input(z.object({\n classId: z.string(),\n }))\n .query(async ({ ctx, input }) => {\n const { classId } = input;\n\n // Get all assignments with their files and submissions\n const assignments = await prisma.assignment.findMany({\n where: {\n classId: classId,\n },\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n submissions: {\n include: {\n attachments: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n annotations: {\n select: {\n id: true,\n name: true,\n type: true,\n size: true,\n path: true,\n thumbnailId: true,\n uploadedAt: true,\n user: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n student: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n },\n teacher: {\n select: {\n id: true,\n username: true,\n },\n },\n },\n orderBy: {\n createdAt: 'desc',\n },\n });\n\n // Organize files by assignment structure\n const organizedFiles = assignments.map(assignment => ({\n id: assignment.id,\n title: assignment.title,\n teacher: assignment.teacher,\n teacherAttachments: assignment.attachments,\n students: assignment.submissions.map(submission => ({\n id: submission.student.id,\n username: submission.student.username,\n attachments: submission.attachments,\n annotations: submission.annotations,\n })),\n }));\n\n return organizedFiles;\n }),\n});"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC5H,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAC1C,MAAM,EAAE,kBAAkB;SAEvB,KAAK,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QACvB,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACzD,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;gBACpB,KAAK,EAAE;oBACH,QAAQ,EAAE;wBACR,IAAI,EAAE;4BACJ,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE;yBACnB;qBACF;iBACF;gBACD,OAAO,EAAE;oBACP,WAAW,EAAE;wBACX,KAAK,EAAE;4BACL,OAAO,EAAE;gCACP,GAAG,EAAE,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;6BACpD;4BACD,QAAQ,EAAE,KAAK;yBAChB;wBACD,MAAM,EAAE;4BAEN,EAAE,EAAE,IAAI;4BACR,KAAK,EAAE,IAAI;4BACX,IAAI,EAAE,IAAI;4BACV,OA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WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACpD,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,kBAAkB,EAAE,UAAU,CAAC,WAAW;YAC1C,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAClD,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE;gBACzB,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ;gBACrC,WAAW,EAAE,UAAU,CAAC,WAAW;gBACnC,WAAW,EAAE,UAAU,CAAC,WAAW;aACpC,CAAC,CAAC;SACJ,CAAC,CAAC,CAAC;QAEJ,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC;CACP,CAAC,CAAC","debug_id":"767877f8-1e76-552f-92f2-c3b39f1302ec"}
@@ -56,6 +56,7 @@ export declare const conversationRouter: import("@trpc/server").TRPCBuiltRouter<
56
56
  };
57
57
  } & {
58
58
  status: import(".prisma/client").$Enums.GenerationStatus | null;
59
+ meta: import("@prisma/client/runtime/library.js").JsonValue | null;
59
60
  id: string;
60
61
  content: string;
61
62
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"/","sources":["routers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyT7B,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"/","sources":["routers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyT7B,CAAC"}
@@ -160,6 +160,7 @@ export declare const labChatRouter: import("@trpc/server").TRPCBuiltRouter<{
160
160
  };
161
161
  } & {
162
162
  status: import(".prisma/client").$Enums.GenerationStatus | null;
163
+ meta: import("@prisma/client/runtime/library.js").JsonValue | null;
163
164
  id: string;
164
165
  content: string;
165
166
  createdAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"labChat.d.ts","sourceRoot":"/","sources":["routers/labChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAonBxB,CAAC"}
1
+ {"version":3,"file":"labChat.d.ts","sourceRoot":"/","sources":["routers/labChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+mBxB,CAAC"}