I apologize for not having send earlier code snippets. I've been busy getting a school up and running....
But in doing so I found an issue that I think is related to the enrol apply plugin.
Classes have started and we processed a number of applications for a handful of courses. In the first week there is a feedback activity used for a roll call. When the teacher clicks on "non-respondents" on the feedback tab, some students who are not in the course are listed. If you click on the student name the profile shows that they aren't in the course. I think these are students who requested the course but were turned down.
The non-respondents is based on getting a list of all users that could fill out the activity and removing those who did. That uses get_users_by_capability. There are comments in that function that refer to inactive enrollments which I think is the cause of the problem. As I recall this plugin works by putting a partial row in the course enroll table and then completing it upon approval, so I'm wondering if the queries in accesslib don't check that the application wasn't completed.
Also it's possible that the registrar or teachers used the manual enrol plugin to cancel/delete students from the course after they used this plugin to request enrollment, so I'm not sure if that cleans up the database properly.
The one really odd part is that I have a few practice courses I set up for the teachers to play with, and when I go in them and click on non-respondents in the feedback, I get a huge list. I haven't verified if it's all users, or all users who had an application turned down, or what exactly. But in the real courses the teachers have only seen a couple extra students in the non-respondents.
Not sure if this is part of the issue, but in order to stop new applications we turned off the course enrol plugin in the admin's plugin management screen... but for a couple courses we removed it as an enrollment method. We saw that by disabling it we couldn't use it to process earlier requests. (There's got to be a better way to prevent new requests, right?)
There's a relatively easy fix if you have access to source code:
In mod/feedback/show_nonrespondents.php, line 243, add:
// added 1-26-14 by MJZ fix problem with unenrolled students showing up.
if (!is_enrolled($coursecontext, $user->id))
continue;
To summarize --
is there a problem with interaction between enroll apply and manual enrollments?
what's the right way to stop new enrollments from being accepted while still being able to access the "manage" screen to process existing requests?
Thanks,
Michael