Skip to content

Commit

Permalink
finish ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
kaamil2 committed Oct 10, 2023
1 parent 23b8e53 commit 94e6ebd
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 114 deletions.
2 changes: 1 addition & 1 deletion lib/CompoundTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type UserReturnType = {
isAdmin?: string;
};

export type QuizAnswersType = string[] | null;
export type QuizAnswersType = string[];

export type QuizSubmission = {
subModuleQuizId: number;
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@next-auth/prisma-adapter": "^0.4.4-canary.81",
"@prisma/client": "^5.2.0",
"@prisma/client": "^5.4.1",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
Expand Down
17 changes: 17 additions & 0 deletions prisma/migrations/20231010222411_database_new/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Warnings:
- You are about to drop the column `passed` on the `ModuleExam` table. All the data in the column will be lost.
- You are about to drop the column `score` on the `ModuleExam` table. All the data in the column will be lost.
- You are about to drop the column `passed` on the `SubModuleQuiz` table. All the data in the column will be lost.
- You are about to drop the column `score` on the `SubModuleQuiz` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "ModuleExam" DROP COLUMN "passed",
DROP COLUMN "score";

-- AlterTable
ALTER TABLE "SubModuleQuiz" DROP COLUMN "passed",
DROP COLUMN "score",
ADD COLUMN "answers" TEXT[];
44 changes: 0 additions & 44 deletions src/models/quizzes.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/models/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class Users {
throw "User Not Found"
}

user.subModuleQuizScores[id] = {"id": subModuleQuizId, "results":results, "score": score}
user.subModuleQuizScores[id] = {"subModuleQuizId": subModuleQuizId, "results":results, "score": score}
console.log(user.subModuleQuizScores)
await this.usersDB.update({
where: { id: userId },
Expand All @@ -57,6 +57,7 @@ export default class Users {
} catch (Error) {
throw "User Not Found"
}
}


// Get Insensitive User Information By ID
Expand Down
52 changes: 0 additions & 52 deletions src/pages/api/subModules/[id].ts

This file was deleted.

0 comments on commit 94e6ebd

Please sign in to comment.