GithubHelp home page GithubHelp logo

ewallah / moodle-enrol_coursecompleted Goto Github PK

View Code? Open in Web Editor NEW
13.0 5.0 14.0 383 KB

Enrolment on course completion

Home Page: https://moodle.org/plugins/enrol_coursecompleted

License: GNU General Public License v3.0

PHP 85.77% Gherkin 12.63% Mustache 1.61%
moodle moodle-plugin php7 php8

moodle-enrol_coursecompleted's People

Contributors

ewallah avatar matt-catalyst avatar rdebleu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

moodle-enrol_coursecompleted's Issues

Add placeholder for course link

Hello,

My apologies, I created a pull request prior to creating this issue. The use case for including the course link in the email is that, the user is automatically enrolled in a course that they may not know about once they have completed a different course. We have found this causes some confusion if we do not send an email informing the user they have been enrolled into a course. Including the link in the email increases the percentage of users that launch the course after being enrolled.

I have made the necessary changes to add this additional placeholder, and am hoping you agree to it's value and will incorporate it.

Regards,
Ron

enrol_coursecompleted not obeying enrollment duration

In Moodle 3.5 when setting the enrollment duration for this plug-in in a course, users are not being automatically unenrolled when the enrollment duration is up.

Example:
• add an instance to course B that enrolls user based on completion of Course A
• set enrollment duration for instance in Course B to 1 hour
• have test user complete Course A and get enrolled into Course B
• wait an hour or more and student is not unenrolled from Course B

This is with the settings set to unenroll the user in the Enrolment expiry action as well.

Issues after installing auto group

We had this plugin working fine until we installed an auto-group plugin as we wanted users to be enrolled into specific groups when auto enrolled to a course. Note that sometimes these groups would not exist and therefore it is required to have these groups created. Course completion enrolment plugin seems to only work with groups that exist.

However after installing the auto group plugin, the course completion enrolment plugin does not auto enrol but shows the eligible users in a + sign against enrolment methods of the course. We also uninstalled both plugins and tried with course enrolment plugin alone but get the same behaviour.

Any reasons/suggestions to enrol automatically?
Our Moodle version is 3.11+ (Build: 20210701) and Auto group plugin is from https://moodle.org/plugins/local_autogroup version used is 2.5 (2020072700)

wrong enrollment

Hi,
I created a course and I described as completion criteria having finished 4 activities AND having a minimum score of 60 points in the final test (it is a four-step test).
According to the logic of completion only users who have both the requirements complete the course.
I created a second course and as enrollmnet methods I chose the completion of the first course.
Everything works fine for users who accomplish both the criteria. What is really odd is that in the second course are enrolled users who shouldn't be enrolled too (they didn't reach the minimum score).
I attach:

  • the completion criteria of the first course;
  • the results of the firts course (starting course)
  • the enrollment methods of the second course
  • the list of enrolled users in the second course
  • the details of enrollment of the user 1
  • the details of enrollment of the user 2

If you look at the results of the starting course you can see that it is really odd: the first user shouldn't be enrolled in the second course but he is. The second user with the same problem (he didn't reach the minimum score) isn't enrolled in the scond course.
Thank you.
Fil

details_user_2
details_user_1
list_of_enrolled_users
completion_criteria_course_1
results_of_starting_course
enrollment_methods

Tagged releases

Is there anyway to know from the repo which release is which commit?

Implement bulk operations

cftr manual enrolments:

lang/en/enrol_manual.php
33:$string['confirmbulkdeleteenrolment'] = 'Are you sure you want to delete these user enrolments?';

bulkchangeforms.php
18: * This file contains form for bulk changing user enrolments.
27:require_once("$CFG->dirroot/enrol/bulkchange_forms.php");
30: * The form to collect required information when bulk editing users enrolments.
35:class enrol_manual_editselectedusers_form extends enrol_bulk_enrolment_change_form {}
38: * The form to confirm the intention to bulk delete users enrolments.
43:class enrol_manual_deleteselectedusers_form extends enrol_bulk_enrolment_confirm_form {}

