-
Notifications
You must be signed in to change notification settings - Fork 1
Quiz Backend #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Quiz Backend #278
Conversation
…l-go into jk2756/longer-descp
|
[diff-counting] Significant lines: 757. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job with the quiz backend Jimin! It looks like you also included the longDescription for journey changes (from your last PR) in this PR as well, you might want to remove them from this PR or add that into your description of the PR.
Inside quiz.service.ts, you can also combine getRandomQuestion and shuffleQuestion since they both return a random question and the only difference is if you want to exclude a specific question (which is already optional in shuffleQuestion. I also noticed a few other small things I'll add separate comments for.
| }, | ||
| }); | ||
|
|
||
| if (availableQuestions.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should throw an exception, since you have no questions left to give. Above in getRandomQuestion, you do this:
if (availableQuestions.length === 0) {
throw new NotFoundException('No available questions for this challenge');
}
Summary
This pull request is the first step towards implementing the backend for the quiz system. It provides random question delivery, shuffling within a challenge, single-attempt enforcement and integration with the challenge points/completion logic.
Remaining TODOs:
Depends on #{number of PR}
Test Plan
Notes
Breaking Changes