-
Notifications
You must be signed in to change notification settings - Fork 37
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
New endpoint for enrollment metrics - provide data captured in LCGM #233
Conversation
Codecov Report
@@ Coverage Diff @@
## master #233 +/- ##
==========================================
+ Coverage 91.36% 91.50% +0.14%
==========================================
Files 40 40
Lines 1968 2061 +93
==========================================
+ Hits 1798 1886 +88
- Misses 170 175 +5
Continue to review full report at Codecov.
|
…completed" - Added "completed" property to LearnerCourseGradeMerics - Added model manager methods to retrieve completed records and identities - Added experimental query to LCGM to retrieve most recent records for a course - Updates model and manager unit tests - Fixed pylint errors
f4d507a
to
21eec6b
Compare
This endpoint retrieves data from Figures LearnerCourseGradeMetrics model - Added new viewset for endpoint `/figures/api/enrollment-metrics/` - Added serializers and filters to support the new endpoint - Added view tests
Quick hack to populate LCGM model for local development
21eec6b
to
12eca82
Compare
I'm working on improving coverage. Looks like the big spots are the new view, filter methods, and a couple of spots in the model update. There was an incomplete view test for EnrollmentMetricsViewSet |
c533043
to
d611dd8
Compare
Coverage dropped into unhappy territory after merging from master. Working on boosting it above the waterline |
This makes the function useable by checking that the response data is not paginated as well as is paginated
Added test coverage for when viewset does not pagingate. This can be a case where the existing class paginagor is removed or set to None for the class being inherited. Instead of doing this, we could have just assumed that the results are always paginated in the EnrollmentMetricsViewSet completed and comletede_ids actions. However, the example I learned from did the conditional check for paginated results. So this is a bit of cheap defensive programming to allow the viewset method to paginate or not and have test coverage for this
Added test coverage for cases where paginated results not retrieved for the "completed" and "completed_ids" actions |
Added new endpoint to retrieve enrollment metrics.
The new base endpoint is
/figures/api/enrollment-metrics/
which provides an API view forLearnerCourseGradeMetrics
model. TheLearnerCourseGradeMetrics
model is where we capture learner progress and completion data. These data originate fromCourseGrade
and populated during the daily pipeline jobs with calls toCourseGradeFactory().read(...)
Updated LearnerCourseGradeMetricsManager model manager to retrieve "course completed" data.
Added broad query parameter filtering capability to this endpoint. All fields should be filterable except for
site
. Also added two list filtersuser_ids=
andcourse_ids=
which take comma delimited lists of user ids and course ids respectively. Added two filtersonly_completed
andexclude_completed
that take aTrue
. Yes, Capitalize the first letter, this is an artifact of django-filter. We can improve this in the future, for now, just want to have the functionality in so we can start working with it in the front endAdded experimental raw SQL queries to the LCGM model manager. These are not called by the endpoint and here to test retrieving the most recent LCGM record for a set of users
Fixes
most_recent_for_learner_course
methodfilter
is a method of the queryset (PyLint thinks the object is a list at these places).We can retrieve the core "completed" metrics data now, but we're likely going to want to rework and/or improve the endpoint after we cleanup LCGM and add indexes to the
course_id
anddate_for
fields. We may also want to convert LCGMcompleted
proper to a table column so we can index on thatTests are mostly there, but need more coverage. First I wanted to get this out to review