# Quizzer Routes, Front-end pages, and components
*** Routes ***
- Front-end routes
- '*' => (react endpoints)
- /api/v1/student
*zaher - POST | 201 | /signup => done
*khaled - POST | 200 | /login => in progress
*amjad - GET | 200 | /signout => done
*amjad - GET || 200 || /quiz/:quizId || input: quizId | output: { data: { quiz_id: string, quiz_title: string, quiz_description: string }, message: 'Success' }
*zaher - protected || GET || 200 || /profile || input: userId: number 'from token' | output: { data: { user_quizzes: [{ quiz_title: string, quiz_id: string }], username: string, user_brief: string } }
*amjad - GET 200 /leaderboard | input: none | output: { data: [quizzes] }
*zaher - protected POST 201 /score | input: { score: '9', mark: '10', quizId: number } | output: { message: 'email sent successfully' } 'add result to database and sends email to the user and all of this should happen if the quiz is private'
*amjad - protected POST 201 /leaderboard | input: scores: { quiz_id: string, student_id: number}, quizzes: {teacher_id: 'from token', quiz_title: string, quiz_id: string 'nanoId', quiz_description: string, is_private: false, quiz_mark: number, time: number} | output: { message: 'Score Added Successfully' } | 'If the new score is higher than the previous one, override it, otherwhise do nothing'.
*khaled- protected GET /quiz-data/:quizId | input: quiz_id: string | output: { data: [{ question_type: string, question_id: number, question: string, correct_answer: string}] } | 'checks if a user is logged in and if it is => and if it is => check if a user already took the exam or not'
_______________________________
- /api/v1/teacher
*khaled - protected GET 200 /quizzes | input :teacherId : number from token | output : {data: teacher_quizes: [{quiz_title: string, quiz_id: string, particpated_student: number,}]
*amjad - protected GET 200 /enrolled-students | input : quizId : string, student_id | output :{data: enrolled_student: [{ student_name: string, score: number, mark: number}]
*khaled - protected GET 200 /profile | input: teacherId: number 'from token' | output: {data: {teacher_quizzes: [{quiz_title:string, quiz_id:string}], username:string, user_brief: string}}
*zaher - protected POST 201 /quiz | input : [
quizzes: {quiz_id : string, teacher_id: string 'from token', quiz_title, quiz_desc, quiz_time, quiz_mark, is_private: true},
quiz_questions_table: {questionId: number , quizId: string , question: string, type: string},
answers: [{ question_id: number, answer: string, is_correct: boolean, quiz_id: string }, ...]
]
output : {message: quiz created successfully}
*amjad - protected DELETE 200 /quiz/:quizId | input :quizId : string | output: {message : quiz deleted successfully}
### stretch goals :
- protected GET 200 /quiz/:quizId | input: quizId : string | output: {quizQuestions: {teacher_quizzes_Table: {quiz_id : string, teacher_id: string 'from token', quiz_title, quiz_desc, quiz_time, quiz_mark}, quiz_questions_table: [{questionId,quizId,question,type,correctAnswer}],
wrong_answers_table: [{questionId,wrong_answer}]}
- protected PATCH 200 /quiz/:questionId | input : [
quizzes: {quiz_id : string, teacher_id: string 'from token', quiz_title, quiz_desc, quiz_time, quiz_mark, is_private: true},
quiz_questions_table: {questionId: number , quizId: string , question: string, type: string},
answers: [{ question_id: number, answer: string, is_correct: boolean, quiz_id: string }, ...]
]
output : {message: quiz edited successfully}
------------------
*** Pages ***
- Landing
- Student
- Public
- Leaderboard
- QuizDetails
- Quiz
- Teacher
- Quizzes
- QuizDetails
- Profile
- CreateQuiz
*** Components ***
- Navbar
- Landing
- RoleModal
- AuthForm
- Student
- QuizCard
- Result
- Teacher
- CreateQuizForm
- QuestionForm