- Moodle Administration
- Alex Büchner
- 1838字
- 2021-08-25 18:13:06
Forms of Enrolment
The students need to be given access to a course before they are allowed to use it. The users need to be assigned a role within a course before they are allowed to do anything. They can be assigned the role automatically by self-enrolling, or manually using the Assign roles link in the course administration block (see Chapter 6 Roles Management).
Granting access is done via the enrolment mechanism. Moodle supports a wide range of enrolment options which are discussed in the remainder of the chapter.
The actual enrolment of students does not require administrator rights, and is a task which should be performed by teachers. The role of the administrator is to set up the available site-wide enrolment mechanisms and they are covered next.
You access the course enrolments configuration page via Courses | Enrolments in the Site Administration block. Each supported enrolment mechanism is represented by an enrolment plug-in that can be enabled and configured separately.

Each plug-in can be enabled or disabled separately, and multiple plug-ins can be enabled simultaneously (multi-enrolment). Internal enrolment and the two types of payment enrolments can be used as default mechanisms, while all plug-ins can be or have to be configured.
Each enrolment type is now covered in some detail except Moodle Networking, to which a separate chapter has been dedicated. The type of enrolment mechanism you choose depends entirely on the infrastructure you have in place, that is, where and in what format your learners' data is stored.
Internal Enrolment
Internal enrolment is the only plug-in that cannot be de-activated and is the default enrolment mechanism when Moodle is installed.
The teacher, of course, can enrol users manually via the Assign roles link in the Administration block within the respective course.
Moodle also supports the concept of self-enrolment. The concept of self-enrolment is relatively simple: A course contains a password, known as the "enrolment key". Anyone who knows this key is able to add themselves to a course.
The enrolment key is set in course settings, as already discussed. The teacher has to inform the students about the key and ideally limit the enrolment period to an appropriate time frame to avoid any misuse.
Once the enrolment key has been set, learners will have to enter it when they try to access the course for the first time. If the key is entered correctly, access will be granted, otherwise it will be denied.

There is only a single setting for the internal enrolment plug-in called enrol_manual_keyholderrole that affects the screen the students will see when they attempt to enroll to a course where an enrolment key is required. It will list anybody who is assigned to the specified role as "contacts" to whom we can request the enrolment key. If this is not set (default), the name of the first person with an update privilege for the course is displayed.
Database-driven Enrolment
In larger organizations, it is common to store certain user-related information on a separate database or directory. If this information contains course-related information, it should be utilized for enrolment. In doing so, you minimize the efforts which are necessary when using manual enrolment.
LDAP, the Lightweight Directory Access Protocol, is an application standard for querying and modifying the directory services running over TCP or IP. It is used by many organizations to store learner details and is therefore well suited as an enrolment source for Moodle.
It is necessary that the PHP LDAP module is installed on the server for the enrolment to work. If it is not installed, Moodle will display an error message. The module also supports Microsoft's implementation of LDAP, called Active Directory, as well as OpenLDAP, an open-source implementation of the authentication mechanism. Most sites that use LDAP enrolment also use LDAP for authentication. It is discussed in great detail in the next chapter.
The principle of the enrolment method is rather simple, but effective. The information stored in the data source about students, teachers, and courses is mapped onto the Moodle counterparts. Enrolments are updated when a user logs in. All we have to provide are the mappings.
Moodle makes a number of assumptions when working with LDAP enrolment such as:
- Your LDAP tree contains groups that map onto courses.
- Each group has multiple membership entries to map to students.
- Users have a valid ID number field.
The LDAP settings have been annotated on the right-hand side of the screen with detailed explanations that were discussed earlier. I will provide additional information where applicable. If you are not sure where to locate some of the required information, contact your system administrator who should have these values.
There are five sections of parameters which have to be provided.

It is important to set the ldap_search_sub (that is, the search subcontext) correctly. If it is set to No, the subcontexts will not be searched, but the search will be potentially faster and vice- a-versa:

Role mappings have to be set, which contain a context (usually the same as the one in the server settings) and the member attribute (user IDs).

It is recommended to lock fields, especially when the automatic course creation has been activated.

