-
Notifications
You must be signed in to change notification settings - Fork 409
Integrate Approved Session Tracking Fixes into 10.0.x #566
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
Changes from all commits
16902fe
2500b0a
6cce7de
f7e3a18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,10 +18,10 @@ def self.record_assessment_activity(action:, user:, project:, ip_address:, task: | |
| project_id: project.id, | ||
| task_id: task&.id, | ||
| task_definition_id: task&.task_definition_id, | ||
| created_at: Time.zone.now | ||
| created_at: DateTime.now | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Time.zone.now should be used |
||
| ) | ||
|
|
||
| session.update_session_details | ||
| session.update_session_details if action == 'assessing' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want various actions to let the backend know the tutor is still active - this includes adding comments, opening different submissions, etc. We can't limit this to just the |
||
|
|
||
| activity | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ def change | |
| t.string :ip_address | ||
| t.datetime :start_time | ||
| t.datetime :end_time | ||
| t.integer :duration_minutes, default: 0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll need to start a new migration if you want to make changes to the schema, as this is already shipped in production |
||
| t.boolean :during_tutorial | ||
|
|
||
| t.timestamps | ||
|
|
||
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.
duration_minutes is redundant and should not be part of the schema.
The cost of calculating duration from start_time and end_time is negligible, and storing it would duplicate derived data.
Persisting duration_minutes introduces a risk of data inconsistency - for example, if one value is updated without the other - leading to conflicting sources of truth
We dynamically calculate duration_minutes when we expose the MarkingSession entity