@studious-lms/server 1.11.0 → 1.13.0
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.
- package/.env.example +3 -0
- package/dist/index.js +40 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/config/cors.d.ts.map +1 -1
- package/dist/lib/config/cors.js +7 -2
- package/dist/lib/config/cors.js.map +1 -1
- package/dist/lib/config/env.d.ts +8 -0
- package/dist/lib/config/env.d.ts.map +1 -1
- package/dist/lib/config/env.js +5 -2
- package/dist/lib/config/env.js.map +1 -1
- package/dist/lib/pusher.d.ts +2 -1
- package/dist/lib/pusher.d.ts.map +1 -1
- package/dist/lib/pusher.js +4 -3
- package/dist/lib/pusher.js.map +1 -1
- package/dist/models/agenda.d.ts +6 -0
- package/dist/models/agenda.d.ts.map +1 -1
- package/dist/models/announcement.d.ts +3 -0
- package/dist/models/announcement.d.ts.map +1 -1
- package/dist/models/assignment.d.ts +61 -0
- package/dist/models/assignment.d.ts.map +1 -1
- package/dist/models/auth.d.ts +6 -0
- package/dist/models/auth.d.ts.map +1 -1
- package/dist/models/class.d.ts +28 -0
- package/dist/models/class.d.ts.map +1 -1
- package/dist/models/class.js +12 -3
- package/dist/models/class.js.map +1 -1
- package/dist/models/comment.d.ts +13 -0
- package/dist/models/comment.d.ts.map +1 -1
- package/dist/models/comment.js +3 -2
- package/dist/models/comment.js.map +1 -1
- package/dist/models/conversation.d.ts +17 -0
- package/dist/models/conversation.d.ts.map +1 -1
- package/dist/models/conversation.js +13 -2
- package/dist/models/conversation.js.map +1 -1
- package/dist/models/event.d.ts +12 -0
- package/dist/models/event.d.ts.map +1 -1
- package/dist/models/file.d.ts +38 -0
- package/dist/models/file.d.ts.map +1 -1
- package/dist/models/folder.d.ts +6 -0
- package/dist/models/folder.d.ts.map +1 -1
- package/dist/models/labChat.d.ts +6 -0
- package/dist/models/labChat.d.ts.map +1 -1
- package/dist/models/newtonChat.d.ts +3 -0
- package/dist/models/newtonChat.d.ts.map +1 -1
- package/dist/models/school.d.ts +3 -0
- package/dist/models/school.d.ts.map +1 -1
- package/dist/models/section.d.ts +3 -0
- package/dist/models/section.d.ts.map +1 -1
- package/dist/models/worksheet.d.ts +62 -0
- package/dist/models/worksheet.d.ts.map +1 -1
- package/dist/models/worksheet.js +37 -7
- package/dist/models/worksheet.js.map +1 -1
- package/dist/pipelines/gradeWorksheet.d.ts.map +1 -1
- package/dist/pipelines/gradeWorksheet.js +59 -14
- package/dist/pipelines/gradeWorksheet.js.map +1 -1
- package/dist/routers/_app.d.ts +4641 -2285
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +6 -2
- package/dist/routers/_app.js.map +1 -1
- package/dist/routers/admin.d.ts +190 -0
- package/dist/routers/admin.d.ts.map +1 -0
- package/dist/routers/admin.js +50 -0
- package/dist/routers/admin.js.map +1 -0
- package/dist/routers/agenda.d.ts +6 -0
- package/dist/routers/agenda.d.ts.map +1 -1
- package/dist/routers/announcement.d.ts +6 -0
- package/dist/routers/announcement.d.ts.map +1 -1
- package/dist/routers/announcement.js +6 -5
- package/dist/routers/announcement.js.map +1 -1
- package/dist/routers/assignment.d.ts +58 -0
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/assignment.js +4 -4
- package/dist/routers/assignment.js.map +1 -1
- package/dist/routers/class.d.ts +54 -0
- package/dist/routers/class.d.ts.map +1 -1
- package/dist/routers/class.js +5 -2
- package/dist/routers/class.js.map +1 -1
- package/dist/routers/comment.d.ts +26 -0
- package/dist/routers/comment.d.ts.map +1 -1
- package/dist/routers/comment.js +6 -3
- package/dist/routers/comment.js.map +1 -1
- package/dist/routers/discussion.d.ts +823 -0
- package/dist/routers/discussion.d.ts.map +1 -0
- package/dist/routers/discussion.js +151 -0
- package/dist/routers/discussion.js.map +1 -0
- package/dist/routers/event.d.ts +3 -0
- package/dist/routers/event.d.ts.map +1 -1
- package/dist/routers/file.d.ts +4 -0
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/school.d.ts +6 -0
- package/dist/routers/school.d.ts.map +1 -1
- package/dist/routers/worksheet.d.ts +6 -0
- package/dist/routers/worksheet.d.ts.map +1 -1
- package/dist/routers/worksheet.js +4 -2
- package/dist/routers/worksheet.js.map +1 -1
- package/dist/seedDatabase.d.ts.map +1 -1
- package/dist/seedDatabase.js +1490 -1307
- package/dist/seedDatabase.js.map +1 -1
- package/dist/services/adminInstitution.d.ts +102 -0
- package/dist/services/adminInstitution.d.ts.map +1 -0
- package/dist/services/adminInstitution.js +117 -0
- package/dist/services/adminInstitution.js.map +1 -0
- package/dist/services/adminRunJob.d.ts +45 -0
- package/dist/services/adminRunJob.d.ts.map +1 -0
- package/dist/services/adminRunJob.js +41 -0
- package/dist/services/adminRunJob.js.map +1 -0
- package/dist/services/agenda.d.ts +6 -0
- package/dist/services/agenda.d.ts.map +1 -1
- package/dist/services/assignment.d.ts +50 -0
- package/dist/services/assignment.d.ts.map +1 -1
- package/dist/services/assignment.js +16 -9
- package/dist/services/assignment.js.map +1 -1
- package/dist/services/class.d.ts +54 -0
- package/dist/services/class.d.ts.map +1 -1
- package/dist/services/class.js +20 -3
- package/dist/services/class.js.map +1 -1
- package/dist/services/comment.d.ts +20 -0
- package/dist/services/comment.d.ts.map +1 -1
- package/dist/services/comment.js +23 -2
- package/dist/services/comment.js.map +1 -1
- package/dist/services/conversation.d.ts.map +1 -1
- package/dist/services/conversation.js +9 -7
- package/dist/services/conversation.js.map +1 -1
- package/dist/services/discussion.d.ts +762 -0
- package/dist/services/discussion.d.ts.map +1 -0
- package/dist/services/discussion.js +625 -0
- package/dist/services/discussion.js.map +1 -0
- package/dist/services/event.d.ts +3 -0
- package/dist/services/event.d.ts.map +1 -1
- package/dist/services/file.d.ts +8 -0
- package/dist/services/file.d.ts.map +1 -1
- package/dist/services/school.d.ts +6 -0
- package/dist/services/school.d.ts.map +1 -1
- package/dist/services/studentProgress.d.ts.map +1 -1
- package/dist/services/studentProgress.js +27 -5
- package/dist/services/studentProgress.js.map +1 -1
- package/dist/services/studentProgressInferenceCache.d.ts +16 -0
- package/dist/services/studentProgressInferenceCache.d.ts.map +1 -0
- package/dist/services/studentProgressInferenceCache.js +43 -0
- package/dist/services/studentProgressInferenceCache.js.map +1 -0
- package/dist/services/worksheet.d.ts +6 -0
- package/dist/services/worksheet.d.ts.map +1 -1
- package/dist/services/worksheet.js +5 -5
- package/dist/services/worksheet.js.map +1 -1
- package/dist/trpc.d.ts +12 -0
- package/dist/trpc.d.ts.map +1 -1
- package/dist/trpc.js +16 -3
- package/dist/trpc.js.map +1 -1
- package/dist/utils/adminPanelAccess.d.ts +8 -0
- package/dist/utils/adminPanelAccess.d.ts.map +1 -0
- package/dist/utils/adminPanelAccess.js +44 -0
- package/dist/utils/adminPanelAccess.js.map +1 -0
- package/package.json +1 -1
- package/prisma/migrations/20260510183000_add_discussions/migration.sql +151 -0
- package/prisma/schema.prisma +98 -0
- package/src/index.ts +39 -2
- package/src/lib/config/cors.ts +5 -0
- package/src/lib/config/env.ts +3 -0
- package/src/lib/pusher.ts +2 -1
- package/src/models/class.ts +10 -1
- package/src/models/comment.ts +1 -0
- package/src/models/conversation.ts +12 -0
- package/src/models/worksheet.ts +39 -5
- package/src/pipelines/gradeWorksheet.ts +66 -15
- package/src/routers/_app.ts +4 -0
- package/src/routers/admin.ts +70 -0
- package/src/routers/announcement.ts +4 -3
- package/src/routers/assignment.ts +2 -2
- package/src/routers/class.ts +3 -0
- package/src/routers/comment.ts +5 -0
- package/src/routers/discussion.ts +205 -0
- package/src/routers/worksheet.ts +2 -0
- package/src/seedDatabase.ts +1713 -1361
- package/src/services/adminInstitution.ts +140 -0
- package/src/services/adminRunJob.ts +46 -0
- package/src/services/assignment.ts +19 -8
- package/src/services/class.ts +28 -1
- package/src/services/comment.ts +22 -0
- package/src/services/conversation.ts +9 -4
- package/src/services/discussion.ts +701 -0
- package/src/services/studentProgress.ts +80 -3
- package/src/services/studentProgressInferenceCache.ts +64 -0
- package/src/services/worksheet.ts +5 -2
- package/src/trpc.ts +15 -0
- package/src/utils/adminPanelAccess.ts +46 -0
- package/tests/integration/routers/conversation.test.ts +9 -7
- package/tests/integration/routers/discussion.test.ts +253 -0
- package/tests/unit/services/discussion.test.ts +356 -0
|
@@ -123,6 +123,9 @@ export declare function findAnnouncementWithClass(id: string): import(".prisma/c
|
|
|
123
123
|
section: string;
|
|
124
124
|
syllabus: string | null;
|
|
125
125
|
departmentId: string | null;
|
|
126
|
+
discussionsEnabled: boolean;
|
|
127
|
+
studentsCanCreateDiscussions: boolean;
|
|
128
|
+
studentsCanReply: boolean;
|
|
126
129
|
};
|
|
127
130
|
attachments: {
|
|
128
131
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"announcement.d.ts","sourceRoot":"/","sources":["models/announcement.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B9B,CAAC;AAEF,0CAA0C;AAC1C,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;KAWzD;AAED,6CAA6C;AAC7C,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKvE;AAED,yEAAyE;AACzE,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"announcement.d.ts","sourceRoot":"/","sources":["models/announcement.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B9B,CAAC;AAEF,0CAA0C;AAC1C,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;KAWzD;AAED,6CAA6C;AAC7C,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKvE;AAED,yEAAyE;AACzE,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCnD;AAED,8BAA8B;AAC9B,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASA;AAED,uCAAuC;AACvC,wBAAgB,6BAA6B,CAC3C,EAAE,EAAE,MAAM,EACV,IAAI,EAAE;IACJ,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE;QAAE,EAAE,EAAE;YAAE,EAAE,EAAE,MAAM,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;CACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAcF;AAED,mCAAmC;AACnC,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMxE;AAED,8BAA8B;AAC9B,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;GAI5C"}
|
|
@@ -143,6 +143,8 @@ export declare function findAssignmentForDelete(id: string, teacherId: string):
|
|
|
143
143
|
conversationId: string | null;
|
|
144
144
|
messageId: string | null;
|
|
145
145
|
announcementId: string | null;
|
|
146
|
+
discussionId: string | null;
|
|
147
|
+
discussionReplyId: string | null;
|
|
146
148
|
schoolDevelopementProgramId: string | null;
|
|
147
149
|
} | null;
|
|
148
150
|
} & {
|
|
@@ -171,6 +173,8 @@ export declare function findAssignmentForDelete(id: string, teacherId: string):
|
|
|
171
173
|
conversationId: string | null;
|
|
172
174
|
messageId: string | null;
|
|
173
175
|
announcementId: string | null;
|
|
176
|
+
discussionId: string | null;
|
|
177
|
+
discussionReplyId: string | null;
|
|
174
178
|
schoolDevelopementProgramId: string | null;
|
|
175
179
|
})[];
|
|
176
180
|
attachments: ({
|
|
@@ -200,6 +204,8 @@ export declare function findAssignmentForDelete(id: string, teacherId: string):
|
|
|
200
204
|
conversationId: string | null;
|
|
201
205
|
messageId: string | null;
|
|
202
206
|
announcementId: string | null;
|
|
207
|
+
discussionId: string | null;
|
|
208
|
+
discussionReplyId: string | null;
|
|
203
209
|
schoolDevelopementProgramId: string | null;
|
|
204
210
|
} | null;
|
|
205
211
|
} & {
|
|
@@ -228,6 +234,8 @@ export declare function findAssignmentForDelete(id: string, teacherId: string):
|
|
|
228
234
|
conversationId: string | null;
|
|
229
235
|
messageId: string | null;
|
|
230
236
|
announcementId: string | null;
|
|
237
|
+
discussionId: string | null;
|
|
238
|
+
discussionReplyId: string | null;
|
|
231
239
|
schoolDevelopementProgramId: string | null;
|
|
232
240
|
})[];
|
|
233
241
|
} & {
|
|
@@ -274,6 +282,8 @@ export declare function findAssignmentForDelete(id: string, teacherId: string):
|
|
|
274
282
|
conversationId: string | null;
|
|
275
283
|
messageId: string | null;
|
|
276
284
|
announcementId: string | null;
|
|
285
|
+
discussionId: string | null;
|
|
286
|
+
discussionReplyId: string | null;
|
|
277
287
|
schoolDevelopementProgramId: string | null;
|
|
278
288
|
} | null;
|
|
279
289
|
} & {
|
|
@@ -302,6 +312,8 @@ export declare function findAssignmentForDelete(id: string, teacherId: string):
|
|
|
302
312
|
conversationId: string | null;
|
|
303
313
|
messageId: string | null;
|
|
304
314
|
announcementId: string | null;
|
|
315
|
+
discussionId: string | null;
|
|
316
|
+
discussionReplyId: string | null;
|
|
305
317
|
schoolDevelopementProgramId: string | null;
|
|
306
318
|
})[];
|
|
307
319
|
} & {
|
|
@@ -361,6 +373,9 @@ export declare function findSubmissionByAssignmentAndStudent(assignmentId: strin
|
|
|
361
373
|
section: string;
|
|
362
374
|
syllabus: string | null;
|
|
363
375
|
departmentId: string | null;
|
|
376
|
+
discussionsEnabled: boolean;
|
|
377
|
+
studentsCanCreateDiscussions: boolean;
|
|
378
|
+
studentsCanReply: boolean;
|
|
364
379
|
};
|
|
365
380
|
markScheme: {
|
|
366
381
|
id: string;
|
|
@@ -426,6 +441,8 @@ export declare function findSubmissionByAssignmentAndStudent(assignmentId: strin
|
|
|
426
441
|
conversationId: string | null;
|
|
427
442
|
messageId: string | null;
|
|
428
443
|
announcementId: string | null;
|
|
444
|
+
discussionId: string | null;
|
|
445
|
+
discussionReplyId: string | null;
|
|
429
446
|
schoolDevelopementProgramId: string | null;
|
|
430
447
|
}[];
|
|
431
448
|
attachments: {
|
|
@@ -454,6 +471,8 @@ export declare function findSubmissionByAssignmentAndStudent(assignmentId: strin
|
|
|
454
471
|
conversationId: string | null;
|
|
455
472
|
messageId: string | null;
|
|
456
473
|
announcementId: string | null;
|
|
474
|
+
discussionId: string | null;
|
|
475
|
+
discussionReplyId: string | null;
|
|
457
476
|
schoolDevelopementProgramId: string | null;
|
|
458
477
|
}[];
|
|
459
478
|
student: {
|
|
@@ -507,6 +526,9 @@ export declare function findSubmissionByIdForClassMember(submissionId: string, c
|
|
|
507
526
|
section: string;
|
|
508
527
|
syllabus: string | null;
|
|
509
528
|
departmentId: string | null;
|
|
529
|
+
discussionsEnabled: boolean;
|
|
530
|
+
studentsCanCreateDiscussions: boolean;
|
|
531
|
+
studentsCanReply: boolean;
|
|
510
532
|
};
|
|
511
533
|
markScheme: {
|
|
512
534
|
id: string;
|
|
@@ -572,6 +594,8 @@ export declare function findSubmissionByIdForClassMember(submissionId: string, c
|
|
|
572
594
|
conversationId: string | null;
|
|
573
595
|
messageId: string | null;
|
|
574
596
|
announcementId: string | null;
|
|
597
|
+
discussionId: string | null;
|
|
598
|
+
discussionReplyId: string | null;
|
|
575
599
|
schoolDevelopementProgramId: string | null;
|
|
576
600
|
}[];
|
|
577
601
|
attachments: {
|
|
@@ -600,6 +624,8 @@ export declare function findSubmissionByIdForClassMember(submissionId: string, c
|
|
|
600
624
|
conversationId: string | null;
|
|
601
625
|
messageId: string | null;
|
|
602
626
|
announcementId: string | null;
|
|
627
|
+
discussionId: string | null;
|
|
628
|
+
discussionReplyId: string | null;
|
|
603
629
|
schoolDevelopementProgramId: string | null;
|
|
604
630
|
}[];
|
|
605
631
|
student: {
|
|
@@ -653,6 +679,9 @@ export declare function findSubmissionForUpdate(submissionId: string, userId: st
|
|
|
653
679
|
section: string;
|
|
654
680
|
syllabus: string | null;
|
|
655
681
|
departmentId: string | null;
|
|
682
|
+
discussionsEnabled: boolean;
|
|
683
|
+
studentsCanCreateDiscussions: boolean;
|
|
684
|
+
studentsCanReply: boolean;
|
|
656
685
|
};
|
|
657
686
|
markScheme: {
|
|
658
687
|
id: string;
|
|
@@ -715,6 +744,8 @@ export declare function findSubmissionForUpdate(submissionId: string, userId: st
|
|
|
715
744
|
conversationId: string | null;
|
|
716
745
|
messageId: string | null;
|
|
717
746
|
announcementId: string | null;
|
|
747
|
+
discussionId: string | null;
|
|
748
|
+
discussionReplyId: string | null;
|
|
718
749
|
schoolDevelopementProgramId: string | null;
|
|
719
750
|
} | null;
|
|
720
751
|
} & {
|
|
@@ -743,6 +774,8 @@ export declare function findSubmissionForUpdate(submissionId: string, userId: st
|
|
|
743
774
|
conversationId: string | null;
|
|
744
775
|
messageId: string | null;
|
|
745
776
|
announcementId: string | null;
|
|
777
|
+
discussionId: string | null;
|
|
778
|
+
discussionReplyId: string | null;
|
|
746
779
|
schoolDevelopementProgramId: string | null;
|
|
747
780
|
})[];
|
|
748
781
|
} & {
|
|
@@ -780,6 +813,9 @@ export declare function createSubmission(assignmentId: string, studentId: string
|
|
|
780
813
|
section: string;
|
|
781
814
|
syllabus: string | null;
|
|
782
815
|
departmentId: string | null;
|
|
816
|
+
discussionsEnabled: boolean;
|
|
817
|
+
studentsCanCreateDiscussions: boolean;
|
|
818
|
+
studentsCanReply: boolean;
|
|
783
819
|
};
|
|
784
820
|
markScheme: {
|
|
785
821
|
id: string;
|
|
@@ -845,6 +881,8 @@ export declare function createSubmission(assignmentId: string, studentId: string
|
|
|
845
881
|
conversationId: string | null;
|
|
846
882
|
messageId: string | null;
|
|
847
883
|
announcementId: string | null;
|
|
884
|
+
discussionId: string | null;
|
|
885
|
+
discussionReplyId: string | null;
|
|
848
886
|
schoolDevelopementProgramId: string | null;
|
|
849
887
|
}[];
|
|
850
888
|
attachments: {
|
|
@@ -873,6 +911,8 @@ export declare function createSubmission(assignmentId: string, studentId: string
|
|
|
873
911
|
conversationId: string | null;
|
|
874
912
|
messageId: string | null;
|
|
875
913
|
announcementId: string | null;
|
|
914
|
+
discussionId: string | null;
|
|
915
|
+
discussionReplyId: string | null;
|
|
876
916
|
schoolDevelopementProgramId: string | null;
|
|
877
917
|
}[];
|
|
878
918
|
student: {
|
|
@@ -918,6 +958,9 @@ export declare function findAssignmentWithClassForTeacher(assignmentId: string,
|
|
|
918
958
|
section: string;
|
|
919
959
|
syllabus: string | null;
|
|
920
960
|
departmentId: string | null;
|
|
961
|
+
discussionsEnabled: boolean;
|
|
962
|
+
studentsCanCreateDiscussions: boolean;
|
|
963
|
+
studentsCanReply: boolean;
|
|
921
964
|
};
|
|
922
965
|
} & {
|
|
923
966
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
@@ -995,6 +1038,9 @@ export declare function findSubmissionsByAssignmentForTeacher(assignmentId: stri
|
|
|
995
1038
|
section: string;
|
|
996
1039
|
syllabus: string | null;
|
|
997
1040
|
departmentId: string | null;
|
|
1041
|
+
discussionsEnabled: boolean;
|
|
1042
|
+
studentsCanCreateDiscussions: boolean;
|
|
1043
|
+
studentsCanReply: boolean;
|
|
998
1044
|
};
|
|
999
1045
|
markScheme: {
|
|
1000
1046
|
id: string;
|
|
@@ -1057,6 +1103,8 @@ export declare function findSubmissionsByAssignmentForTeacher(assignmentId: stri
|
|
|
1057
1103
|
conversationId: string | null;
|
|
1058
1104
|
messageId: string | null;
|
|
1059
1105
|
announcementId: string | null;
|
|
1106
|
+
discussionId: string | null;
|
|
1107
|
+
discussionReplyId: string | null;
|
|
1060
1108
|
schoolDevelopementProgramId: string | null;
|
|
1061
1109
|
} | null;
|
|
1062
1110
|
} & {
|
|
@@ -1085,6 +1133,8 @@ export declare function findSubmissionsByAssignmentForTeacher(assignmentId: stri
|
|
|
1085
1133
|
conversationId: string | null;
|
|
1086
1134
|
messageId: string | null;
|
|
1087
1135
|
announcementId: string | null;
|
|
1136
|
+
discussionId: string | null;
|
|
1137
|
+
discussionReplyId: string | null;
|
|
1088
1138
|
schoolDevelopementProgramId: string | null;
|
|
1089
1139
|
})[];
|
|
1090
1140
|
student: {
|
|
@@ -1125,6 +1175,9 @@ export declare function findSubmissionForTeacherUpdate(submissionId: string, tea
|
|
|
1125
1175
|
section: string;
|
|
1126
1176
|
syllabus: string | null;
|
|
1127
1177
|
departmentId: string | null;
|
|
1178
|
+
discussionsEnabled: boolean;
|
|
1179
|
+
studentsCanCreateDiscussions: boolean;
|
|
1180
|
+
studentsCanReply: boolean;
|
|
1128
1181
|
};
|
|
1129
1182
|
markScheme: {
|
|
1130
1183
|
id: string;
|
|
@@ -1187,6 +1240,8 @@ export declare function findSubmissionForTeacherUpdate(submissionId: string, tea
|
|
|
1187
1240
|
conversationId: string | null;
|
|
1188
1241
|
messageId: string | null;
|
|
1189
1242
|
announcementId: string | null;
|
|
1243
|
+
discussionId: string | null;
|
|
1244
|
+
discussionReplyId: string | null;
|
|
1190
1245
|
schoolDevelopementProgramId: string | null;
|
|
1191
1246
|
} | null;
|
|
1192
1247
|
} & {
|
|
@@ -1215,6 +1270,8 @@ export declare function findSubmissionForTeacherUpdate(submissionId: string, tea
|
|
|
1215
1270
|
conversationId: string | null;
|
|
1216
1271
|
messageId: string | null;
|
|
1217
1272
|
announcementId: string | null;
|
|
1273
|
+
discussionId: string | null;
|
|
1274
|
+
discussionReplyId: string | null;
|
|
1218
1275
|
schoolDevelopementProgramId: string | null;
|
|
1219
1276
|
})[];
|
|
1220
1277
|
attachments: ({
|
|
@@ -1244,6 +1301,8 @@ export declare function findSubmissionForTeacherUpdate(submissionId: string, tea
|
|
|
1244
1301
|
conversationId: string | null;
|
|
1245
1302
|
messageId: string | null;
|
|
1246
1303
|
announcementId: string | null;
|
|
1304
|
+
discussionId: string | null;
|
|
1305
|
+
discussionReplyId: string | null;
|
|
1247
1306
|
schoolDevelopementProgramId: string | null;
|
|
1248
1307
|
} | null;
|
|
1249
1308
|
} & {
|
|
@@ -1272,6 +1331,8 @@ export declare function findSubmissionForTeacherUpdate(submissionId: string, tea
|
|
|
1272
1331
|
conversationId: string | null;
|
|
1273
1332
|
messageId: string | null;
|
|
1274
1333
|
announcementId: string | null;
|
|
1334
|
+
discussionId: string | null;
|
|
1335
|
+
discussionReplyId: string | null;
|
|
1275
1336
|
schoolDevelopementProgramId: string | null;
|
|
1276
1337
|
})[];
|
|
1277
1338
|
} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignment.d.ts","sourceRoot":"/","sources":["models/assignment.ts"],"names":[],"mappings":"AA+CA,iCAAiC;AACjC,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAI5C;AAED,qDAAqD;AACrD,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKnD;AAED,uDAAuD;AACvD,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"assignment.d.ts","sourceRoot":"/","sources":["models/assignment.ts"],"names":[],"mappings":"AA+CA,iCAAiC;AACjC,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoBrF;AAED,yEAAyE;AACzE,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;;;;;;;;KAiBrF;AAiBD,kCAAkC;AAClC,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM5E;AAED,oCAAoC;AACpC,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM7D"}
|
package/dist/models/auth.d.ts
CHANGED
|
@@ -214,6 +214,9 @@ export declare function findClassWithMember(classId: string, userId: string): im
|
|
|
214
214
|
section: string;
|
|
215
215
|
syllabus: string | null;
|
|
216
216
|
departmentId: string | null;
|
|
217
|
+
discussionsEnabled: boolean;
|
|
218
|
+
studentsCanCreateDiscussions: boolean;
|
|
219
|
+
studentsCanReply: boolean;
|
|
217
220
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
218
221
|
datasources: {
|
|
219
222
|
db: {
|
|
@@ -231,6 +234,9 @@ export declare function findClassWithTeacher(classId: string, teacherId: string)
|
|
|
231
234
|
section: string;
|
|
232
235
|
syllabus: string | null;
|
|
233
236
|
departmentId: string | null;
|
|
237
|
+
discussionsEnabled: boolean;
|
|
238
|
+
studentsCanCreateDiscussions: boolean;
|
|
239
|
+
studentsCanReply: boolean;
|
|
234
240
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
235
241
|
datasources: {
|
|
236
242
|
db: {
|
|
@@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ED,kDAAkD;AAClD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM;;KAKxD;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;GAOlE;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;GAOtE"}
|
package/dist/models/class.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export declare function findTeacherClasses(userId: string): import(".prisma/clie
|
|
|
17
17
|
assignments: {
|
|
18
18
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
19
19
|
id: string;
|
|
20
|
+
submissions: {
|
|
21
|
+
studentId: string;
|
|
22
|
+
submitted: boolean | null;
|
|
23
|
+
returned: boolean | null;
|
|
24
|
+
}[];
|
|
20
25
|
title: string;
|
|
21
26
|
dueDate: Date;
|
|
22
27
|
}[];
|
|
@@ -47,6 +52,9 @@ export declare function findTeacherClasses(userId: string): import(".prisma/clie
|
|
|
47
52
|
section: string;
|
|
48
53
|
syllabus: string | null;
|
|
49
54
|
departmentId: string | null;
|
|
55
|
+
discussionsEnabled: boolean;
|
|
56
|
+
studentsCanCreateDiscussions: boolean;
|
|
57
|
+
studentsCanReply: boolean;
|
|
50
58
|
})[]>;
|
|
51
59
|
/** @returns Classes where user is a student. */
|
|
52
60
|
export declare function findStudentClasses(userId: string): import(".prisma/client").Prisma.PrismaPromise<({
|
|
@@ -62,6 +70,11 @@ export declare function findStudentClasses(userId: string): import(".prisma/clie
|
|
|
62
70
|
assignments: {
|
|
63
71
|
type: import(".prisma/client").$Enums.AssignmentType;
|
|
64
72
|
id: string;
|
|
73
|
+
submissions: {
|
|
74
|
+
studentId: string;
|
|
75
|
+
submitted: boolean | null;
|
|
76
|
+
returned: boolean | null;
|
|
77
|
+
}[];
|
|
65
78
|
title: string;
|
|
66
79
|
dueDate: Date;
|
|
67
80
|
}[];
|
|
@@ -92,6 +105,9 @@ export declare function findStudentClasses(userId: string): import(".prisma/clie
|
|
|
92
105
|
section: string;
|
|
93
106
|
syllabus: string | null;
|
|
94
107
|
departmentId: string | null;
|
|
108
|
+
discussionsEnabled: boolean;
|
|
109
|
+
studentsCanCreateDiscussions: boolean;
|
|
110
|
+
studentsCanReply: boolean;
|
|
95
111
|
})[]>;
|
|
96
112
|
/** @returns Class if user is a teacher or school admin. */
|
|
97
113
|
export declare function isTeacherInClass(classId: string, userId: string): import(".prisma/client").Prisma.Prisma__ClassClient<{
|
|
@@ -103,6 +119,9 @@ export declare function isTeacherInClass(classId: string, userId: string): impor
|
|
|
103
119
|
section: string;
|
|
104
120
|
syllabus: string | null;
|
|
105
121
|
departmentId: string | null;
|
|
122
|
+
discussionsEnabled: boolean;
|
|
123
|
+
studentsCanCreateDiscussions: boolean;
|
|
124
|
+
studentsCanReply: boolean;
|
|
106
125
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
107
126
|
datasources: {
|
|
108
127
|
db: {
|
|
@@ -192,6 +211,9 @@ export declare function findClassWithAssignments(classId: string, options: {
|
|
|
192
211
|
section: string;
|
|
193
212
|
syllabus: string | null;
|
|
194
213
|
departmentId: string | null;
|
|
214
|
+
discussionsEnabled: boolean;
|
|
215
|
+
studentsCanCreateDiscussions: boolean;
|
|
216
|
+
studentsCanReply: boolean;
|
|
195
217
|
}) | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
196
218
|
datasources: {
|
|
197
219
|
db: {
|
|
@@ -209,6 +231,9 @@ export declare function findClassByIdBasic(classId: string): import(".prisma/cli
|
|
|
209
231
|
section: string;
|
|
210
232
|
syllabus: string | null;
|
|
211
233
|
departmentId: string | null;
|
|
234
|
+
discussionsEnabled: boolean;
|
|
235
|
+
studentsCanCreateDiscussions: boolean;
|
|
236
|
+
studentsCanReply: boolean;
|
|
212
237
|
} | null, null, import("@prisma/client/runtime/library.js").DefaultArgs, {
|
|
213
238
|
datasources: {
|
|
214
239
|
db: {
|
|
@@ -532,6 +557,9 @@ export declare function findFullExportableClass(classId: string): Promise<{
|
|
|
532
557
|
section: string;
|
|
533
558
|
syllabus: string | null;
|
|
534
559
|
departmentId: string | null;
|
|
560
|
+
discussionsEnabled: boolean;
|
|
561
|
+
studentsCanCreateDiscussions: boolean;
|
|
562
|
+
studentsCanReply: boolean;
|
|
535
563
|
} | null>;
|
|
536
564
|
export declare function createClassByImport(classId: string, userId: string, year: number, classData: Class & {
|
|
537
565
|
classFiles: Folder | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"/","sources":["models/class.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAc,KAAK,EAAE,MAAM,EAAgE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"/","sources":["models/class.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAc,KAAK,EAAE,MAAM,EAAgE,MAAM,gBAAgB,CAAC;AAuEzH,gDAAgD;AAChD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKhD;AAED,gDAAgD;AAChD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAKhD;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;GAO/D;AAyHD,qFAAqF;AACrF,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoF5D;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,GAAG;IAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA6HjK"}
|
package/dist/models/class.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* grading boundaries, syllabus, lab drafts, invite codes.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
!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]="
|
|
6
|
+
!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]="964a7e54-f2fa-5229-8330-925e025a577f")}catch(e){}}();
|
|
7
7
|
import { SessionType } from "@prisma/client";
|
|
8
8
|
import { prisma } from "../lib/prisma.js";
|
|
9
9
|
import { v4 as uuidv4 } from 'uuid';
|
|
@@ -12,7 +12,6 @@ import { classMemberOrSchoolAdminWhere, classTeacherOrSchoolAdminWhere, } from "
|
|
|
12
12
|
const classIncludeForGetAll = {
|
|
13
13
|
assignments: {
|
|
14
14
|
where: {
|
|
15
|
-
dueDate: { lte: new Date(new Date().setHours(23, 59, 59, 999)) },
|
|
16
15
|
template: false,
|
|
17
16
|
},
|
|
18
17
|
select: {
|
|
@@ -20,6 +19,13 @@ const classIncludeForGetAll = {
|
|
|
20
19
|
title: true,
|
|
21
20
|
type: true,
|
|
22
21
|
dueDate: true,
|
|
22
|
+
submissions: {
|
|
23
|
+
select: {
|
|
24
|
+
studentId: true,
|
|
25
|
+
submitted: true,
|
|
26
|
+
returned: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
23
29
|
},
|
|
24
30
|
},
|
|
25
31
|
students: {
|
|
@@ -170,6 +176,9 @@ const classIncludeForGet = {
|
|
|
170
176
|
},
|
|
171
177
|
},
|
|
172
178
|
},
|
|
179
|
+
discussionsEnabled: true,
|
|
180
|
+
studentsCanCreateDiscussions: true,
|
|
181
|
+
studentsCanReply: true,
|
|
173
182
|
};
|
|
174
183
|
const assignmentSelect = {
|
|
175
184
|
type: true,
|
|
@@ -663,4 +672,4 @@ export async function createClassByImport(classId, userId, year, classData) {
|
|
|
663
672
|
return newClassId;
|
|
664
673
|
}
|
|
665
674
|
//# sourceMappingURL=class.js.map
|
|
666
|
-
//# debugId=
|
|
675
|
+
//# debugId=964a7e54-f2fa-5229-8330-925e025a577f
|
package/dist/models/class.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sources":["models/class.ts"],"sourceRoot":"/","sourcesContent":["\n/**\n * Class model – classes, members, assignments, grades, mark schemes,\n * grading boundaries, syllabus, lab drafts, invite codes.\n */\n\nimport { Assignment, Class, Folder, GradingBoundary, MarkScheme, Section, SessionType, Worksheet } from \"@prisma/client\";\nimport type { PrismaClient, WorksheetQuestion } from \"@prisma/client\";\n\nimport { prisma } from \"../lib/prisma.js\";\nimport { v4 as uuidv4 } from 'uuid';\nimport { copyFile } from \"../lib/googleCloudStorage.js\";\nimport {\n classMemberOrSchoolAdminWhere,\n classTeacherOrSchoolAdminWhere,\n} from \"./access.js\";\n\nconst classIncludeForGetAll = {\n assignments: {\n where: {\n dueDate: { lte: new Date(new Date().setHours(23, 59, 59, 999)) },\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 school: {\n select: {\n id: true,\n name: true,\n },\n },\n department: {\n select: {\n id: true,\n name: true,\n color: true,\n },\n },\n} as const;\n\n/** @returns Classes where user is a teacher. */\nexport function findTeacherClasses(userId: string) {\n return prisma.class.findMany({\n where: classTeacherOrSchoolAdminWhere(userId),\n include: classIncludeForGetAll,\n });\n}\n\n/** @returns Classes where user is a student. */\nexport function findStudentClasses(userId: string) {\n return prisma.class.findMany({\n where: { students: { some: { id: userId } } },\n include: classIncludeForGetAll,\n });\n}\n\n/** @returns Class if user is a teacher or school admin. */\nexport function isTeacherInClass(classId: string, userId: string) {\n return prisma.class.findFirst({\n where: {\n id: classId,\n ...classTeacherOrSchoolAdminWhere(userId),\n },\n });\n}\n\nconst classIncludeForGet = {\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: { createdAt: \"desc\" as const },\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 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 section: {\n select: { id: true, name: true },\n },\n markScheme: {\n select: { id: true, structured: true },\n },\n gradingBoundary: {\n select: { id: true, structured: true },\n },\n submissions: {\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} as const;\n\nconst assignmentSelect = {\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 section: { select: { id: true, name: true } },\n markScheme: { select: { id: true, structured: true } },\n gradingBoundary: { select: { id: true, structured: true } },\n submissions: {\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} as const;\n\n/** @returns Class with assignments. Students see only assigned; teachers see all. */\nexport function findClassWithAssignments(\n classId: string,\n options: { isTeacher: boolean; userId?: string }\n) {\n const assignmentWhere = !options.isTeacher &&\n options.userId\n ? {\n OR: [\n { assignedTo: { some: { id: options.userId } } },\n { assignedTo: { none: {} } },\n ],\n }\n : undefined;\n\n const submissionWhere =\n !options.isTeacher && options.userId\n ? { studentId: options.userId }\n : undefined;\n\n return prisma.class.findFirst({\n where: {\n id: classId,\n ...(options.userId\n ? classMemberOrSchoolAdminWhere(options.userId)\n : {}),\n },\n include: {\n teachers: classIncludeForGet.teachers,\n students: classIncludeForGet.students,\n announcements: classIncludeForGet.announcements,\n assignments: {\n ...(assignmentWhere && { where: assignmentWhere }),\n select: {\n ...assignmentSelect,\n submissions: {\n ...(submissionWhere && { where: submissionWhere }),\n select: assignmentSelect.submissions.select,\n },\n },\n },\n },\n });\n}\n\n/** @returns Class by ID (minimal). */\nexport function findClassByIdBasic(classId: string) {\n return prisma.class.findUnique({\n where: { id: classId },\n });\n}\n\n/** @returns Sections for a class. */\nexport function findSectionsByClassId(classId: string) {\n return prisma.section.findMany({\n where: { classId },\n });\n}\n\n/** @returns User by ID (id, username only). */\nexport function findUserById(userId: string) {\n return prisma.user.findUnique({\n where: { id: userId },\n select: { id: true, username: true },\n });\n}\n\n/** @returns Session by class invite code. */\nexport function findSessionByClassCode(classCode: string) {\n return prisma.session.findFirst({\n where: {\n id: { equals: classCode, mode: \"insensitive\" },\n type: SessionType.CLASS_INVITE,\n },\n });\n}\n\n/** @returns Session for a class. */\nexport function findSessionByClassId(classId: string) {\n return prisma.session.findFirst({\n where: { classId },\n });\n}\n\n/** @returns User's graded submissions for grade calculation. */\nexport function findSubmissionsForGrades(userId: string, classId: string) {\n return prisma.submission.findMany({\n where: {\n studentId: userId,\n assignment: { classId, graded: true },\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n markSchemeId: true,\n dueDate: true,\n markScheme: { select: { structured: true } },\n gradingBoundaryId: true,\n gradingBoundary: { select: { structured: true } },\n },\n },\n },\n });\n}\n\n/** @returns Events for a class. */\nexport function findEventsByClassId(classId: string) {\n return prisma.event.findMany({\n where: { class: { id: classId } },\n select: { name: true, startTime: true, endTime: true },\n });\n}\n\n/** @returns Mark schemes for a class. */\nexport function findMarkSchemesByClassId(classId: string) {\n return prisma.markScheme.findMany({\n where: { class: { id: classId } },\n });\n}\n\n/** @returns Grading boundaries for a class. */\nexport function findGradingBoundariesByClassId(classId: string) {\n return prisma.gradingBoundary.findMany({\n where: { class: { id: classId } },\n });\n}\n\n/** @returns Class syllabus. */\nexport function findClassSyllabus(classId: string) {\n return prisma.class.findUnique({\n where: { id: classId },\n select: { syllabus: true },\n });\n}\n\n/** @returns In-progress lab drafts for a teacher. */\nexport function findLabDraftsByClass(classId: string, teacherId: string) {\n return prisma.assignment.findMany({\n where: {\n classId,\n teacherId,\n inProgress: true,\n },\n orderBy: { modifiedAt: \"desc\" as const },\n });\n}\n\n/** @returns Assignments with attachments and submissions. */\nexport function findAssignmentsWithFiles(classId: string) {\n return prisma.assignment.findMany({\n where: { classId },\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: { select: { id: true, username: true } },\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: { select: { id: true, username: true } },\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: { select: { id: true, username: true } },\n },\n },\n student: { select: { id: true, username: true } },\n },\n },\n teacher: { select: { id: true, username: true } },\n },\n orderBy: { createdAt: \"desc\" as const },\n });\n}\n\nasync function recursivelyIncludeFiles(folderId: string) {\n if (!folderId.length) {\n return null;\n }\n\n const folder = await prisma.folder.findUnique({\n where: { id: folderId },\n include: {\n files: {\n select: { id: true, name: true, type: true, size: true, path: true },\n },\n childFolders: {\n select: { id: true },\n },\n },\n });\n if (!folder) {\n return null;\n }\n return {\n ...folder,\n files: folder.files.map(file => file.id),\n childFolders: await Promise.all(folder.childFolders.map(folder => recursivelyIncludeFiles(folder.id))),\n };\n}\n\n/** Copy all files in folder tree to GCS (outside transaction). Returns map of sourcePath -> newPath. */\nasync function recursivelyCopyFilesToGcs(folderId: string): Promise<Map<string, string>> {\n const pathMap = new Map<string, string>();\n if (!folderId.length) return pathMap;\n\n const folder = await prisma.folder.findUnique({\n where: { id: folderId },\n include: {\n files: { select: { path: true, name: true } },\n childFolders: { select: { id: true } },\n },\n });\n if (!folder) return pathMap;\n\n for (const file of folder.files) {\n const ext = file.name.split('.').pop() || '';\n const newPath = `imported/${uuidv4()}${ext ? `.${ext}` : ''}`;\n await copyFile(file.path, newPath);\n pathMap.set(file.path, newPath);\n }\n for (const child of folder.childFolders) {\n const childMap = await recursivelyCopyFilesToGcs(child.id);\n childMap.forEach((v, k) => pathMap.set(k, v));\n }\n return pathMap;\n}\n\nasync function recursivelyCreateFiles(\n tx: PrismaClient | Omit<PrismaClient, \"$connect\" | \"$disconnect\" | \"$on\" | \"$transaction\" | \"$use\" | \"$extends\">,\n folderId: string,\n targetFolderId: string | undefined,\n pathMap: Map<string, string>\n) {\n if (!folderId.length) return;\n\n const parentFolder = await tx.folder.findUnique({\n where: { id: folderId },\n include: {\n files: { select: { id: true, name: true, type: true, size: true, path: true } },\n childFolders: { select: { id: true, name: true, color: true, parentFolderId: true } },\n },\n });\n if (!parentFolder) return;\n\n for (const file of parentFolder.files) {\n const newPath = pathMap.get(file.path);\n if (!newPath) continue;\n await tx.file.create({\n data: {\n name: file.name,\n type: file.type,\n size: file.size,\n path: newPath,\n uploadStatus: 'COMPLETED',\n ...(targetFolderId && { folder: { connect: { id: targetFolderId } } }),\n },\n });\n }\n\n for (const childFolder of parentFolder.childFolders) {\n const newFolder = await tx.folder.create({\n data: {\n name: childFolder.name,\n color: childFolder.color,\n parentFolderId: targetFolderId ?? parentFolder.id,\n },\n });\n await recursivelyCreateFiles(tx, childFolder.id, newFolder.id, pathMap);\n }\n}\n\n\nexport async function findFullExportableClass(classId: string) {\n const baseClass = await prisma.class.findUnique({\n where: { id: classId },\n include: {\n assignments: {\n select: {\n ...assignmentSelect,\n submissions: false,\n worksheets: { select: { id: true } },\n teacherId: true,\n classId: true,\n sectionId: true,\n markSchemeId: true,\n gradingBoundaryId: true,\n eventId: true,\n acceptFiles: true,\n acceptExtendedResponse: true,\n acceptWorksheet: true,\n gradeWithAI: true,\n aiPolicyLevel: true,\n },\n },\n classFiles: {\n select: {\n id: true,\n },\n },\n worksheets: {\n select: {\n id: true,\n name: true,\n classId: true,\n questions: {\n select: {\n type: true,\n question: true,\n answer: true,\n points: true,\n options: true,\n markScheme: true,\n order: true,\n worksheetId: true,\n },\n },\n },\n },\n markSchemes: {\n select: {\n id: true,\n classId: true,\n structured: true,\n },\n },\n gradingBoundaries: {\n select: {\n id: true,\n classId: true,\n structured: true,\n },\n },\n sections: {\n select: {\n id: true,\n name: true,\n classId: true,\n color: true,\n order: true,\n },\n },\n },\n });\n\n if (!baseClass) {\n return null;\n }\n\n const classFiles = await recursivelyIncludeFiles(baseClass.classFiles?.id ?? \"\");\n\n const formattedClass = {\n ...baseClass,\n classFiles,\n };\n\n return formattedClass;\n}\n\nexport async function createClassByImport(classId: string, userId: string, year: number, classData: Class & { classFiles: Folder | null }): Promise<string | null> {\n const pathMap = classData.classFiles?.id\n ? await recursivelyCopyFilesToGcs(classData.classFiles.id)\n : new Map<string, string>();\n\n const newClassId = await prisma.$transaction(async (tx) => {\n const createdClass = await tx.class.create({\n data: {\n name: classData.name,\n subject: classData.subject,\n color: classData.color,\n section: classData.section,\n syllabus: classData.syllabus,\n teachers: { connect: { id: userId } },\n classFiles: { create: { name: \"Class Files\" } },\n },\n include: {\n classFiles: true,\n },\n });\n\n const oldSectionIdToNew = new Map<string, string>();\n const oldMarkSchemeIdToNew = new Map<string, string>();\n const oldGradingBoundaryIdToNew = new Map<string, string>();\n const oldWorksheetIdToNew = new Map<string, string>();\n\n const sections = (classData as unknown as Class & { sections: Section[] }).sections ?? [];\n await Promise.all(\n sections.map(async (section, index) => {\n const newSection = await tx.section.create({\n data: {\n name: section.name,\n classId: createdClass.id,\n color: section.color,\n order: section.order ?? index,\n },\n });\n oldSectionIdToNew.set(section.id, newSection.id);\n return newSection;\n })\n );\n\n const markSchemes = (classData as unknown as Class & { markSchemes: MarkScheme[] }).markSchemes ?? [];\n await Promise.all(\n markSchemes.map(async (ms) => {\n const newMs = await tx.markScheme.create({\n data: { classId: createdClass.id, structured: ms.structured },\n });\n oldMarkSchemeIdToNew.set(ms.id, newMs.id);\n return newMs;\n })\n );\n\n const gradingBoundaries = (classData as unknown as Class & { gradingBoundaries: GradingBoundary[] }).gradingBoundaries ?? [];\n await Promise.all(\n gradingBoundaries.map(async (gb) => {\n const newGb = await tx.gradingBoundary.create({\n data: { classId: createdClass.id, structured: gb.structured },\n });\n oldGradingBoundaryIdToNew.set(gb.id, newGb.id);\n return newGb;\n })\n );\n\n const worksheets = (classData as unknown as Class & { worksheets: Array<Worksheet & { questions: WorksheetQuestion[] }> }).worksheets ?? [];\n for (const worksheet of worksheets) {\n const newWorksheet = await tx.worksheet.create({\n data: {\n name: worksheet.name,\n classId: createdClass.id,\n questions: {\n create: (worksheet.questions ?? []).map((q, i) => ({\n type: q.type,\n question: q.question,\n answer: q.answer,\n points: q.points ?? 0,\n options: q.options ?? {},\n markScheme: q.markScheme ?? {},\n order: q.order ?? i,\n })),\n },\n },\n });\n oldWorksheetIdToNew.set(worksheet.id, newWorksheet.id);\n }\n\n const assignments = (classData as unknown as Class & { assignments: Array<Assignment & { worksheets?: { id: string }[] }> }).assignments ?? [];\n for (const assignment of assignments) {\n const date = new Date(assignment.dueDate);\n date.setFullYear(year);\n const worksheetIds = (assignment as { worksheets?: { id: string }[] }).worksheets?.map((w) => oldWorksheetIdToNew.get(w.id)).filter(Boolean) as string[] | undefined;\n await tx.assignment.create({\n data: {\n title: assignment.title,\n type: assignment.type,\n dueDate: date,\n instructions: assignment.instructions,\n teacherId: userId,\n classId: createdClass.id,\n sectionId: assignment.sectionId ? oldSectionIdToNew.get(assignment.sectionId) ?? undefined : undefined,\n markSchemeId: assignment.markSchemeId ? oldMarkSchemeIdToNew.get(assignment.markSchemeId) ?? undefined : undefined,\n gradingBoundaryId: assignment.gradingBoundaryId ? oldGradingBoundaryIdToNew.get(assignment.gradingBoundaryId) ?? undefined : undefined,\n weight: assignment.weight ?? 1,\n maxGrade: assignment.maxGrade ?? 0,\n graded: assignment.graded ?? false,\n inProgress: assignment.inProgress ?? false,\n template: assignment.template ?? false,\n acceptFiles: assignment.acceptFiles ?? false,\n acceptExtendedResponse: assignment.acceptExtendedResponse ?? false,\n acceptWorksheet: assignment.acceptWorksheet ?? false,\n gradeWithAI: assignment.gradeWithAI ?? false,\n aiPolicyLevel: assignment.aiPolicyLevel ?? 0,\n ...(worksheetIds?.length && { worksheets: { connect: worksheetIds.map((id) => ({ id })) } }),\n },\n });\n }\n\n if (classData.classFiles?.id) {\n await recursivelyCreateFiles(tx, classData.classFiles.id, createdClass.classFiles?.id, pathMap);\n }\n\n return createdClass.id;\n }, { timeout: 30000 });\n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,SAAS,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC;YAC7B,MAAM,sBAAsB,CAAC,EAAE,EAAE,SAAS,CAAC,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QAClG,CAAC;QAED,OAAO,YAAY,CAAC,EAAE,CAAC;IACzB,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAEvB,OAAO,UAAU,CAAC;AACpB,CAAC","debug_id":"8a08d980-2f88-5513-8715-3c79a0f67807"}
|
|
1
|
+
{"version":3,"file":"class.js","sources":["models/class.ts"],"sourceRoot":"/","sourcesContent":["\n/**\n * Class model – classes, members, assignments, grades, mark schemes,\n * grading boundaries, syllabus, lab drafts, invite codes.\n */\n\nimport { Assignment, Class, Folder, GradingBoundary, MarkScheme, Section, SessionType, Worksheet } from \"@prisma/client\";\nimport type { PrismaClient, WorksheetQuestion } from \"@prisma/client\";\n\nimport { prisma } from \"../lib/prisma.js\";\nimport { v4 as uuidv4 } from 'uuid';\nimport { copyFile } from \"../lib/googleCloudStorage.js\";\nimport {\n classMemberOrSchoolAdminWhere,\n classTeacherOrSchoolAdminWhere,\n} from \"./access.js\";\n\nconst classIncludeForGetAll = {\n assignments: {\n where: {\n template: false,\n },\n select: {\n id: true,\n title: true,\n type: true,\n dueDate: true,\n submissions: {\n select: {\n studentId: true,\n submitted: true,\n returned: 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 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 school: {\n select: {\n id: true,\n name: true,\n },\n },\n department: {\n select: {\n id: true,\n name: true,\n color: true,\n },\n },\n} as const;\n\n/** @returns Classes where user is a teacher. */\nexport function findTeacherClasses(userId: string) {\n return prisma.class.findMany({\n where: classTeacherOrSchoolAdminWhere(userId),\n include: classIncludeForGetAll,\n });\n}\n\n/** @returns Classes where user is a student. */\nexport function findStudentClasses(userId: string) {\n return prisma.class.findMany({\n where: { students: { some: { id: userId } } },\n include: classIncludeForGetAll,\n });\n}\n\n/** @returns Class if user is a teacher or school admin. */\nexport function isTeacherInClass(classId: string, userId: string) {\n return prisma.class.findFirst({\n where: {\n id: classId,\n ...classTeacherOrSchoolAdminWhere(userId),\n },\n });\n}\n\nconst classIncludeForGet = {\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: { createdAt: \"desc\" as const },\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 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 section: {\n select: { id: true, name: true },\n },\n markScheme: {\n select: { id: true, structured: true },\n },\n gradingBoundary: {\n select: { id: true, structured: true },\n },\n submissions: {\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 discussionsEnabled: true,\n studentsCanCreateDiscussions: true,\n studentsCanReply: true,\n} as const;\n\nconst assignmentSelect = {\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 section: { select: { id: true, name: true } },\n markScheme: { select: { id: true, structured: true } },\n gradingBoundary: { select: { id: true, structured: true } },\n submissions: {\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} as const;\n\n/** @returns Class with assignments. Students see only assigned; teachers see all. */\nexport function findClassWithAssignments(\n classId: string,\n options: { isTeacher: boolean; userId?: string }\n) {\n const assignmentWhere = !options.isTeacher &&\n options.userId\n ? {\n OR: [\n { assignedTo: { some: { id: options.userId } } },\n { assignedTo: { none: {} } },\n ],\n }\n : undefined;\n\n const submissionWhere =\n !options.isTeacher && options.userId\n ? { studentId: options.userId }\n : undefined;\n\n return prisma.class.findFirst({\n where: {\n id: classId,\n ...(options.userId\n ? classMemberOrSchoolAdminWhere(options.userId)\n : {}),\n },\n include: {\n teachers: classIncludeForGet.teachers,\n students: classIncludeForGet.students,\n announcements: classIncludeForGet.announcements,\n assignments: {\n ...(assignmentWhere && { where: assignmentWhere }),\n select: {\n ...assignmentSelect,\n submissions: {\n ...(submissionWhere && { where: submissionWhere }),\n select: assignmentSelect.submissions.select,\n },\n },\n },\n },\n });\n}\n\n/** @returns Class by ID (minimal). */\nexport function findClassByIdBasic(classId: string) {\n return prisma.class.findUnique({\n where: { id: classId },\n });\n}\n\n/** @returns Sections for a class. */\nexport function findSectionsByClassId(classId: string) {\n return prisma.section.findMany({\n where: { classId },\n });\n}\n\n/** @returns User by ID (id, username only). */\nexport function findUserById(userId: string) {\n return prisma.user.findUnique({\n where: { id: userId },\n select: { id: true, username: true },\n });\n}\n\n/** @returns Session by class invite code. */\nexport function findSessionByClassCode(classCode: string) {\n return prisma.session.findFirst({\n where: {\n id: { equals: classCode, mode: \"insensitive\" },\n type: SessionType.CLASS_INVITE,\n },\n });\n}\n\n/** @returns Session for a class. */\nexport function findSessionByClassId(classId: string) {\n return prisma.session.findFirst({\n where: { classId },\n });\n}\n\n/** @returns User's graded submissions for grade calculation. */\nexport function findSubmissionsForGrades(userId: string, classId: string) {\n return prisma.submission.findMany({\n where: {\n studentId: userId,\n assignment: { classId, graded: true },\n },\n include: {\n assignment: {\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n markSchemeId: true,\n dueDate: true,\n markScheme: { select: { structured: true } },\n gradingBoundaryId: true,\n gradingBoundary: { select: { structured: true } },\n },\n },\n },\n });\n}\n\n/** @returns Events for a class. */\nexport function findEventsByClassId(classId: string) {\n return prisma.event.findMany({\n where: { class: { id: classId } },\n select: { name: true, startTime: true, endTime: true },\n });\n}\n\n/** @returns Mark schemes for a class. */\nexport function findMarkSchemesByClassId(classId: string) {\n return prisma.markScheme.findMany({\n where: { class: { id: classId } },\n });\n}\n\n/** @returns Grading boundaries for a class. */\nexport function findGradingBoundariesByClassId(classId: string) {\n return prisma.gradingBoundary.findMany({\n where: { class: { id: classId } },\n });\n}\n\n/** @returns Class syllabus. */\nexport function findClassSyllabus(classId: string) {\n return prisma.class.findUnique({\n where: { id: classId },\n select: { syllabus: true },\n });\n}\n\n/** @returns In-progress lab drafts for a teacher. */\nexport function findLabDraftsByClass(classId: string, teacherId: string) {\n return prisma.assignment.findMany({\n where: {\n classId,\n teacherId,\n inProgress: true,\n },\n orderBy: { modifiedAt: \"desc\" as const },\n });\n}\n\n/** @returns Assignments with attachments and submissions. */\nexport function findAssignmentsWithFiles(classId: string) {\n return prisma.assignment.findMany({\n where: { classId },\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: { select: { id: true, username: true } },\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: { select: { id: true, username: true } },\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: { select: { id: true, username: true } },\n },\n },\n student: { select: { id: true, username: true } },\n },\n },\n teacher: { select: { id: true, username: true } },\n },\n orderBy: { createdAt: \"desc\" as const },\n });\n}\n\nasync function recursivelyIncludeFiles(folderId: string) {\n if (!folderId.length) {\n return null;\n }\n\n const folder = await prisma.folder.findUnique({\n where: { id: folderId },\n include: {\n files: {\n select: { id: true, name: true, type: true, size: true, path: true },\n },\n childFolders: {\n select: { id: true },\n },\n },\n });\n if (!folder) {\n return null;\n }\n return {\n ...folder,\n files: folder.files.map(file => file.id),\n childFolders: await Promise.all(folder.childFolders.map(folder => recursivelyIncludeFiles(folder.id))),\n };\n}\n\n/** Copy all files in folder tree to GCS (outside transaction). Returns map of sourcePath -> newPath. */\nasync function recursivelyCopyFilesToGcs(folderId: string): Promise<Map<string, string>> {\n const pathMap = new Map<string, string>();\n if (!folderId.length) return pathMap;\n\n const folder = await prisma.folder.findUnique({\n where: { id: folderId },\n include: {\n files: { select: { path: true, name: true } },\n childFolders: { select: { id: true } },\n },\n });\n if (!folder) return pathMap;\n\n for (const file of folder.files) {\n const ext = file.name.split('.').pop() || '';\n const newPath = `imported/${uuidv4()}${ext ? `.${ext}` : ''}`;\n await copyFile(file.path, newPath);\n pathMap.set(file.path, newPath);\n }\n for (const child of folder.childFolders) {\n const childMap = await recursivelyCopyFilesToGcs(child.id);\n childMap.forEach((v, k) => pathMap.set(k, v));\n }\n return pathMap;\n}\n\nasync function recursivelyCreateFiles(\n tx: PrismaClient | Omit<PrismaClient, \"$connect\" | \"$disconnect\" | \"$on\" | \"$transaction\" | \"$use\" | \"$extends\">,\n folderId: string,\n targetFolderId: string | undefined,\n pathMap: Map<string, string>\n) {\n if (!folderId.length) return;\n\n const parentFolder = await tx.folder.findUnique({\n where: { id: folderId },\n include: {\n files: { select: { id: true, name: true, type: true, size: true, path: true } },\n childFolders: { select: { id: true, name: true, color: true, parentFolderId: true } },\n },\n });\n if (!parentFolder) return;\n\n for (const file of parentFolder.files) {\n const newPath = pathMap.get(file.path);\n if (!newPath) continue;\n await tx.file.create({\n data: {\n name: file.name,\n type: file.type,\n size: file.size,\n path: newPath,\n uploadStatus: 'COMPLETED',\n ...(targetFolderId && { folder: { connect: { id: targetFolderId } } }),\n },\n });\n }\n\n for (const childFolder of parentFolder.childFolders) {\n const newFolder = await tx.folder.create({\n data: {\n name: childFolder.name,\n color: childFolder.color,\n parentFolderId: targetFolderId ?? parentFolder.id,\n },\n });\n await recursivelyCreateFiles(tx, childFolder.id, newFolder.id, pathMap);\n }\n}\n\n\nexport async function findFullExportableClass(classId: string) {\n const baseClass = await prisma.class.findUnique({\n where: { id: classId },\n include: {\n assignments: {\n select: {\n ...assignmentSelect,\n submissions: false,\n worksheets: { select: { id: true } },\n teacherId: true,\n classId: true,\n sectionId: true,\n markSchemeId: true,\n gradingBoundaryId: true,\n eventId: true,\n acceptFiles: true,\n acceptExtendedResponse: true,\n acceptWorksheet: true,\n gradeWithAI: true,\n aiPolicyLevel: true,\n },\n },\n classFiles: {\n select: {\n id: true,\n },\n },\n worksheets: {\n select: {\n id: true,\n name: true,\n classId: true,\n questions: {\n select: {\n type: true,\n question: true,\n answer: true,\n points: true,\n options: true,\n markScheme: true,\n order: true,\n worksheetId: true,\n },\n },\n },\n },\n markSchemes: {\n select: {\n id: true,\n classId: true,\n structured: true,\n },\n },\n gradingBoundaries: {\n select: {\n id: true,\n classId: true,\n structured: true,\n },\n },\n sections: {\n select: {\n id: true,\n name: true,\n classId: true,\n color: true,\n order: true,\n },\n },\n },\n });\n\n if (!baseClass) {\n return null;\n }\n\n const classFiles = await recursivelyIncludeFiles(baseClass.classFiles?.id ?? \"\");\n\n const formattedClass = {\n ...baseClass,\n classFiles,\n };\n\n return formattedClass;\n}\n\nexport async function createClassByImport(classId: string, userId: string, year: number, classData: Class & { classFiles: Folder | null }): Promise<string | null> {\n const pathMap = classData.classFiles?.id\n ? await recursivelyCopyFilesToGcs(classData.classFiles.id)\n : new Map<string, string>();\n\n const newClassId = await prisma.$transaction(async (tx) => {\n const createdClass = await tx.class.create({\n data: {\n name: classData.name,\n subject: classData.subject,\n color: classData.color,\n section: classData.section,\n syllabus: classData.syllabus,\n teachers: { connect: { id: userId } },\n classFiles: { create: { name: \"Class Files\" } },\n },\n include: {\n classFiles: true,\n },\n });\n\n const oldSectionIdToNew = new Map<string, string>();\n const oldMarkSchemeIdToNew = new Map<string, string>();\n const oldGradingBoundaryIdToNew = new Map<string, string>();\n const oldWorksheetIdToNew = new Map<string, string>();\n\n const sections = (classData as unknown as Class & { sections: Section[] }).sections ?? [];\n await Promise.all(\n sections.map(async (section, index) => {\n const newSection = await tx.section.create({\n data: {\n name: section.name,\n classId: createdClass.id,\n color: section.color,\n order: section.order ?? index,\n },\n });\n oldSectionIdToNew.set(section.id, newSection.id);\n return newSection;\n })\n );\n\n const markSchemes = (classData as unknown as Class & { markSchemes: MarkScheme[] }).markSchemes ?? [];\n await Promise.all(\n markSchemes.map(async (ms) => {\n const newMs = await tx.markScheme.create({\n data: { classId: createdClass.id, structured: ms.structured },\n });\n oldMarkSchemeIdToNew.set(ms.id, newMs.id);\n return newMs;\n })\n );\n\n const gradingBoundaries = (classData as unknown as Class & { gradingBoundaries: GradingBoundary[] }).gradingBoundaries ?? [];\n await Promise.all(\n gradingBoundaries.map(async (gb) => {\n const newGb = await tx.gradingBoundary.create({\n data: { classId: createdClass.id, structured: gb.structured },\n });\n oldGradingBoundaryIdToNew.set(gb.id, newGb.id);\n return newGb;\n })\n );\n\n const worksheets = (classData as unknown as Class & { worksheets: Array<Worksheet & { questions: WorksheetQuestion[] }> }).worksheets ?? [];\n for (const worksheet of worksheets) {\n const newWorksheet = await tx.worksheet.create({\n data: {\n name: worksheet.name,\n classId: createdClass.id,\n questions: {\n create: (worksheet.questions ?? []).map((q, i) => ({\n type: q.type,\n question: q.question,\n answer: q.answer,\n points: q.points ?? 0,\n options: q.options ?? {},\n markScheme: q.markScheme ?? {},\n order: q.order ?? i,\n })),\n },\n },\n });\n oldWorksheetIdToNew.set(worksheet.id, newWorksheet.id);\n }\n\n const assignments = (classData as unknown as Class & { assignments: Array<Assignment & { worksheets?: { id: string }[] }> }).assignments ?? [];\n for (const assignment of assignments) {\n const date = new Date(assignment.dueDate);\n date.setFullYear(year);\n const worksheetIds = (assignment as { worksheets?: { id: string }[] }).worksheets?.map((w) => oldWorksheetIdToNew.get(w.id)).filter(Boolean) as string[] | undefined;\n await tx.assignment.create({\n data: {\n title: assignment.title,\n type: assignment.type,\n dueDate: date,\n instructions: assignment.instructions,\n teacherId: userId,\n classId: createdClass.id,\n sectionId: assignment.sectionId ? oldSectionIdToNew.get(assignment.sectionId) ?? undefined : undefined,\n markSchemeId: assignment.markSchemeId ? oldMarkSchemeIdToNew.get(assignment.markSchemeId) ?? undefined : undefined,\n gradingBoundaryId: assignment.gradingBoundaryId ? oldGradingBoundaryIdToNew.get(assignment.gradingBoundaryId) ?? undefined : undefined,\n weight: assignment.weight ?? 1,\n maxGrade: assignment.maxGrade ?? 0,\n graded: assignment.graded ?? false,\n inProgress: assignment.inProgress ?? false,\n template: assignment.template ?? false,\n acceptFiles: assignment.acceptFiles ?? false,\n acceptExtendedResponse: assignment.acceptExtendedResponse ?? false,\n acceptWorksheet: assignment.acceptWorksheet ?? false,\n gradeWithAI: assignment.gradeWithAI ?? false,\n aiPolicyLevel: assignment.aiPolicyLevel ?? 0,\n ...(worksheetIds?.length && { worksheets: { connect: worksheetIds.map((id) => ({ id })) } }),\n },\n });\n }\n\n if (classData.classFiles?.id) {\n await recursivelyCreateFiles(tx, classData.classFiles.id, createdClass.classFiles?.id, pathMap);\n }\n\n return createdClass.id;\n }, { timeout: 30000 });\n\n return newClassId;\n}\n"],"names":[],"mappings":"AACA;;;GAGG;;;AAEH,OAAO,EAAmE,WAAW,EAAa,MAAM,gBAAgB,CAAC;AAGzH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,O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