-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: user and question history #60
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! Noted that the "histories records in the database seem to have the wrong questionDocRefId". Will take note of the changes in history-service's API when updating execution-service.
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.
Noted that merge conflicts resolved. LGTM!
Summary
This PR implements the following changes:
history-service:
frontend:
Note that the attempted status for a question is not added yet.
Screenshots
Question page:
History page:
Known issues
questionDocRefId
, especially for old records.Implementation
User submission
Each user submission sends a request to the
POST /histories/
. If either user in a collaboration session updates the history, the history would be updated for both of them (although only one entry is stored)Request format:
Retrieving user submissions
Retrieving user submission on their profile page, by sending a request to
GET /histories/user/{username}
.questionDocRefId
is sent so that user can be linked to the questionResponse format:
Retrieving question submissions
Retrieving question submissions on the question page, by sending a request to
GET /histories/user/{username}/question/{questionDocRefId}/
Retrieving single history item
There is also a request to get an individual item in history:
GET /histories/{historyDocRefId}
Response format:
Future improvements
Can also optimize the queries so that not so much data is sent to the frontend.
Can add the status (attempted/not-attempted) of the question in the question listing page/question page.
Can validate JWT token in the requests in the backend.
Question ID should also be included when creating history, as doc ref id can change upon resetting the db