How to setup External DB enrolment to default in v1.6.3.?

How to setup External DB enrolment to default in v1.6.3.?

by Antonio López -
Number of replies: 12

Hi Moodlers,

I'm using external DB enrollment with Moodle 1.6.3. Is it possible to set it up to be the default enrolment method? If so, I'd appreciate to tell me how, since all I see in the admin configuration screen is this.

Thanks a lot for your help,

Antonio.

Attachment EnrollmentPlugin.jpg
Average of ratings: -
In reply to Antonio López

Re: How to setup External DB enrolment to default in v1.6.3.?

by Jay Lee -
External Database Enrollment is not meant to be the default. You can enable it by checking it off. You should keep Paypal or email based enrollment as the default for exceptions.

Jay
In reply to Jay Lee

Re: How to setup External DB enrolment to default in v1.6.3.?

by Antonio López -

Thanks Jay. However, I've checked it on and keep Paypal as the default. The problem is: how can I set a student to see only the courses he has enrolled on through a external DB?

On version 1.5.x this was automatically done when you choose external DB enrollment. However, in v1.6.3. no matter the courses he's enrolled on, he will always see all the courses and can manually enroll himself.

Thanks,

Antonio.

In reply to Antonio López

Re: How to setup External DB enrolment to default in v1.6.3.?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers

Hi Antonio,

there seems to be a bit of missunderstanding about the default enrolment methods. If you read it carefully, it talks about default interactive methods (emphasis mine). External DB is not an interactive method, so you cannot set it as the default.

Interactive methods are used when a user wants to enrol in a given course and that course is enrollable. Then the users needs to do some action (interactively) to enrol in the course. Be it clicking on the 'Yes' button or paying via Paypal or whatever.

So if you don't want your users to enrol manually in your courses, you need to:

a) enrol them via a non-interactive method (like external db smile

b) set all of your courses as non-enrollable. Go to the settings of each course and choose 'No' in the 'Course enrollable' setting.

If you have lots of courses and are 100% sure you want all of them non-enrollable interactively (manual or otherwise), you can execute the following SQL query in your Moodle database (this is valid for 1.6.x, I'm not sure about 1.7.x; you've been warned)

UPDATE mdl_course SET enrollable = '0';

Don't forget that new courses will have a default value of 'Yes' for this setting.

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: How to setup External DB enrolment to default in v1.6.3.?

by Antonio López -

Hi Iñaki,

Thanks a lot for your explanation. I've set all the parameters the way you've told me but,again, when a student enters into the platform he sees all the courses, not just the ones that he's enrolled into. He doesn't see the "My Courses" view, he sees ALL the courses. How can I make the student see ONLY his own courses? That's the real problem I still have.

Gracias por tu ayuda,

Antonio.

In reply to Antonio López

Re: How to setup External DB enrolment to default in v1.6.3.?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Are you sure they are really enrolled into their courses. What you describe is exactly what happens when the user is not enrolled in any course.

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: How to setup External DB enrolment to default in v1.6.3.?

by Antonio López -

Yes I do. The student can see the whole course catalog, although he can only see the content of the course he's enrolled into. However, he never sees the My Courses view. That's exactly what I wanted to have: just the My Courses view as it happened in previous Moodle versions.

Thanks,

Antonio.

In reply to Antonio López

Re: How to setup External DB enrolment to default in v1.6.3.?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
We are currently using 1.6.3+ and we get the My Courses view as usual.

Do you have by any change a setting of $CFG->disablemycourses=true; in your config.php file? Also, what are your settings in Administration >> Configuration >> Site Settings for 'Front page format:' and 'Front page format when logged in:' ?

Saludos. Iñaki.
In reply to Iñaki Arenaza

Re: How to setup External DB enrolment to default in v1.6.3.?

by Alan Zaitchik -
Inaki,
Excuse me for jumping on this old thread with my question, but it seems that you would know the answer to my somewhat related question:
I am using external DB (with Moodle 1.9) and I have enrolled the students in courses. The courses are created dynamically when we use /enrol/database/enrol_database_sync.php-- so far so good. The courses are set to enrollable=0 since we don't want manual enrollment, and the courses (as well as the category) have visible=1.
The trouble is that when students log in they are apparently not enrolled in the courses!
Somehow I feel that the courses don't "know" to use the external db plugin as their enrollment method!
Is there a column in mdl_course or some other table I need to set? (I want to do this in batch mode rather than interactively... although I don't know how to do the latter either!) Actually, I specify a "template" course for dynamic course creation so perhaps I should just set it up correctly for the template course... how do I do that?
Thanks so much for any help you can give.
Alan
In reply to Alan Zaitchik

Re: How to setup External DB enrolment to default in v1.6.3.?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers

Alan,

as far as I know there's nothing you need to do in mdl_course or any other table to get what you want. We are using external DB (with 1.9) as the enrolment method in our University and users get correctly enroled into their courses.

What is the default role for the users in course context? You can check for this under Administration >> Users >> Permissions >> User Policies. Make sure the setting for "Default role for users in a course" is set to "student"

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: How to setup External DB enrolment to default in v1.6.3.?

by Alan Zaitchik -
Thanks, Inaki.
Yes, the default role is set to 'student'.
Since posting my question I noticed that the mdl_role_assignments table does indeed show 'database' for the enrol column. I see this, together with the students who are enrolled, by executing

SELECT r.shortname, u.username,c.shortname,ra.enrol FROM mdl_user u JOIN mdl_role_assignments ra ON ra.userid = u.id JOIN mdl_role r ON ra.roleid = r.id JOIN mdl_context con ON ra.contextid = con.id JOIN mdl_course c ON c.id = con.instanceid AND con.contextlevel = 50 WHERE r.shortname = 'student';

Nonetheless, students log in and get the "Course is not enrollable" message. The documentation says that "enrollable" pertains to interactive enrolment only, not external database enrolment, so I imagine that users see this because Moodle is unhappy with the database enrolment. I tried playing with startdate, visible, enrollable, and so on, but to no avail.
One thing I should mention is that the configuration of the external DB plugin is being done by a php script that sets the right values into the mdl_config table. At least I *think* they are the right values! When I manually go to the External Database enrolment plugins screen everything certainly seems to be in order. The value for the mdl_config column named 'enrol_plugins_enabled' is 'manual,database'. (I even tried setting it to 'database, manual' to see if order mattered. You can see how desperate I have become!)
There must be something that makes Moodle refuse to recognize the enrolments. It must be some setting having to do with each course, and since they were all created dynamically from a "template course" I created for this purpose it would not surprise me that I screwed up there. The template course does not have any enrolments associated with it-- could that be relevant? The settings for the template seem innocuous to me: it is not enrollable, it is visible, its start date is in the past, and so on. Does any of this make sense to you?
All help is most appreciated because I am quite stuck and also running out of time...

Alan
In reply to Alan Zaitchik

Re: How to setup External DB enrolment to default in v1.6.3.?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers

Hi Alan,

I've seen that you've solved the mistery. I just wanted to paste the link to the other thread where you say it's fixed (http://moodle.org/mod/forum/discuss.php?d=104990#p493452) so other will be able to find it in the future smile

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: How to setup External DB enrolment to default in v1.6.3.?

by Alan Zaitchik -
Iñaki,
Sure thing -- go right ahead.
I need to take a closer look at how the "visible" setting is handled when a course is automatically created based on a template. I know this has been discussed somewhere and may even have changed at some point in Moodle "history". Anyway, the immediate cause of my problems was probably my own confusion as to what the visible setting was for the specific courses I was testing with.
Alan