diff --git a/src/Quiz/quiz.schema.ts b/src/Quiz/quiz.schema.ts index a804f19..f90b430 100644 --- a/src/Quiz/quiz.schema.ts +++ b/src/Quiz/quiz.schema.ts @@ -75,7 +75,7 @@ export class QuizSchema extends PothosSchema { quizAttempt() { return this.builder.prismaObject('QuizAttempt', { fields: (t) => ({ - id: t.exposeID('id'), + id: t.exposeID('id'), quizId: t.exposeID('quizId'), quiz: t.relation('quiz'), userId: t.exposeID('userId'), @@ -195,9 +195,7 @@ export class QuizSchema extends PothosSchema { }, }) // get amount of questions using nrOfQuestions and random index based on random - const randomIndex = quizzes.length > 0 - ? Math.floor(random * quizzes.length) - : 0 + const randomIndex = quizzes.length > 0 ? Math.floor(random * quizzes.length) : 0 const nrOfQuestions = quizzes[0]?.nrOfQuestions ?? 1 const result = quizzes.slice(randomIndex, randomIndex + nrOfQuestions) return result