-
Notifications
You must be signed in to change notification settings - Fork 8
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 all session answers at once #98
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
==========================================
- Coverage 95.35% 94.63% -0.72%
==========================================
Files 18 18
Lines 882 914 +32
==========================================
+ Hits 841 865 +24
- Misses 41 49 +8
☔ View full report in Codecov by Sentry. |
# get user_id and quiz_id for logging | ||
# Note: every session must have these keys | ||
user_id, quiz_id = session["user_id"], session["quiz_id"] | ||
log_message += f"(user: {user_id}, quiz: {quiz_id})" |
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.
more descriptive? as this message will be logged as a separate line, would be helpful for us only to keep it more verbose. For example -- Updating all session answers for the session {session_id} with {user_id} and {quiz_id}
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.
yes ... its a +=
. log_message
variable already has session_id thing
When a patch request with only
session_id
is provided tosession_answers
route, assert that json body contains all session answers, and update all session answers at once in db.This helps in syncing all session answers from frontend before test ends (especially for OMR format in low network areas).
One test added in
test_session_answers.py
Solves #99
Related ADR: https://www.notion.so/avantifellows/ADR-Wait-for-Session-Answer-Response-ce48a939beb240a5b56f5c6035c53931