Task #14
openGenerate Results and Answer Keys After Exam
0%
Description
After a student completes and submits an exam, the system must automatically evaluate answer, generate the result, and display the answer key with correct and selected answers.
***exam_attempts Table
id – Unique identifier for each exam attempt
user_id – Reference to the student who attended the exam
exam_id – Reference to the exam
total_questions – Total number of questions in the exam
correct_answers – Number of correct answers
wrong_answers – Number of incorrect answers
score – Final calculated score
submitted_at – Date and time of exam submission
***exam_attempt_answers Table
id – Unique identifier for each answer record
attempt_id – Reference to the exam attempt
question_id – Reference to the question
selected_option – Option selected by the student
correct_option – Correct answer for the question
is_correct – Indicates whether the answer is correct
answered_at – Date and time when the answer was submitted
***Validations
*Exam results are generated only after submission
*Each answer is validated against the correct option
*is_correct is calculated automatically
*Result data is stored permanently for result history
*Deleting an attempt removes all related answers(CASCADE)