Automatic course creation is a potentially time-saving facility. A course is created for each entry on the LDAP server in the category specified. To expedite the process and to guarantee consistency among courses, you should create a course with the preferred settings and use it (course ID) as a template for all newly-created courses.
A lot of organizations use a Management Information System (MIS), either proprietary or developed in-house, that holds information about the staff and / or learners, and the courses they are enrolled in. It makes perfect sense to utilize this data for enrolment to Moodle. Since all MISs use a database at its core, all we have to do is to get access to the relevant data.
The bad news is that there is a plethora of database systems out there that have to be supported, from the big players such as Oracle and Microsoft SQL Server to the lesser known systems such as Informix or Sybase. The good news is that there exists a layer ADO, a successor to ODBC, which does all the hard work for us. We only have to talk to the ADO layer and its internals deal with the rest, no matter what database it is talking to.
The database has to contain a course ID and a user ID. These two fields are compared against the fields that you choose in the local course and user tables.

The database connection settings have been annotated on the right-hand side of the screen with good explanations. If you are not sure where to locate some of the required information, contact your database administrator.
Moodle provides a flat file enrolment mechanism. The method will repeatedly (via the Moodle cron process) check for and process a specially-formatted, comma-separated text file in the location that you specify. The format of the file is as follows:
action, role, userid, courseid, start (optional), finish (optional)

The following is a sample file snippet:
add, teacher, 5, Psychology1 add, student, 12, Psychology1 del, student, 17, English2 add, student, 29, English, 1207008000, 1227916800
The start time and end time have to be provided together. To generate the numbers since epoch, it is best to use an online converter.
In the text file settings, you have to provide the absolute file location on the server. If no file is specified, Moodle will look for the default file at moodledata/1/enrolments.txt
. Moodle should be able to read the file and delete it once it has been processed.
You can choose to have a log file sent to the administrator, and a notification to the teachers and students. The default roles can be overridden with other values if needed:

The IMS Global Learning Consortium has specified an XML file format that represents the student and course information. Moodle is capable of using any file that conforms to the format as enrolment source. Like the flat file format, Moodle checks regularly for its presence, and if found it will process the file and delete it. You can find details of the basic structure of the format at http://yoursite/help.php?module=enrol/imsenterprise&file=formatoverview.html on your Moodle site.
The plug-in is also able to create user accounts if they aren't yet created, or change user details if requested. Furthermore, new courses can also be created if they are not found on Moodle.
All other fields, including role mappings are self-explanatory:

Enrolment with Payment
Moodle comes with two enrolment plug-ins that enable you to set up paid courses. There exist other third-party plug-ins fulfilling the same purpose, but they have not been incorporated in the core Moodle system. A popular example is aMember, which is a membership and subscription script that supports a wide range of payment systems.
You have to specify the default cost and currency of a course. This amount can be overridden in the course settings. If the amount for any course is zero, then students are not asked to pay for the entry. If you enter an enrolment key in the course settings, then the students will also have the option to enroll using a key. This is useful if you have a mixture of paying and non-paying learners.
You require a valid PayPal account that can be set up at no cost at www.paypal.com. The language encoding has to be set to UTF-8 / Unicode in the More Options area of your PayPal account:

Authorize.net is a payment gateway that supports credit card and electronic check payments. Like PayPal, you require an account to use it. It is also possible to set up a test account for testing purposes. (See www.authorize.net for details.)
The payment enrolment plug-in requires a secure login, for which you need to purchase or generate a valid SSL (Secure Sockets Layer) certificate. To turn this feature on, go to Security | HTTP Security and tick Use HTTPS for logins. Once this has been done successfully, you will have to enter a number of settings that follow:
- General Settings (default cost and currency)
- Authorize.net Merchant Account Settings (account details, transaction settings, and supported cards)
- Order Review & Scheduled Capture Settings (requires cron)
- Email Sending Settings
Once the merchant, transaction, and reviewing settings have been entered, the payment method can be used for enrolments. You can still provide a key for self-enrolment and support a mix of paying and non-paying learners. A new Payments link will appear in the administration block at the course level where you manage the received payments. Details are provided for each order as shown in the screenshot (courtesy of Ethem Evlice):

- Vulkan學習指南
- Oracle Business Intelligence : The Condensed Guide to Analysis and Reporting
- Celtx: Open Source Screenwriting Beginner's Guide
- Software Testing using Visual Studio 2010
- 攝影輕松入門:Photoshop后期處理
- SolidWorks 2019快速自學寶典
- 中文版After Effects 2022基礎教程
- 新編中文版3ds Max 2016入門與提高
- AutoCAD 2020中文版入門、精通與實戰
- Premiere Pro CC 2015中文版基礎與實例教程(第4版)
- Photoshop CC設計與應用任務教程
- 中文版Photoshop CC 2018基礎培訓教程(全彩版)
- 和秋葉一起學:秒懂Photoshop后期修圖
- OpenCms 7 Development
- 剪映專業版:PC端短視頻制作(全彩慕課版)