locallib.php
160: * A bulk operation for the manual enrolment plugin to edit selected users.
165:class enrol_manual_editselectedusers_operation extends enrol_bulk_enrolment_operation {
168:     * Returns the title to display for this bulk operation.
177:     * Returns the identifier for this bulk operation. This is the key used when the plugin
178:     * returns an array containing all of the bulk operations it supports.
185:     * Processes the bulk operation request for the given userids with the provided properties.
282:     * Returns a enrol_bulk_enrolment_operation extension form to be used
291:        require_once($CFG->dirroot.'/enrol/manual/bulkchangeforms.php');
298: * A bulk operation for the manual enrolment plugin to delete selected users enrolments.
303:class enrol_manual_deleteselectedusers_operation extends enrol_bulk_enrolment_operation {
306:     * Returns the title to display for this bulk operation.
315:     * Returns the identifier for this bulk operation. This is the key used when the plugin
316:     * returns an array containing all of the bulk operations it supports.
325:     * Returns a enrol_bulk_enrolment_operation extension form to be used
334:        require_once($CFG->dirroot.'/enrol/manual/bulkchangeforms.php');
339:        $defaultcustomdata['message'] = get_string('confirmbulkdeleteenrolment', 'enrol_manual');
345:     * Processes the bulk operation request for the given userids with the provided properties.
367:        // Display a notification message after the bulk user unenrollment.

lib.php
359:     * The manual plugin has several bulk operations that can be performed.
363:    public function get_bulk_operations(course_enrolment_manager $manager) {
367:        $bulkoperations = array();
369:            $bulkoperations['editselectedusers'] = new enrol_manual_editselectedusers_operation($manager, $this);
372:            $bulkoperations['deleteselectedusers'] = new enrol_manual_deleteselectedusers_operation($manager, $this);
374:        return $bulkoperations;

A question about condition

Hello

I want to know if it's possible to add one more condition with this plugin .
What I want, it is the possibility when a course is completed , a new one is open but 5 days (or more/ less) after .

For example, a course A completed on 15/01/2019 then the course B will open at 20/01/2019

Other question : Possible to use this on activity instead course ?

Thanks !

Check if role exist

There should be some basic checking that the role was not deleted between the configuration of the enrolment and the actual enrolment.

DB Reported

Hi Renaat,

We use your plugin for our courses, but the latest version has a strange issue.
When the option Display learning path (enrol_coursecompleted | svglearnpath) is checked, a user that is not enrolled in the course and will only get a white screen.
Fix: As soon as we disable the "Display learning path" option from your plugins settings it instantly starts working .
This only happens when the course has an instance of this plugin.
Other courses without such an instance just display "You cannot Enrol yourself".

Moodle version 3.8.3+
PHP 7.3
Apache 2.4.6

Kind Regards,
DB

No user enrollment?

Hi,

It looks like the user enrollment does not work for me and I don't really know why.

  1. I installed the plugin
  2. I activated the plugin in the enrollment options
  3. I created a new course and set the enrollment method to "After completion of course: {$a}".

After that I logged out, created a new user and completed the necessary course. However, somehow I am not enrolled for the following course, even though I ran the cron job and flushed all the caches. I also changed the order of the enrollment methods and and put "After completion of course" first.

In the "Users" column of the "Enrollment methods" table, a "1" is entered under "After completing the course", so something seems to be working. However, I am not registered in the course.

Am I missing something out? Did I forgot to include a step in the setup? Is there some sort of documentation besides the README I so I can check the installation and setup?

Send Custom welcome message only on the start date of enrollment

Very useful plugin, well done!
When I activate the "Custom welcome message" function and the "Start date" function, the message to users arrives when they have completed the previous course, not when their enrollment in the current course is activated (on the day I have entered in the "start date").
Thank you for the effort you are putting into this.

Enrolment start and end date not working as expected

To Reproduce

Complete and precise steps to reproduce the behavior:

  1. Create enrol on course completion
  2. Configure enrol start date next week
  3. Complete a user
  4. User is enrolled

Expected behavior

As the enrolment only starts next week, the user should NOT be enrolled.

Question / Feature Request: Enrol to different courses based on cohort membership

We have different user cohorts, for example Cohort 1 and Cohort 2

They have to to all courses 1 - 5 sequentially, this would be possible with your plugin.

But after that there are deepening courses so that Cohort 1 has to continue with 7 and Cohort 2 with 6 and so on.

We have around 10 groups and 10 deepening courses.

We think about using your module as a basis for our implementation: Allow in auto enroll to specify one or more cohorts for which the auto enrollment should be triggered.

Woudl that be in scope of the module? Would such a PR be merged? Do you have any hints where to start that?

Speed of enrolment?

As I understand, the enrolment checks via event observation for course completion, not as a cron job, thus it should happen rather instantly? Or is it still reliant on some general Moodle cronjob?

version downgrade

Steve has a bit of trouble with the plugin enrol_coursecompleted_moodle40_2022042300.
It will not downgrade from v3.9.7 (2022042302) that was installed with version 3.11.

Enrol upon completion not available

I'm setting up a new Moodle v3.11. I've installed the enrol upon completion mod but it doesn't show up in available enrollment methods. Is there something else I need to active to get it to work?

Improve link to required course

Current behavior:

  • there are 3 courses: common 101, C1 201 and C2 201

  • C1 201 and C2 201 need common 101 to be completed for auto enrollment
    image

  • visiting C1 201, by clicking on C1 201 link in Available courses , takes to a page like this (https://SITE/enrol/index.php?id=20)
    image

  • Link common 101 on this page takes to https://SITE/enrol/index.php?id=20, that is to C1 201

Expected behavior:

Where this might be fixed

public function enrol_page_hook(stdClass $instance) {
seems the function generating this URL, but I am not very good with Moodle coding in general or with Moodle plugins, so unable to submit a proper PR for fix.

Plugin and Moodle versions

  • Course completed enrolment: enrol_coursecompleted | v4.0.4 : 2023051000
  • Moodle: 4.2

Plugin is working as expected otherwise.

Thank you for writing and maintaining this very useful plugin, and having a look at this issue.

Breaking changes in the repo

Hi,

We use git submodules to install plugin to our Moodle sites. We have noticed a recent change (probably from early Aug) breaks our codebases completely.

This is because the following commit is no longer on the main branch (nor its on any branch): 9171a97

Moodle 3.9 is still in security support till the end of this year (11 Dec). We have clients still on this LTS and when trying to get the latest security releases out to their sites, this repo breaks our CI/CD process.

We cannot use an older commit in the main branch due to this: 584b590 - it jumps from v3.9.3 to v4.0.0. Our site is currently on v3.9.4, so cannot downgrade to 3.9.3 nor upgrade to 4.0.0 due to version incompatibility.

The way we support this in our plugins is by creating a MOODLE_39_STABLE branch so the older Moodles which are still in the process of upgrading from 3.9 to 4.1 can still checkout the latest supported code. Would this be possible to create a MOODLE_39_STABLE branch in this repo so our CI/CD tools can successfully clone the repo as a submodule?

Error occurs when courses which control the enrolment are deleted.

When visiting a course that has been configured to base enrolment on completion of another course that has since be deleted a database error occurs.

This is because the code assumes that the queried course will always exist. Suggestions for fix would be:

  1. Change code in lib.php (line 45) to check result of course query and return 'unknown' string or similar
  2. Add an event handler to the course deleted event which checks for and then deletes links to other courses that depend on i'rs completion for enrolment
  3. Check for similar errors in the code base (I am not 100% familiar)

Students not being automatically enrolled

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Describe the bug

We have multiple courses set up that require the completion of a pre-requisite course. However, when students successfully complete the courses, they are not automatically enrolled in the next course. Therefore, we have to do it manually.

We have set up a CRON to force the update every 15 minutes; however, this hasn't worked. Script used is
moodle.DOMAIN/admin/cli/scheduled_task.php --execute='\core\task\completion_regular_task' though is does run successfully.

Execute scheduled task: Calculate regular completion data (core\task\completion_regular_task)
... started 18:40:38. Current memory use 15.4 MB.
Running completion_criteria_date->cron()
Running completion_criteria_activity->cron()
Running completion_criteria_duration->cron()
Running completion_criteria_grade->cron()
Running completion_criteria_course->cron()
Aggregating completions
... used 6 dbqueries
... used 0.083964109420776 seconds
Scheduled task complete```

image

image

To Reproduce

See screenshots above

Expected behavior

We expect students to be enrolled automatically. With the amount of students we have its becoming very difficult to manually enrol students.

Additional context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible, except under certain conditions.

  • Moodle version: 4.4.2+ Build: 20240816
  • plugin version v4.4.3 2024070200
  • PHP Version: 8.2.22

Increase course list drop down in Moodle plugin.

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Describe the bug

The course dropdown to select which course is to be completed prior to allowing enrollment in the next course is limited to a list of 100 courses. Our Moodle site has nearly three times that many courses. Can the list be made to show all courses within the site?

To Reproduce

Complete and precise steps to reproduce the behavior:

  1. Go to 'Click on course'
  2. Click on 'Enrolled Users'
  3. Click on 'Enrolled Users drop down list'
  4. Select Enrollment Methods
  5. Click on 'Add method'
  6. Scroll down to 'Course Completed enrolment'
  7. Scroll down to 'Search'
  8. Only 100 courses are available to scroll. Not all of my courses are showing up in the search list.

Expected behavior

I expect to see all of the courses available in the Moodle site to choose from.

Additional context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible, except under certain conditions.

  • Moodle version 4.1.2
  • plugin version v4.1.1
  • php version 8.0.30

Screenshots

If applicable, add screenshots to help explain your problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.