New Enrolment Plugin: Enrolment upon course completion

New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Number of replies: 40
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

https://moodle.org/plugins/enrol_coursecompleted

Sometimes a person has to follow an introduction course before one can participate in the advanced session.  Some programs have planned progression paths that users can complete in their own time.  With this plugin it is possible to create a chain or tree of courses.  The moment a student completes a course, he/she is automatically enrolled into another course.  But the plugin can also be used to give a user another role upon course completion.


A student completes the course "Introduction to Moodle"
=> the student is automatically enrolled in the course "Advanced Moodle"
When the student completes the course "Advanced Moodle"
=> the student is automatically enrolled as a participant in the course "Professional Moodle"
When the stutent completes the course "Professional Moodle"
=> the student is automatically enrolled as teacher in the course "Introduction to Moodle"
=> the student is automatically enrolled as a participant in the course "Teachers room"


Renaat

Average of ratings: -
In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank you, I know a lot of people that have been looking for this!!

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Randy Thornton -
Picture of Documentation writers


Renaat,

Fantastic! Thank you! Almost every single client I work with has asked for this ability; it should have been in core years ago.

Randy

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Andrea Rodi -

Hi, My name is Andrea, 

I am trying to modify this plugin entering a new option filter for the enrloment course_completed: the belonging group.

What i want to do is to insert a new option for the belonging group in a course that will be the reasion (jointly with the completion) of the enrolment to the next course. so that, when i use an introduction course which has different classes or groups as well, i can choose also which studens should be enroled into the next course. 

What i need to understand if it's possible, or better to say, which suggestion i need to do that is how can i add a new option in the enrol_form and make it work by using the course group?

I have the course A which has the classes "c1" and "c2", and the course B.

While the students complate the course A, the plugin is checking if they belong to the group specified in the plugin enrol_coursecompleted actived for the course B. 

I do not know if I have been clear, but I ask you to please help me. I need you to understand it for the thesis.


Thanks, 

Andrea 

In reply to Andrea Rodi

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Andrea,

adding a group parameter will not be that easy.

First of all, there are permission issues.  Teachers normally cannot access groups of other courses. So without giving explicit permissions to all teachers to access all course groups, your plugin will only work for managers and admins.

But because every group is part of exactly 1 course, there is no need to add a parameter : I would change the course parameter into a group parameter.  This way you keep things simple (no AND or OR situations).


R


Average of ratings: Useful (1)
In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Andrea Rodi -

Sure, just changing from course to groupe would be a nice idea for my issue. 

I'm gonna think about that.

Thank you so much.

Andrea

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Uther Roi -

Hello, is there a way with this plugin to enrol a student in a cohort depending on the quizz result/grade or do you know any plugin or option that could do the job?


The goal is:

Depending on the test result or grade, I'd like the user to be enrolled to a specific cohort.

0-30% Begginer cohort to give access to Begginner courses only

30-70% Intermediate cohort to give access to Intermediate courses only

70-100% Advanced cohort to give access to Advanced courses only

If someone can help me?

In reply to Uther Roi

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Uther,

Sorry, but this plugin handles enrolment of courses, not cohorts. Sometimes the idea of keeping things simple is not that bad.

If you want to have this functionality, I would add an events listener to your plugin that classifies your courses from beginner to advanced:

