Buzz API

Enrollment Metrics: Finding a Completion Threshold Date

Follow
Answered
Geoff Quinby

Hello!

I'm trying to solve a particular issue for internal reporting, and I'm having difficulty determing which API command(s) I could use to get the information I'm looking for. I thought I'd pose the question here to potentially be pointed in the right (or a different) direction.

Basically, I need to find the date by which an enrollment (active or deleted) reached a certain level of completion by the student. We are determining this completion level by using "Gradable" and "CompletedGradable" metrics. By using the ListEnrollments command, I can find the metrics and metrics history information for each enrollment in a domain. I've found that by using the versioned history information, I can extrapolate the date when an Enrollment reached our given threshold.

The issue I'm encountering, however, is that by requesting ALL of the enrollments for a particular domain PLUS all the Metrics History for each enrollment, it often makes the data set prohibitively large as to cause a 502 Gateway Timeout error from the API. I imagine this is simply due to it trying to provide several hundred metrics history records per enrollment for potentially thousands of enrollments in a domain!

I've looked at some of the other commands involving Gradebooks and such, but I'm not sure they offer the information I'd be looking for in terms of historical enrollments.

Does anyone have any advice on what I might be able to do to get the information I need consistently? I don't necessarily want to use GetEnrollment3 over several thousands of enrollmentID's (which may not even work for deleted enrollments), but I'm not sure what other options I might have.

Thanks in advance for any pointers anyone might have.

Comments (1)

Sort by
Brad Marshall
  • Agilix team member

Hey Geoff, hope you are having a great Friday!

Without knowing the exact scope/size of your queries that are seeing the timeout errors, it is hard to provide a concrete recommendation. However, the following suggestions may be helpful in your endeavors. If you wish to explore more with us regarding exact recommendations, please recommend work with your designated support contact and create a ticket with us.

  • Narrow the scope of enrollments to analyze at a time. ListEnrollments, as you noted, could be querying every single enrollment in the domain. Instead of going the smallest scope (GetEnrollment3) you could [1] use the ListEnrollments `query` to filter out older enrollments (`enddate`, `creationdate`) or [2] query the enrollments by user (ListUserEnrollments) or course (ListEntityEnrollments). For example, you likely don't need to run this operation for courses or users that are no longer involved/active with the school. In either case, reducing the amount of enrollments returned will increase the chances of success.
  • Identify which enrollments have reached the completion threshold. If you intend on running this report regularly, then you may not want to look at the entire metrics history. For example, if you are running this once a month, you could use the `on` or `range` history query types.

    So, imagine that I want to find all users that reached the completion threshold during the month of April 2017. I could run `cmd=listenrollments&domainid=//mydomainuserspace&select=metrics,metrics.history(on,2017-04-01T00:00:00Z),metrics.history(on,2017-05-01T00:00:00Z)`. This would return specifically what the enrollment's completion was at the beginning and the end of the month. For the enrollments exceeded the threshold during the month, I would then only need to query those (GetEnrollment3) to know the full history of the exact date the achieved it. If you didn't need to know the exact date but the week would suffice, then you could add a couple more `metrics.history(on,...)` for the end of each week in the month. [NOTE: Adding more than 2 `on` queries will have a different performance profile. Recommend experimenting anything above 2 before full implementation.]

Alternatively, if you were to use an automatic Enrollment Completion setting, you could look at the enrollment history [`cmd=listenrollments&domainid=//mydomainuserspace&select=history(all)`] to see the date the enrollment was marked complete.

I hope this helps. If you have any follow up questions, don't hesitate to ask.

0 Comment actions Permalink
Please sign in to leave a comment.