@studious-lms/server 1.2.28 → 1.2.30

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.
@@ -4719,7 +4719,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4719
4719
  questions: {
4720
4720
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
4721
4721
  id: string;
4722
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
4722
4723
  createdAt: Date;
4724
+ order: number | null;
4723
4725
  worksheetId: string;
4724
4726
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
4725
4727
  updatedAt: Date;
@@ -4799,12 +4801,15 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4799
4801
  worksheetId: string;
4800
4802
  question: string;
4801
4803
  answer: string;
4804
+ options?: any;
4802
4805
  markScheme?: any;
4803
4806
  };
4804
4807
  output: {
4805
4808
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
4806
4809
  id: string;
4810
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
4807
4811
  createdAt: Date;
4812
+ order: number | null;
4808
4813
  worksheetId: string;
4809
4814
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
4810
4815
  updatedAt: Date;
@@ -4813,11 +4818,24 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4813
4818
  };
4814
4819
  meta: object;
4815
4820
  }>;
4821
+ reorderQuestions: import("@trpc/server").TRPCMutationProcedure<{
4822
+ input: {
4823
+ worksheetId: string;
4824
+ movedId: string;
4825
+ position: "before" | "after";
4826
+ targetId: string;
4827
+ };
4828
+ output: {
4829
+ id: string;
4830
+ }[];
4831
+ meta: object;
4832
+ }>;
4816
4833
  updateQuestion: import("@trpc/server").TRPCMutationProcedure<{
4817
4834
  input: {
4818
4835
  worksheetId: string;
4819
4836
  questionId: string;
4820
4837
  type?: "ESSAY" | "MULTIPLE_CHOICE" | "TRUE_FALSE" | "SHORT_ANSWER" | "LONG_ANSWER" | "MATH_EXPRESSION" | undefined;
4838
+ options?: any;
4821
4839
  markScheme?: any;
4822
4840
  question?: string | undefined;
4823
4841
  answer?: string | undefined;
@@ -4825,7 +4843,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4825
4843
  output: {
4826
4844
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
4827
4845
  id: string;
4846
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
4828
4847
  createdAt: Date;
4848
+ order: number | null;
4829
4849
  worksheetId: string;
4830
4850
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
4831
4851
  updatedAt: Date;
@@ -4842,7 +4862,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4842
4862
  output: {
4843
4863
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
4844
4864
  id: string;
4865
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
4845
4866
  createdAt: Date;
4867
+ order: number | null;
4846
4868
  worksheetId: string;
4847
4869
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
4848
4870
  updatedAt: Date;
@@ -4948,7 +4970,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4948
4970
  question: {
4949
4971
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
4950
4972
  id: string;
4973
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
4951
4974
  createdAt: Date;
4975
+ order: number | null;
4952
4976
  worksheetId: string;
4953
4977
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
4954
4978
  updatedAt: Date;
@@ -4995,7 +5019,9 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
4995
5019
  question: {
4996
5020
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
4997
5021
  id: string;
5022
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
4998
5023
  createdAt: Date;
5024
+ order: number | null;
4999
5025
  worksheetId: string;
5000
5026
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
5001
5027
  updatedAt: Date;
@@ -9769,7 +9795,9 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
9769
9795
  questions: {
9770
9796
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
9771
9797
  id: string;
9798
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
9772
9799
  createdAt: Date;
9800
+ order: number | null;
9773
9801
  worksheetId: string;
9774
9802
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
9775
9803
  updatedAt: Date;
@@ -9849,12 +9877,15 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
9849
9877
  worksheetId: string;
9850
9878
  question: string;
9851
9879
  answer: string;
9880
+ options?: any;
9852
9881
  markScheme?: any;
9853
9882
  };
9854
9883
  output: {
9855
9884
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
9856
9885
  id: string;
9886
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
9857
9887
  createdAt: Date;
9888
+ order: number | null;
9858
9889
  worksheetId: string;
9859
9890
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
9860
9891
  updatedAt: Date;
@@ -9863,11 +9894,24 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
9863
9894
  };
9864
9895
  meta: object;
9865
9896
  }>;
9897
+ reorderQuestions: import("@trpc/server").TRPCMutationProcedure<{
9898
+ input: {
9899
+ worksheetId: string;
9900
+ movedId: string;
9901
+ position: "before" | "after";
9902
+ targetId: string;
9903
+ };
9904
+ output: {
9905
+ id: string;
9906
+ }[];
9907
+ meta: object;
9908
+ }>;
9866
9909
  updateQuestion: import("@trpc/server").TRPCMutationProcedure<{
9867
9910
  input: {
9868
9911
  worksheetId: string;
9869
9912
  questionId: string;
9870
9913
  type?: "ESSAY" | "MULTIPLE_CHOICE" | "TRUE_FALSE" | "SHORT_ANSWER" | "LONG_ANSWER" | "MATH_EXPRESSION" | undefined;
9914
+ options?: any;
9871
9915
  markScheme?: any;
9872
9916
  question?: string | undefined;
9873
9917
  answer?: string | undefined;
@@ -9875,7 +9919,9 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
9875
9919
  output: {
9876
9920
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
9877
9921
  id: string;
9922
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
9878
9923
  createdAt: Date;
9924
+ order: number | null;
9879
9925
  worksheetId: string;
9880
9926
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
9881
9927
  updatedAt: Date;
@@ -9892,7 +9938,9 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
9892
9938
  output: {
9893
9939
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
9894
9940
  id: string;
9941
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
9895
9942
  createdAt: Date;
9943
+ order: number | null;
9896
9944
  worksheetId: string;
9897
9945
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
9898
9946
  updatedAt: Date;
@@ -9998,7 +10046,9 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
9998
10046
  question: {
9999
10047
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
10000
10048
  id: string;
10049
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
10001
10050
  createdAt: Date;
10051
+ order: number | null;
10002
10052
  worksheetId: string;
10003
10053
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
10004
10054
  updatedAt: Date;
@@ -10045,7 +10095,9 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
10045
10095
  question: {
10046
10096
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
10047
10097
  id: string;
10098
+ options: import("@prisma/client/runtime/library.js").JsonValue | null;
10048
10099
  createdAt: Date;
10100
+ order: number | null;
10049
10101
  worksheetId: string;
10050
10102
  markScheme: import("@prisma/client/runtime/library.js").JsonValue | null;
10051
10103
  updatedAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"_app.d.ts","sourceRoot":"","s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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAC"}
@@ -33,7 +33,9 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
33
33
  questions: {
34
34
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
35
35
  id: string;
36
+ options: import("@prisma/client/runtime/library").JsonValue | null;
36
37
  createdAt: Date;
38
+ order: number | null;
37
39
  worksheetId: string;
38
40
  markScheme: import("@prisma/client/runtime/library").JsonValue | null;
39
41
  updatedAt: Date;
@@ -113,12 +115,15 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
113
115
  worksheetId: string;
114
116
  question: string;
115
117
  answer: string;
118
+ options?: any;
116
119
  markScheme?: any;
117
120
  };
118
121
  output: {
119
122
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
120
123
  id: string;
124
+ options: import("@prisma/client/runtime/library").JsonValue | null;
121
125
  createdAt: Date;
126
+ order: number | null;
122
127
  worksheetId: string;
123
128
  markScheme: import("@prisma/client/runtime/library").JsonValue | null;
124
129
  updatedAt: Date;
@@ -127,11 +132,24 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
127
132
  };
128
133
  meta: object;
129
134
  }>;
135
+ reorderQuestions: import("@trpc/server").TRPCMutationProcedure<{
136
+ input: {
137
+ worksheetId: string;
138
+ movedId: string;
139
+ position: "before" | "after";
140
+ targetId: string;
141
+ };
142
+ output: {
143
+ id: string;
144
+ }[];
145
+ meta: object;
146
+ }>;
130
147
  updateQuestion: import("@trpc/server").TRPCMutationProcedure<{
131
148
  input: {
132
149
  worksheetId: string;
133
150
  questionId: string;
134
151
  type?: "ESSAY" | "MULTIPLE_CHOICE" | "TRUE_FALSE" | "SHORT_ANSWER" | "LONG_ANSWER" | "MATH_EXPRESSION" | undefined;
152
+ options?: any;
135
153
  markScheme?: any;
136
154
  question?: string | undefined;
137
155
  answer?: string | undefined;
@@ -139,7 +157,9 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
139
157
  output: {
140
158
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
141
159
  id: string;
160
+ options: import("@prisma/client/runtime/library").JsonValue | null;
142
161
  createdAt: Date;
162
+ order: number | null;
143
163
  worksheetId: string;
144
164
  markScheme: import("@prisma/client/runtime/library").JsonValue | null;
145
165
  updatedAt: Date;
@@ -156,7 +176,9 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
156
176
  output: {
157
177
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
158
178
  id: string;
179
+ options: import("@prisma/client/runtime/library").JsonValue | null;
159
180
  createdAt: Date;
181
+ order: number | null;
160
182
  worksheetId: string;
161
183
  markScheme: import("@prisma/client/runtime/library").JsonValue | null;
162
184
  updatedAt: Date;
@@ -262,7 +284,9 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
262
284
  question: {
263
285
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
264
286
  id: string;
287
+ options: import("@prisma/client/runtime/library").JsonValue | null;
265
288
  createdAt: Date;
289
+ order: number | null;
266
290
  worksheetId: string;
267
291
  markScheme: import("@prisma/client/runtime/library").JsonValue | null;
268
292
  updatedAt: Date;
@@ -309,7 +333,9 @@ export declare const worksheetRouter: import("@trpc/server").TRPCBuiltRouter<{
309
333
  question: {
310
334
  type: import(".prisma/client").$Enums.WorksheetQuestionType;
311
335
  id: string;
336
+ options: import("@prisma/client/runtime/library").JsonValue | null;
312
337
  createdAt: Date;
338
+ order: number | null;
313
339
  worksheetId: string;
314
340
  markScheme: import("@prisma/client/runtime/library").JsonValue | null;
315
341
  updatedAt: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet.d.ts","sourceRoot":"","sources":["../../src/routers/worksheet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6Z1B,CAAC"}
1
+ {"version":3,"file":"worksheet.d.ts","sourceRoot":"","sources":["../../src/routers/worksheet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA2KA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4ShC,CAAC"}
@@ -95,11 +95,12 @@ export const worksheetRouter = createTRPCRouter({
95
95
  worksheetId: z.string(),
96
96
  question: z.string(),
97
97
  answer: z.string(),
98
+ options: z.any().optional(), // JSON field
98
99
  markScheme: z.any().optional(), // JSON field
99
100
  type: z.enum(['MULTIPLE_CHOICE', 'TRUE_FALSE', 'SHORT_ANSWER', 'LONG_ANSWER', 'MATH_EXPRESSION', 'ESSAY']),
100
101
  }))
101
102
  .mutation(async ({ ctx, input }) => {
102
- const { worksheetId, question, answer, markScheme, type } = input;
103
+ const { worksheetId, question, answer, options, markScheme, type } = input;
103
104
  const worksheet = await prisma.worksheet.findUnique({
104
105
  where: { id: worksheetId },
105
106
  });
@@ -112,22 +113,66 @@ export const worksheetRouter = createTRPCRouter({
112
113
  type,
113
114
  question,
114
115
  answer,
116
+ options,
115
117
  markScheme,
116
118
  },
117
119
  });
118
120
  return newQuestion;
119
121
  }),
122
+ reorderQuestions: protectedProcedure
123
+ .input(z.object({
124
+ worksheetId: z.string(),
125
+ movedId: z.string(),
126
+ position: z.enum(['before', 'after']),
127
+ targetId: z.string(),
128
+ }))
129
+ .mutation(async ({ ctx, input }) => {
130
+ const { worksheetId, movedId, position, targetId } = input;
131
+ const worksheet = await prisma.worksheet.findUnique({
132
+ where: { id: worksheetId },
133
+ });
134
+ if (!worksheet) {
135
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Worksheet not found' });
136
+ }
137
+ const questions = await prisma.worksheetQuestion.findMany({
138
+ where: { worksheetId },
139
+ orderBy: { order: 'asc' },
140
+ });
141
+ const movedIdx = questions.findIndex(question => question.id === movedId);
142
+ if (movedIdx === -1) {
143
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Moved question not found' });
144
+ }
145
+ const targetIdx = questions.findIndex(question => question.id === targetId);
146
+ if (targetIdx === -1) {
147
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Target question not found' });
148
+ }
149
+ const withoutMoved = questions.filter(question => question.id !== movedId);
150
+ let next = [];
151
+ if (position === 'before') {
152
+ next = [...withoutMoved.slice(0, targetIdx).map(item => ({ id: item.id })), { id: movedId }, ...withoutMoved.slice(targetIdx).map(item => ({ id: item.id }))];
153
+ }
154
+ else {
155
+ next = [...withoutMoved.slice(0, targetIdx + 1).map(item => ({ id: item.id })), { id: movedId }, ...withoutMoved.slice(targetIdx + 1).map(item => ({ id: item.id }))];
156
+ }
157
+ // Update the order of each question
158
+ await prisma.$transaction(next.map((item, index) => prisma.worksheetQuestion.update({
159
+ where: { id: item.id },
160
+ data: { order: index },
161
+ })));
162
+ return next;
163
+ }),
120
164
  updateQuestion: protectedProcedure
121
165
  .input(z.object({
122
166
  worksheetId: z.string(),
123
167
  questionId: z.string(),
124
168
  question: z.string().optional(),
125
169
  answer: z.string().optional(),
170
+ options: z.any().optional(), // JSON field
126
171
  markScheme: z.any().optional(), // JSON field
127
172
  type: z.enum(['MULTIPLE_CHOICE', 'TRUE_FALSE', 'SHORT_ANSWER', 'LONG_ANSWER', 'MATH_EXPRESSION', 'ESSAY']).optional(),
128
173
  }))
129
174
  .mutation(async ({ ctx, input }) => {
130
- const { worksheetId, questionId, question, answer, markScheme, type } = input;
175
+ const { worksheetId, questionId, question, answer, options, markScheme, type } = input;
131
176
  const worksheet = await prisma.worksheet.findUnique({
132
177
  where: { id: worksheetId },
133
178
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studious-lms/server",
3
- "version": "1.2.28",
3
+ "version": "1.2.30",
4
4
  "description": "Backend server for Studious application",
5
5
  "main": "dist/exportType.js",
6
6
  "types": "dist/exportType.d.ts",
@@ -505,7 +505,9 @@ model WorksheetQuestion {
505
505
  type WorksheetQuestionType
506
506
  question String
507
507
  answer String
508
+ options Json? @default("{}")
508
509
  markScheme Json? @default("{}")
510
+ order Int? @default(0)
509
511
  createdAt DateTime @default(now())
510
512
  updatedAt DateTime @updatedAt
511
513
  studentResponses StudentQuestionProgress[]
@@ -2,6 +2,7 @@ import { TRPCError } from "@trpc/server";
2
2
  import { createTRPCRouter, protectedProcedure } from "src/trpc";
3
3
  import { z } from "zod";
4
4
  import { prisma } from "src/lib/prisma";
5
+ import { WorksheetQuestionType } from "@prisma/client";
5
6
 
6
7
  export const worksheetRouter = createTRPCRouter({
7
8
  // Get a single worksheet with all questions
@@ -111,11 +112,12 @@ export const worksheetRouter = createTRPCRouter({
111
112
  worksheetId: z.string(),
112
113
  question: z.string(),
113
114
  answer: z.string(),
115
+ options: z.any().optional(), // JSON field
114
116
  markScheme: z.any().optional(), // JSON field
115
117
  type: z.enum(['MULTIPLE_CHOICE', 'TRUE_FALSE', 'SHORT_ANSWER', 'LONG_ANSWER', 'MATH_EXPRESSION', 'ESSAY']),
116
118
  }))
117
119
  .mutation(async ({ ctx, input }) => {
118
- const { worksheetId, question, answer, markScheme, type } = input;
120
+ const { worksheetId, question, answer, options, markScheme, type } = input;
119
121
 
120
122
  const worksheet = await prisma.worksheet.findUnique({
121
123
  where: { id: worksheetId },
@@ -131,23 +133,80 @@ export const worksheetRouter = createTRPCRouter({
131
133
  type,
132
134
  question,
133
135
  answer,
136
+ options,
134
137
  markScheme,
135
138
  },
136
139
  });
137
140
 
138
141
  return newQuestion;
139
142
  }),
143
+ reorderQuestions: protectedProcedure
144
+ .input(z.object({
145
+ worksheetId: z.string(),
146
+ movedId: z.string(),
147
+ position: z.enum(['before', 'after']),
148
+ targetId: z.string(),
149
+ }))
150
+ .mutation(async ({ ctx, input }) => {
151
+ const { worksheetId, movedId, position, targetId } = input;
152
+
153
+ const worksheet = await prisma.worksheet.findUnique({
154
+ where: { id: worksheetId },
155
+ });
156
+
157
+ if (!worksheet) {
158
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Worksheet not found' });
159
+ }
160
+
161
+ const questions = await prisma.worksheetQuestion.findMany({
162
+ where: { worksheetId },
163
+ orderBy: { order: 'asc' },
164
+ });
165
+
166
+ const movedIdx = questions.findIndex(question => question.id === movedId);
167
+ if (movedIdx === -1) {
168
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Moved question not found' });
169
+ }
170
+
171
+ const targetIdx = questions.findIndex(question => question.id === targetId);
172
+ if (targetIdx === -1) {
173
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Target question not found' });
174
+ }
175
+
176
+ const withoutMoved = questions.filter(question => question.id !== movedId);
177
+
178
+ let next: Array<{ id: string }> = [];
179
+
180
+ if (position === 'before') {
181
+ next = [...withoutMoved.slice(0, targetIdx).map(item => ({ id: item.id })), { id: movedId }, ...withoutMoved.slice(targetIdx).map(item => ({ id: item.id }))];
182
+ } else {
183
+ next = [...withoutMoved.slice(0, targetIdx + 1).map(item => ({ id: item.id })), { id: movedId }, ...withoutMoved.slice(targetIdx + 1).map(item => ({ id: item.id }))];
184
+ }
185
+
186
+ // Update the order of each question
187
+ await prisma.$transaction(
188
+ next.map((item, index) =>
189
+ prisma.worksheetQuestion.update({
190
+ where: { id: item.id },
191
+ data: { order: index },
192
+ })
193
+ )
194
+ );
195
+
196
+ return next;
197
+ }),
140
198
  updateQuestion: protectedProcedure
141
199
  .input(z.object({
142
200
  worksheetId: z.string(),
143
201
  questionId: z.string(),
144
202
  question: z.string().optional(),
145
203
  answer: z.string().optional(),
204
+ options: z.any().optional(), // JSON field
146
205
  markScheme: z.any().optional(), // JSON field
147
206
  type: z.enum(['MULTIPLE_CHOICE', 'TRUE_FALSE', 'SHORT_ANSWER', 'LONG_ANSWER', 'MATH_EXPRESSION', 'ESSAY']).optional(),
148
207
  }))
149
208
  .mutation(async ({ ctx, input }) => {
150
- const { worksheetId, questionId, question, answer, markScheme, type } = input;
209
+ const { worksheetId, questionId, question, answer, options, markScheme, type } = input;
151
210
 
152
211
  const worksheet = await prisma.worksheet.findUnique({
153
212
  where: { id: worksheetId },