-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add endpoints to API #83
Merged
Merged
Conversation
This file contains 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
eAlasdair
reviewed
Oct 3, 2019
This is supposed to be like this :) |
Oops facepalm |
caitlind
approved these changes
Oct 4, 2019
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.
Adds the following API endpoints:
Endpoint for: Study class
URL: codewof.co.nz/api-studies
Accessible to: Admins
Data: Shows all studies with the following data for each: study ID, title, user types and researchers.
Endpoint for: StudyGroup class
URL: Not accessible through the browsable API. Used as a helper class.
Accessible to: Admins
Data: Shows all studies with the following data for each: study group ID, title and questions.
Endpoint for: User class
URL: codewof.co.nz/api-users
Accessible to: Admins
Data: Shows all users with the following data for each: user ID, email, first name, last name and user type.
Endpoint for: Profile class
URL: Not accessible through the browsable API. Used as a helper class.
Accessible to: Admins
Data: Shows all profiles with the following data for each: user ID and email.
Endpoint for: Attempt class
URL: codewof.co.nz/api-attempts
Accessible to: Admins
Data: Shows all attempts with the following data for each: attempt ID, datetime, question ID, user code for the attempt, if the tests passed or not and the profile of the user that submitted the attempt; this contains the ID of the user and email of the user.
The following URL takes a long time to load because of the data we are fetching. We aren't worried about this at the moment.
Endpoint for: Study class (except only shows one particular study)
URL: codewof.co.nz/api-study/?study_id=<study_id> where <study_id> is an integer (Primary Key of the Study)
Accessible to: Researchers of the study
Data: Shows all studies with the following data for each: study ID, title, user types and researchers. Will also show the study groups in the study; which is a dictionary containing the study group ID, title and questions in each study group (which is a dictionary containing the info for each question along with the info of attempts for each question). That's a huge mouthful so have a screenshot 😛 :
Also generate fake data for Attempts when we run
./dev sampledata
. This currently only generates a max of 1 attempt per question.Note that for testing the 'researcher' for every study is the admin account.
TODO:
Allow all data for a particular study to be viewed at a single URL and......
only allow the researchers of this study to access this.
Adding researcher restriction currently duplicates queries - need to investigate if we can get away without doing this.
Try and remove 'profile' from attempt information, or make profile be a dictionary of user ID and email so we don't have duplicate info.
GET dropdown not working
Customise theme? 😛
DARK MODE