refactor: update Quiz schema and Prisma types for enhanced data structure

- Replaced existing score and answers fields in the Quiz schema with more descriptive fields: numberOfCorrectAnswers, numberOfIncorrectAnswers, numberOfQuestions, correctPoints, totalPoints, and userInput.
- Updated the PrismaTypes interface to remove the questions relation and streamline the data model, ensuring better clarity and maintainability.
- Updated the subproject reference in the epess-database to the latest commit for consistency in project dependencies.
This commit is contained in:
2024-12-10 16:46:46 +07:00
parent 431e478f21
commit 14a69aba10
3 changed files with 12 additions and 18 deletions

View File

@@ -80,9 +80,13 @@ export class QuizSchema extends PothosSchema {
quiz: t.relation('quiz'),
userId: t.exposeID('userId'),
user: t.relation('user'),
score: t.exposeInt('score'),
questions: t.relation('questions'),
answers: t.exposeStringList('answers'),
numberOfCorrectAnswers: t.exposeInt('numberOfCorrectAnswers'),
numberOfIncorrectAnswers: t.exposeInt('numberOfIncorrectAnswers'),
numberOfQuestions: t.exposeInt('numberOfQuestions'),
correctPoints: t.exposeInt('correctPoints'),
totalPoints: t.exposeInt('totalPoints'),
userInput: t.exposeStringList('userInput'),
questions: t.exposeStringList('questions'),
createdAt: t.expose('createdAt', {
type: 'DateTime',
}),

File diff suppressed because one or more lines are too long