Feat: Question Bank, Exam Questions Randomization#21
Feat: Question Bank, Exam Questions Randomization#21Ardent10 wants to merge 7 commits intocode100x:mainfrom
Conversation
|
Pushing onto the stack |
|
@devsargam Is it reviewed ? I checked there was a bug while creating a new exam, I fixed that as well. |
|
@Ardent10 yeah. I will pull the latest and hopefully review it by today. :cheers |
|
@devsargam @hkirat is it reviewed? Do let me know if this is fine or needs changes. |
b23553f to
fb040bf
Compare
|
@devsargam reviewed? |
devsargam
left a comment
There was a problem hiding this comment.
Code is very clearn. But the actions are concerning me. I might be wrong here but are we checking for global authentication for all of the server actions?
| } | ||
|
|
||
| export const createExam = cache(async (examData: CreateExamInput) => { | ||
| try { |
There was a problem hiding this comment.
Can u add authentication to all the actions
| }) | ||
|
|
||
| export const updateExam = cache(async (examData: UpdateExamInput) => { | ||
| try { |
|
|
||
| export const getExams = async () => { | ||
| try { | ||
| const response = await db.exam.findMany({ |
There was a problem hiding this comment.
Check logic if user can see exam without login we can ignore this else add auth
There was a problem hiding this comment.
It is a protected route currently which makes more sense, reason being when a user without login redirected to the available exams page (which is a dashboard), it contains all user details, exams taken and everything else on its sidebar.
If a user is NOT LOGGED IN CURRENTLY and they are to take an exam they should pick the exam and then click on the "Pay & Take" test afterwards he is supposed to be redirected to -> login page -> dashboard -> available exams -> select exams that they wish to attempt -> Pay -> Take test. Which is most likely a not an ideal UX for an exam portal.
|
|
||
| // Get Random Questions for an Exam | ||
| export const getRandomQuestionsForExam = async (examId: string) => { | ||
| try { |
| // Get Exam Data - Fetch exam details and random questions | ||
| export async function getExamData(examId: string) { | ||
| try { | ||
| const exam = await db.exam.findUnique({ |
| } from '@/schemas' | ||
|
|
||
| export const createQuestions = async (values: createQuestionsValues) => { | ||
| try { |
| @@ -1,11 +1,21 @@ | |||
| // components/AvailableExams.tsx | |||
|
@Ardent10 update |
|
@devsargam Updated, Review required. |
|
@devsargam reviewed? |
Demo: https://www.loom.com/share/07fb4db156744b0b8b29e49a0b21fb84?sid=31a9409b-3ddc-4ad9-99e2-9d39985ff899
Features:
Questions Bank:
Exams
Exam Questions Randomization based on the no of questions being set for that exam.
Global Store with Exam, User and Question slices.
Logo for the application
Reusable Components and code structure.