$observers = 'eventname' => '\core\event\course_completed',  'callback' => 'your_observer:addtocohort'; class your_observer {public static function addtocohort(\core\event\course_completed $event) { ... }

Greetings

Average of ratings: Useful (1)
In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Uther Roi -

Hi, 

It appears that cohorts are the main group handler in moodle, that's the reason why. But the goal is the same.

I'm quite new in moodle use and I was just searching if this functionnality was already existing? I can imagine that I'm not the first aiming to do that and I'm surprised this is not a core tool. 

Achieving a course is not the end of everything. Moodle team should look at extending tools in this area.

Such as what you did:

- completion leads to another course (or several) 

Would it be hard to develop an admin pannel to add conditions depending the grades?

-completion  leads to a cohort (or several), would it be possible to add this possibility?

Thanks for your answer, do you know if any evolution is desired on your side? 


In reply to Uther Roi

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Uther,

Your problems are related to cohort enrolment. Therefore you should post your questions there. Instead of wandering why it is not a core tool, you could perhaps reflect if you had a good enough understanding of all consequences the moment you opted cohorts. Do you really need them? I personally use cohorts only in 3 specific situations where they are very handy.

In Moodle you can ask to add functionality, (last week only you asked me already to develop 3 complete plugins) but first read the 'new feature development' chapter on https://docs.moodle.org/dev/Process.

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Leroi Bennett -

I was just wondering if you can please help us regarding the following; we have followed all the necessary steps below and reCAPTCHA v2 does not work in Moodle 2.6.1:

Create Account Form

  1. Set up site reCAPTCHA keys (Site administration > Plugins > Authentication > Manage authentication)
  2. Enable Email-based self-registration (Site administration > Plugins > Authentication > Manage authentication)
  3. Enable reCAPTCHA for Email-based self-registration (Site administration > Plugins > Authentication > Email-based self-registration)
  4. In another browser session attempt to create an account (<site url>/login/signup.php)
    1. Site home
    2. Log in
    3. Create new account
  5. Verify the CAPTCHA is present on the form - We cannot, because - reCAPTCHA v2 does not work in Moodle 2.6.1
  6. Ensure you can fill out the form, including the CAPTCHA, and create an account. - We cannot, because - reCAPTCHA v2 does not work in Moodle 2.6.1

...can anyone please help us?

Thanks in advance

In reply to Leroi Bennett

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Leroi,


this is NOT a general discussion forum but a forum about a specific plugin. Please post your questions in a relevant enrolment forum.

As far as I see, the support for Moodle 2.6 is long over.  If you install the latest Skype on a Windows 95 computer, it will not work either. Why do you force your users to work with outdated software?

 R

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Uther Roi -

Thanks for your precision.

I indeed need to use cohorts

I thougth these situations could have been made by a single multifunctional plugin, but it seems not to be as easy as I thought initially.

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Victoria Pearcy -

I need Course B (paid) to be accessible only on completion of Course A (free).

Can I use this plugin and the paypal enrolment method?

In reply to Victoria Pearcy

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

No, when a person is enrolled into a course, he/she will not be asked for payment. See enrolment as an OR situation: once you are enrolled, no other enrolment checks are done. The reason is simple: when you payed for a course by PayPal, you will not be asked again to pay your course by Stripe.

So the same is valid here, once you are enrolled by course completion, you will not be asked for payment.

In reply to Victoria Pearcy

Re: New Enrolment Plugin: Enrolment upon course completion

by Jamie Zelenak-Hyre -
Hey Victoria, did you ever find a solution to this? We also have the same request from a client and I haven't been able to find anything that works without customization.

~JZ
In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Yvan Leduc -

We use Moodle 3.2+ (Build: 20161222)

and i have a message Error version when try to install the 

2018030100

 

In reply to Yvan Leduc

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Yvan,

Sorry, but bug fixes for Moodle 3.2.x ended 13 November 2017, more than a year ago.

R

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Irfan Basha Sheik -

Hi,


Moodle version: 3.6

I am trying to use this plugin. I have configured the parameters for course1 completion and also configured course2 enrolment method to "After completing course: course1". 


After finishing "course1" I can see it's 100% completion status in the dashboard. But, I never got enrolled into "course2".


I read that some cron job need to be run to have the course completion status reflected. But I waited for almost a day. Nothing has happened.


It will be very helpful if you can let me know if I have missed any configuration or what is the cron job that I need to trigger or what is the table in mysql that will have this status saved.

In reply to Irfan Basha Sheik

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Irfan,

THX for your report. Sorry to hear you have problems using this plugin.

The best way to see if your Moodle cron job is running, you can visit:

  • the notifications page: Site administration > Notifications (here you should not see any warnings about a cron job)
  • the scheduled tasks page: Site administration > Server > Scheduled tasks (no disabled tasks should have "never" in the last run column)



In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Irfan Basha Sheik -

Hi Renaat Debleu,


Thank you! your reply has helped me. 


Under Notification settings it shows "The cron.php maintenance script has not been run for at least 24 hours." So, I manually triggered the cron using admin CLI and got entries into mdl_course_completions table.

On waiting for 1-2 minutes, I got enrolled into course2. 

Earlier, I was in assumption that cron is already setup and scheduled to run. 

Again, Thanks you so much for your time and help!

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Roberto Arias -

Hello Renaat

Thanks for your posts, it help me a lot in my project.

I have a question, I have installed, the plugin works, but I can not see the schedule task as you say.

I have to add manually that task?


In reply to Roberto Arias

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Roberto,


if the plugin is working, why would you want to add a task manually?  If you cannot see the schedule tasks page, perhaps you do not have administrator rights.

This plugin has two conditions to work:

  1. cron should run in the background.
  2. course completion has to be enabled.
No tasks have to be added manually.
In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Rósa Sigbjörnsdóttir -

Hi Renaat,

I am using your plugin and the cron-job is running every minute, but still it can take up too 10 minutes before the students are enrolled. Which of the scheduled tasks should I look into?


Regards, Rósa



In reply to Rósa Sigbjörnsdóttir

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rósa,

THX for your message.

The wait time is related to the \core\task\completion_regular_task, the task that calculates if a course is completed or not. Mostly this task has to run twice before my plugin is invoked. So after 2 or 3 cron jobs, normally a person should be enrolled.

Perhaps the best thing you can do is monitoring your mdl_task_adhoc table: how much ad_hoc tasks are waiting to be executed?

BTW, which version are you using?  Older versions of this plugin used a standard low priority, the latest version raised the priority of the task so it should run sooner.


Greetings,

R


In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Rósa Sigbjörnsdóttir -

Hi again,

and thanks for your quick response. I am using this version of the plugin: 3.6 (2019032506). I see that a never version is available but have not installed it yet. 

I will look into the adhoc table. Thank you.

Regards, Rósa

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Sergey Novotny -
Good afternoon, I want to make an enrollment for users completing several courses at once. 

 How can i do that? 

 Enrollment after completion of courses 1 and 2 and 3. Where courses 2 and 3 are opens immediately for all, and course 1 is available for those who have completed both 2 and 3. 

Can i make a multiple sellection of course's enrollments menu in settings page? 

If i make changes in lib.php 

$mform->addElement('course', 'customint1', get_string('course'), ['multiple' => TRUE, 'includefrontpage' => false]); 

 it doesn't work correctly.

In reply to Sergey Novotny

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Sergey,


the multiple option will only work in test environments: it is highly improbable that one user completes 2 or more courses at the same time. After all we are talking about an enrolment upon course completion, the moment a user finishes a course the enrolment will happen.


So if you want to enrol users into course 1 when they have completed course 2 AND course 3:  add this enrolment method to course 1 and choose course 2 as the course parameter. Add in course 2 the completion of course 3 (course completion - Condition: Completion of other courses) as a course completion requirement. As a result students who finish course 2 AND course 3 will be enrolled into course 1.


In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Sergey Novotny -

Hi, Renaat!

Thank you for fast reply!


I have a case of 1000 students taking courses in a random order( about 10 cources opened for them), but only those who have completed all courses are recorded for the final test, which is recorded as a separate course.

In reply to Sergey Novotny

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

If you want to enrol users into course 1 (final test) when they have completed course 2 AND course 3 AND course 4  AND course 5 AND course 6 AND course7 AND course X:   add this enrolment method to course 1 and choose course X as the course parameter. Add in course X the completion of course 2 AND course 3 AND course 4 AND course 5 AND course 6 AND course 7 as an extra requirement to complete the course. Besides viewing lessons, a grade of 90%, and only after june 2019, the user has to finish course 2 to 7. 

The completion event of course X will only happen when all other courses are completed, and on that moment the user be enrolled into course 1 and have access to the final test.


In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Sergey Novotny -

Sorry for the stupid question, how to get extra requirement to complete the course? 

If I add several different methods of enrollment for the course, then the final course will open to everyone who has completed at least one course, and not those who have completed all courses and the final one has opened to him. 

I need all the users who have already completed the course and the users who are still going to take courses conditionally opened 20 courses, they have to complete all 20 courses in any order and the final test opens to them.

In the settings of the Enrolment upon course completion I did not find such an option how to add additional recording conditions.

In reply to Sergey Novotny

Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Sergey Novotny -

Renaat, thank you very much for help!

In reply to Renaat Debleu

Re: New Enrolment Plugin: Enrolment upon course completion

by Matheus Santos -

Hi,

I am having a problem because cron update the system, but not automatically enrol news users after them finished the previous course. This action depends of the admin, manually add new users and run cron.

Is it possible automatize this process?

Attachment subscribe-1.JPG
Attachment subscribe-2.JPG
In reply to Matheus Santos

Re: Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Matheus,

This process is not automated because it would be impossible to un-enroll a user: if someone un-enrolls a user or if the enrollment expired, the automation would re-enroll the same user after the next cron job. A plugin should never have the purpose to undo user actions.

Also when someone unintentionally adds the enrollment method to a course, a cascade of automatic enrollments could happen. This aspect of the plugin was only added to enroll users who completed a course in the past.

Your problem is that when a users complete a course, they are not enrolled in the new course? Can you show me the course completion report?

Greetings,
R
Average of ratings: Useful (1)
In reply to Renaat Debleu

Re: Re: Re: New Enrolment Plugin: Enrolment upon course completion

by Matheus Santos -
Hi, Yes, but i will have a lot of courses...so to do daily manually add new users it's very exhausting.
In the company, the only unenroll will be if the employe is fired and will delete his user of system.

Do you have any idea to manage this situation?
Attachment Completion.JPG
In reply to Matheus Santos

Re: Re: Re: Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

You show me the activity completion report. I need to see the course completion report where there is a column showing if the user completed the course or not.

If you have to enrol a lot of users, one can use the upload users feature.

 

 

 

Average of ratings: Useful (1)
In reply to Renaat Debleu

Re: Re: Re: Re: Re: New Enrolment Plugin: Enrolment upon course completion

by Matheus Santos -
Hi,
After finish the cron job the course was completed. But in the panel, still in the same operation (add manually user).
Is there a way to run cron and moodle update the chain of courses (join the users on the respective courses)?

Attachment course-completed.png
In reply to Renaat Debleu

Re: Re: Re: Re: Re: New Enrolment Plugin: Enrolment upon course completion

by Matheus Santos -
Can you tell the queries/tables who are relationated in the 'plugin'?
Select, insert, update...because i want to know how the system works.
In reply to Matheus Santos

Re: Re: Re: Re: Re: Re: New Enrolment Plugin: Enrolment upon course completion

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
One should use the Moodle API: it will work in the future - log items will be created - permissions will be checked.

Have you even looked at the event observer in the plugin source code?
Average of ratings: Useful (1)
In reply to Renaat Debleu

Re: Re: Re: Re: Re: Re: Re: New Enrolment Plugin: Enrolment upon course completion

by Matheus Santos -
I looked the source code, but i don't understand well (i am starting to learn web development yet), can you explain 'basically' the algorithm and which tables i have to insert,update or delete?