self-enrollement without "enrol me"-button (moodle 2.0.1)

self-enrollement without "enrol me"-button (moodle 2.0.1)

by Christoph Ackermann -
Number of replies: 10

Hi,

I'm looking for a way to remove the "enrol me"-button for self enrolment.

Students should be able to just click on a course and enrolment should take place automatically without the need to click a button.

I tried to add a automatic submit after a timeout to the moodle\enrol\self\locallib.php, but I couldn't figure out how. sad

 

Any ideas?

Christoph

Average of ratings: -
In reply to Christoph Ackermann

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Timothy Sideris -

Hello Christoph,

In the settings you can set a course as not enrolable. Then the only problem is customizing the message "This course is not enrollable at the moment" with something that you want instead.

Make a copy of the following file. A backup copy is helpful because it often takes several attempts to get the edits to work properly.

public_html/moodle/lang/en_utf8/moodle.php

(1) Replace “This course requires an enrollment key...from teacher” as follows

REPLACE THIS:
$string['enrolmentkeyfrom'] = 'This course requires an \'enrolment key\' - a one-time<br />
password that you should have received from $a'

WITH THIS:
$string['enrolmentkeyfrom'] = '<b>You Do Not Have Access to These Course Resources</b><br />Visit the [ <a href=\"http://www.moodle.org/something\">for additional help</a> ].'

where "moodle.org/something" is intended only as a placeholder for whatever site you want to use.

In reply to Timothy Sideris

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Timothy Sideris -

Sorry I used the wrong "REPLACE" $string.

Use this one

REPLACE THIS:
$string['notenrollable'] = 'This course is not enrollable at the moment.'

In reply to Timothy Sideris

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Christoph Ackermann -

Hello Timothy,

thanks for your response! But it seems, that my description was a little bit misleading. I want to achieve just the opposite of what you described.

Our students are free to use any course whenever they want. I want them to be able to enrol to a course without clicking any button. A student should just click on the name of the course and be automatically enrolled. I want to make the it as easy to use as possible.

In reply to Christoph Ackermann

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Timothy Sideris -

Hmmm. I guess I have three options for you depending on what you want:

1. Do not define an enrollment key, and then everyone will have access, or

2. Do what I said before, but specifically "assign role" to every student to have access to every course.

3. You also could create a new "role" called "enrolled in everything" and then define it to have full access to every course. Then link every student to that role.

PS, the good news is that your post caused me to finally figure out what I had been trying to figure out for the longest time. So, thank you for posting. (smile)

In reply to Timothy Sideris

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Christoph Ackermann -

Thanks for the tipps, but I would like to avoid the global roles. I'm afraid that they haunt me in the future...

I can see two problems with your suggestions:

1.) The mymoodle page with the courses of the user would be rather confusing, as he would see all courses

2.) If there are announcements forums with mandatory subscription in a course, all users would receive all those mail notifications.

So I guess I have to continue my search...

PS: Glad you found a solution for your problem smile

In reply to Christoph Ackermann

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Christoph Ackermann -

ok, it seems, that I found kind of a solution for this.

I edited the file: moodle/enrol/self/lib.php

This contains a function called enrol_page_hook.
It seems, that - among other things - this function checks if a form was submitted or not.

So I tried to find the if-statements that made the difference and change them to if(true).

I changed this:

//        if ($instance->id == $instanceid) {
if (true) {
//            if ($data = $form->get_data()) {
if (true) {

To be honest, I don't completly understand what those if-statements are doing, but if I force the script to enter this block, a user is enrolled to a course without having to click the "enrol me"-button.

I guess it will have a few other side effects which I haven't discovered yet mixed

Maybe somebody can help me with the fine tuning?

In reply to Christoph Ackermann

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Julia Küfner -
Hi christoph I just started working with moodle and tried to get rid of the "Enrole me" button too. Honestly, I neither understand the if-statements but as I found no better solution I would use yours. It's been a while since your last post, did you discover any side effects yet ?
In reply to Julia Küfner

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Christoph Ackermann -

Hi Julia,

so far I've had no problem with the hack.
But I also have to admit, that my system doesn't have much load yet.

In reply to Christoph Ackermann

Re: self-enrollement without "enrol me"-button (moodle 2.0.1)

by Luciana Oliveira -

Hi,

I'm using Moodle 1.9.

Do you know were can I make this change? 

Thank you so much!

In reply to Timothy Sideris

Enrol me Button Query

by Naveed Azam -

Can any one tell me that , for course registration,after clicking on Enrol me Button. In which tables data inserted??