Restriction by enrolment method

Availability restriction ::: availability_enrolmentmethod
Maintained by Jorge C.
Moodle availability plugin which lets users restrict resources, activities and sections based on enrolment methods
Latest release:
74 sites
31 downloads
9 fans
Current versions available: 1

Moodle availability plugin which lets users restrict resources, activities and sections based on enrolment methods

Requirements

This plugin requires Moodle 3.11+

Installation

Install the plugin like any other plugin to folder /availability/condition/enrolmentmethod

See http://docs.moodle.org/en/Installing_plugins for details on installing Moodle plugins

Usage

After installing the plugin, it is ready to use without the need for any configuration.

Teachers (and other users with editing rights) can add the "Enrolment method" availability condition to activities / resources / sections in their courses. While adding the condition, they have to define the enrolment method which students have to have in course context to access the activity / resource / section.

If you want to learn more about using availability plugins in Moodle, please see https://docs.moodle.org/en/Restrict_access.

How this plugin works

The availability plugin checks if the user has the given enrolment method and, if yes, grants access to the restricted activity.

However, there is the capability moodle/course:viewhiddenactivities (see https://docs.moodle.org/en/Capabilities/moodle/course:viewhiddenactivities) which is contained in the manager, teacher and non-editing teacher roles by default. If a user has a role which contains moodle/course:viewhiddenactivities, he is able to use an activity / resource / section even if the teacher has restricted it with availability_enrolmentmethod to some other role.

Because of that, availability_enrolmentmethod can't be used to hide activities / resources / sections from users who already are allowed to view hidden activities in the course. Use this availability restriction plugin wisely and explain to your teachers what is possible and what is not.

License

Licensed under the GNU GPL License.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Jorge C. (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Plugins bot
    Mon, 8 Aug 2022, 6:30 PM
    Approval issue created: CONTRIB-9031
  • ST H
    Tue, 6 Dec 2022, 12:05 AM
    Hi Jorge,
    The plugin is not working with Moodle version 4.0.4. It broke the access restrictions area and only showed plain text.
  • sadafe
    Sat, 24 June 2023, 5:44 PM
    to resolve the problem of this plugin (broken access restrictions area) you must copy content of
    yourmoodle***/availability/condition/enrolmentmethod/yui/build/moodle-availability_enrolmentmethod-form/moodle-availability_enrolmentmethod-form.js

    to

    yourmoodle***/availability/condition/enrolmentmethod/yui/build/moodle-availability_enrolmentmethod-form/moodle-availability_enrolmentmethod-form-min.js

    the minified js has some problem.
  • sadafe
    Sat, 24 June 2023, 6:33 PM
    also maybe you need comment this linr:
    yourmoodle***/availability/condition/enrolmentmethod/classes/condition.php
    line 124:
    $name = self::description_format_string($enrolmentmethodnames[$this->enrolmentmethodid]);
  • Roy Jensen
    Wed, 27 Dec 2023, 12:15 PM
    "Restriction by enrolment method" was suggested for an application I need:

    I want to set up a course that has a few sections for free, then requires payment for the remaining sections.

    In practice, I want one enrollment method to only work for the first few sections of a course, and another enrollment method to work for the entire course.

    Is this possible with "Restriction by enrolment method". Any hints on implementing it for this purpose?
Please login to post comments