-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update Question Service #6
Conversation
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.
LGTM!
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.
LGTM, we just need to include the new requirements for D2!
.idea/.gitignore
Outdated
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.
Think the JetBrains .idea
folder can be excluded with .gitignore
?
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.
Okay, I will exclude it out.
|
||
### Parameters: | ||
|
||
- `limit` - The number of questions to be returned (Required) |
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.
Doesn't this endpoint retrieve a single question?
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.
Oh the description I wrote was a bit misleading. I was thinking we could just have set it by default to 1 for finding a question for a user. Then for values other than 1, I was thinking we could have it just in case there's some other usage for it (eg; retrieval of questions that matches the param for admin to look through). But I guess the randomised nature of this wouldn't really work that well for the example I gave LOL unless there's another boolean flag to indicate if we want random or not.
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.
yep sounds good, we could have optional parameters topics
, difficulty
, limit
and offset
in the get all questions endpoint for table pagination and filtering 😄
### Parameters: | ||
|
||
- `limit` - The number of questions to be returned (Required) | ||
- `topics` - The topic of the question (Required) |
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.
Should we allow users to submit multiple topics that they are interested in?
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.
Yeah agreed. This probably will improve user experience in matching too since the user would have a wider range of topics.
|
||
- `limit` - The number of questions to be returned (Required) | ||
- `topics` - The topic of the question (Required) | ||
- `languages` - The language of the question (Required) |
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.
Does this mean that we are going to customize the code template for each question? Personally, I'm not too keen on doing so, and hence I don't think we need this field.
- questionController.ts: Implemented new get endpoint for retrieving questions. - questionModel.ts: Updated `Difficulty` enum to `Hard` enum. - questionRoutes.ts: Added new routes for handling get requests. - helper.ts: Added helper function for improved error handling.
Update README