-
Notifications
You must be signed in to change notification settings - Fork 21
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
Learning Insights Metrics Fix #683
base: main
Are you sure you want to change the base?
Learning Insights Metrics Fix #683
Conversation
…use on facility and adding a sum() function
e02f2fc
to
57865f7
Compare
backend/src/database/activity.go
Outdated
@@ -180,16 +181,14 @@ func (db *DB) GetAdminDashboardInfo(facilityID uint) (models.AdminDashboardJoin, | |||
} | |||
func (db *DB) GetTotalCoursesOffered(facilityID *uint) (int, error) { |
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.
as discussed on slack.. since courses are not unique to a facility, should we remove the option to filter?
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.
Select("COUNT(DISTINCT ue.user_id) AS students_enrolled"). | ||
Joins("INNER JOIN users u on ue.user_id = u.id") | ||
|
||
Select(`COUNT(DISTINCT u.id) AS num_enrolled`). |
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.
This (and others I see) on the other hand, since we are filtering the students themselves by facility, or getting the amount of time from students in a facility, then that makes sense
f2d6a99
to
dfce654
Compare
16d7555
to
dfce654
Compare
if err != nil { | ||
log.add("facilityId", claims.FacilityID) | ||
log.add("facility_id", claims.FacilityID) |
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.
can we just add the facility_id to the log once at the top, so we don't add it every time there's an error?
Description of the change
Address inconsistencies in calculations and formulas on the Learning Insights Dashboard
Screenshot(s)
refactorInsights.mp4
Additional context