Moodle Community Sites
  1. Moodle Community Sites
  2. MDLSITE-1866

Large number of manually enrolled users on moodle.org

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Component/s: moodle.org
    • Labels:
      None
    • Rank:
      43374

      Description

      It seems there are a large number of manually enrolled users on moodle.org who originally self-enrolled, but when moodle.org was upgraded to 2.0 had their enrolment method set to 'manual'. These users are not unenrolled automatically after a period of inactivity, like users who self-enrolled since the 2.0 upgrade.

      Thus, my suggestion is to set the enrolment method for all users on moodle.org to 'self-enrolment'.

        Activity

        Hide
        Helen Foster added a comment -

        Assigning this issue to Petr, as he mentioned in a chat that he could make a migration fix.

        Adding Martin and Dan as watchers, in case they have any comments on the priority of this issue. I recall that in the past Martin mentioned that the longtimenosee setting should be 60 days max, in order to keep the number of forum emails down.

        Show
        Helen Foster added a comment - Assigning this issue to Petr, as he mentioned in a chat that he could make a migration fix. Adding Martin and Dan as watchers, in case they have any comments on the priority of this issue. I recall that in the past Martin mentioned that the longtimenosee setting should be 60 days max, in order to keep the number of forum emails down.
        Hide
        Martin Dougiamas added a comment -

        +1 makes sense to me to make them "self-enrolled".

        Show
        Martin Dougiamas added a comment - +1 makes sense to me to make them "self-enrolled".
        Hide
        Petr Škoda added a comment -

        thanks, I will make some small CLI upgrade script and test it on the clone used for testing of pg migration

        Show
        Petr Škoda added a comment - thanks, I will make some small CLI upgrade script and test it on the clone used for testing of pg migration
        Hide
        Helen Foster added a comment -

        Just noting that certain courses contain a lot of participants with last access 'never' (e.g. http://moodle.org/course/view.php?id=54 has 212 of 226 participants with last access as never). It's possible that a facilitator enrolled lots of users manually, though I can't imagine why they would go to such an effort with so many users! According to Petr, this weirdness could have been caused by upgrades, particularly for accounts older than 4 years (which many are).

        To prevent this situation occurring in future, I've removed the capability to manually enrol users from the facilitator role.

        Show
        Helen Foster added a comment - Just noting that certain courses contain a lot of participants with last access 'never' (e.g. http://moodle.org/course/view.php?id=54 has 212 of 226 participants with last access as never). It's possible that a facilitator enrolled lots of users manually, though I can't imagine why they would go to such an effort with so many users! According to Petr, this weirdness could have been caused by upgrades, particularly for accounts older than 4 years (which many are). To prevent this situation occurring in future, I've removed the capability to manually enrol users from the facilitator role.
        Hide
        Petr Škoda added a comment -

        Here is the fix script, put it into site root and access via web (admins only).

        Show
        Petr Škoda added a comment - Here is the fix script, put it into site root and access via web (admins only).
        Hide
        Petr Škoda added a comment -

        reassigning back to helen

        Show
        Petr Škoda added a comment - reassigning back to helen
        Hide
        Helen Foster added a comment -

        Just noting from a chat with Petr that the script provides a form with role and course selection for going through each course on moodle.org one-by-one.

        Matt, please could you help by putting the script in site root, then reassign the issue back to me.

        Show
        Helen Foster added a comment - Just noting from a chat with Petr that the script provides a form with role and course selection for going through each course on moodle.org one-by-one. Matt, please could you help by putting the script in site root, then reassign the issue back to me.
        Hide
        Matt Sharpe (Inactive) added a comment -

        Should this go in document root or moodle root? So I guess html/ or moodledata/ or just / ?

        Show
        Matt Sharpe (Inactive) added a comment - Should this go in document root or moodle root? So I guess html/ or moodledata/ or just / ?
        Hide
        Petr Škoda added a comment -

        Here is an enhanced version, it goes to moodle $CFG->dirroot, all files that "require('config.php')" at the very beginning do.

        Show
        Petr Škoda added a comment - Here is an enhanced version, it goes to moodle $CFG->dirroot, all files that "require('config.php')" at the very beginning do.
        Hide
        Matt Sharpe (Inactive) added a comment -

        Thanks Petr, I've uploaded it as requested. Let me know how it runs and if I need to do anything else. I assume the script will need removal later.

        Show
        Matt Sharpe (Inactive) added a comment - Thanks Petr, I've uploaded it as requested. Let me know how it runs and if I need to do anything else. I assume the script will need removal later.
        Hide
        Petr Škoda added a comment -

        Yes, it should be removed later. I suppose we will not need it in the future, if yes I would put it to our local/moodleorg/ plugin.

        Assigning to Helen.

        Show
        Petr Škoda added a comment - Yes, it should be removed later. I suppose we will not need it in the future, if yes I would put it to our local/moodleorg/ plugin. Assigning to Helen.
        Hide
        Helen Foster added a comment -

        Hi Petr,

        I've run the script on one course with just 51 participants and obtained unexpected results. Hope we can chat about what to do soon.

        Show
        Helen Foster added a comment - Hi Petr, I've run the script on one course with just 51 participants and obtained unexpected results. Hope we can chat about what to do soon.
        Hide
        Petr Škoda added a comment -

        This is a bad day, I managed to somehow delete the course condition from one loop which resulted in moving of all users with enrol manual to that one course. The easiest fix would be to restore the contents of the user_enrolments table. Or I can reconstruct the enrolments from my older test site. In any case I need access to moodle.org or somebody else who can execute scripts there for me. Sorry, I will not touch live moodle.org again...

        Show
        Petr Škoda added a comment - This is a bad day, I managed to somehow delete the course condition from one loop which resulted in moving of all users with enrol manual to that one course. The easiest fix would be to restore the contents of the user_enrolments table. Or I can reconstruct the enrolments from my older test site. In any case I need access to moodle.org or somebody else who can execute scripts there for me. Sorry, I will not touch live moodle.org again...
        Hide
        Helen Foster added a comment -

        Eloy, I have added you as a watcher hoping you have chance to review Petr's fixed script (attached). If it passes your review, we can then test it on the newly set up http://clone.moodle.org/.

        Show
        Helen Foster added a comment - Eloy, I have added you as a watcher hoping you have chance to review Petr's fixed script (attached). If it passes your review, we can then test it on the newly set up http://clone.moodle.org/ .
        Hide
        moodle.com added a comment -

        Dan, can you test it?

        Show
        moodle.com added a comment - Dan, can you test it?
        Hide
        Dan Poltawski added a comment -

        Hi Helen,

        The script is now on clone.moodle.org for testing.

        I've reviewed the code and can't see any problems.

        Show
        Dan Poltawski added a comment - Hi Helen, The script is now on clone.moodle.org for testing. I've reviewed the code and can't see any problems.
        Hide
        Helen Foster added a comment -

        I've used the script to convert manual to self enrolments for a selection of courses and found things mostly fine. The only weird things I came across were:

        I didn't dare select all courses for conversion!

        Dan, please could you run the cron, then I can check whether inactive users become un-enrolled.

        Show
        Helen Foster added a comment - I've used the script to convert manual to self enrolments for a selection of courses and found things mostly fine. The only weird things I came across were: http://clone.moodle.org/enrol/users.php?id=48&ifilter=37 - 2 manually enrolled users whose enrolment type I couldn't manage to change http://clone.moodle.org/enrol/users.php?id=15 - enrolled users with no role, thus the script cannot change their enrolment method I didn't dare select all courses for conversion! Dan, please could you run the cron, then I can check whether inactive users become un-enrolled.
        Hide
        Dan Poltawski added a comment -

        Hi Helen,

        I'm running that now and indeed it seems to be unenrolling a lot of users.

        Show
        Dan Poltawski added a comment - Hi Helen, I'm running that now and indeed it seems to be unenrolling a lot of users.
        Hide
        Helen Foster added a comment -

        Thanks Dan, I've just checked and found that inactive users have indeed become un-enrolled e.g. the number of participants in Moodle in Thailand has gone down from 6168 to just 33! http://clone.moodle.org/user/index.php?id=36

        Another problem I noticed is that some users have no start date associated with their self enrolment e.g. Lael in http://clone.moodle.org/enrol/users.php?id=5 so will not be automatically unenrolled when they become inactive.

        I then tried selecting all courses for conversion. The script seemed to run ok.

        Dan, do you think we can safely run the script on moodle.org now, and maybe tidy up the few weirdnesses manually?

        Show
        Helen Foster added a comment - Thanks Dan, I've just checked and found that inactive users have indeed become un-enrolled e.g. the number of participants in Moodle in Thailand has gone down from 6168 to just 33! http://clone.moodle.org/user/index.php?id=36 Another problem I noticed is that some users have no start date associated with their self enrolment e.g. Lael in http://clone.moodle.org/enrol/users.php?id=5 so will not be automatically unenrolled when they become inactive. I then tried selecting all courses for conversion. The script seemed to run ok. Dan, do you think we can safely run the script on moodle.org now, and maybe tidy up the few weirdnesses manually?
        Hide
        Dan Poltawski added a comment -

        Just recording this, looks like days since epoch:
        unenrolling user 11495 from course 5 as they have did not log in for 5184000 days
        unenrolling user 11587 from course 5 as they have did not log in for 5184000 days
        unenrolling user 11624 from course 5 as they have did not log in for 5184000 days
        unenrolling user 11629 from course 5 as they have did not log in for 5184000 days
        unenrolling user 11648 from course 5 as they have did not log in for 5184000 days
        unenrolling user 11961 from course 5 as they have did not log in for 5184000 days
        unenrolling user 12285 from course 5 as they have did not log in for 5184000 days

        Show
        Dan Poltawski added a comment - Just recording this, looks like days since epoch: unenrolling user 11495 from course 5 as they have did not log in for 5184000 days unenrolling user 11587 from course 5 as they have did not log in for 5184000 days unenrolling user 11624 from course 5 as they have did not log in for 5184000 days unenrolling user 11629 from course 5 as they have did not log in for 5184000 days unenrolling user 11648 from course 5 as they have did not log in for 5184000 days unenrolling user 11961 from course 5 as they have did not log in for 5184000 days unenrolling user 12285 from course 5 as they have did not log in for 5184000 days
        Hide
        Dan Poltawski added a comment -

        That message is actually " they have did not log in for 5184000 seconds"

        Show
        Dan Poltawski added a comment - That message is actually " they have did not log in for 5184000 seconds"
        Hide
        Helen Foster added a comment -

        Just to summarise where we are with this issue:

        The script was tested on clone.moodle.org running 2.3 in September 2012 and worked mostly fine, with only a few small problems, such as some users having no start date associated with their self enrolment.

        As we're now on 2.5, maybe it would be a good idea to test the script once more before applying it to moodle.org.

        Show
        Helen Foster added a comment - Just to summarise where we are with this issue: The script was tested on clone.moodle.org running 2.3 in September 2012 and worked mostly fine, with only a few small problems, such as some users having no start date associated with their self enrolment. As we're now on 2.5, maybe it would be a good idea to test the script once more before applying it to moodle.org.
        Hide
        David Mudrak added a comment -

        This is assigned to me. However, I have no access to clone.moodle.org (neither shell nor admin) so I'm not the right person to work on this at the moment. I am happy to unless Apu wants to have this under his control.

        Show
        David Mudrak added a comment - This is assigned to me. However, I have no access to clone.moodle.org (neither shell nor admin) so I'm not the right person to work on this at the moment. I am happy to unless Apu wants to have this under his control.
        Hide
        David Mudrak added a comment -

        Hi! This MDLSITE issue is in "Development in progress" state and no comment was added to it in the last 90 days. If you are the assignee of this issue, please consider amending the issue state to reflect the status quo. Doing that will help us in the SITES team to keep the overview up-to-date. Thanks for understanding.

        Show
        David Mudrak added a comment - Hi! This MDLSITE issue is in "Development in progress" state and no comment was added to it in the last 90 days. If you are the assignee of this issue, please consider amending the issue state to reflect the status quo. Doing that will help us in the SITES team to keep the overview up-to-date. Thanks for understanding.
        Hide
        Helen Foster added a comment -

        David, as you are the assignee of this issue, please could you amend the issue status. Please note that we still really need to clean up the enrolments on moodle.org.

        Show
        Helen Foster added a comment - David, as you are the assignee of this issue, please could you amend the issue status. Please note that we still really need to clean up the enrolments on moodle.org.
        Hide
        Helen Foster added a comment -

        Assigning to me temporarily, as it seems that only the issue assignee is allowed to change the status of an issue.

        Show
        Helen Foster added a comment - Assigning to me temporarily, as it seems that only the issue assignee is allowed to change the status of an issue.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:

              Development