The standard course completion report displays only users with currently active enrollments.
It did not allow a teacher or admin to see which students completed the course "on time" - before the end of last enrollment period.
The small, simple patch attached adds a "Display only currently active enrollments" option, default yes (leaving the default behavior unchanged).
Selecting "no" will allow you to see students who have completed, including if their enrollment has expired. This may be very useful for
seeing those students who expired the night before, so you can see if they completed before expiring.
The patch doesn't really alter any logic. It just forwards the "$onlyactive" variable to the underlying API call which already
supported that option.
The same patch may apply with little or no changes to the activity completion report.