Open
Conversation
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Submit Quiz Attempt Endpoint
PR Summary
Allow users to submit quiz answers to
/api/v1/quiz/attempt, automatically grade their attempt, store the score and per-question correctness, and award XP.Overview
What feature/problem does this PR address?
Users need to submit quiz answers, have them graded automatically, see an accurate score and per-question results, have the attempt and score stored, receive XP, and have the activity recorded for gamification and history.
What approach was taken?
api/v1/quiz/attemptendpoint that takes in the quiz_id and answer per question.total_correct,total_questions, and a percentagescore.quiz_attemptrow with the final score, counts, XP, and full per-question results.user_activityentry for the"quiz_attempt"event, linked back to the attempt and quiz.answers.api/v1/quizendpoint to generate list of quiz questions andapi/v1/quiz/attemptto submit a quiz attempt by the user and save it to the database.Any important design decisions or trade-offs?
Frontend: quiz is generated and displayed only when the user clicks on the
generate quizbutton. The quiz is submitted and provides the correct answers and the score only when the user answers all the questions and clicks on the 'submit quiz' button. Users can get a new set of quiz when they click on the 'regenerate quiz' button.Checklist
Unit Test Evidence
Testing Method
Additional Notes
Jira Ticket
Jira Ticket(s) - [SOC-29]