LDAP enrollment and course creation template

LDAP enrollment and course creation template

by David Walton -
Number of replies: 13
We're beginning to experiment with LDAP auto-enrollment, including automatic creation of courses. Everything is working successfully, but there's one issue we're having with automatically creating new courses from a template.

Specifically, the code that creates the course doesn't obey the template course's settings for visibility or start and end dates. The start date is always set to the day the course is created, and visibility is always set to true.

Would it be possible to change this behavior so that either 1) the created course obeys ALL of the settings set in the course template; or 2) there's a set of options in the LDAP automatic course creation preferences that allows us to specify either the settings themselves (visible/invisible, start date) or which settings to pull from the template?

It's relatively easy to change the behavior for these two settings just by commenting out a couple of lines in enrol/ldap/enrol.php (in 1.8.2, look for lines 610 and 612):

//$course->startdate = time();
//$course->visible = 1;

Such modifications aren't difficult, but I have a gut feeling that says "the course is a template, damn it! Just copy its settings and be done!" smile

(We create about 2,500 courses a term using this template, and having the instructors reset the dates is a pain--and making the courses invisible initially is an absolute requirement. That's the main reason this request has particular urgency for us.)

David Walton
Average of ratings: -
In reply to David Walton

Re: LDAP enrollment and course creation template

by Barron Koralesky -

We are seeing this issue as well. The courses that are automatically created off of the LDAP data are set to start on today's date, not on the date of the template. We want to create the courses for the fall semester now and have them all be starting on the correct date in September. Can this be fixed? Or is it being worked on?

Another issue we seem to be running into is that the blocks in the template course are not being replicated in the automatically created courses. Are others seeing that?


In reply to Barron Koralesky

Re: LDAP enrollment and course creation template

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

Can this be fixed? Or is it being worked on?

Of course it can be 'fixed'. You just need to convince the developers the change is 'worth it'. But as far as I know, this is not being worked on, as nobody complained so far.

Another issue we seem to be running into is that the blocks in the template course are not being replicated in the automatically created courses. Are others seeing that?

The current code is quite simple, so it doesn't completely clone the template course, just the basic characteristics (exactly the data you can find in mdl_course). There is a patch floating arount to improve this situation and fully clone the course, but it hasn't been applied to the standard version.

Saludos. Iñaki.

In reply to Iñaki Arenaza

Re: LDAP enrollment and course creation template

by David Walton -
Well, this isn't a complaint, but it is a request to change it. smile

I've filed an improvement request on tracker.moodle.org here (MDL-10580), so anyone who's interested can go ahead and vote for this issue. In the meantime, commenting out the lines I mentioned will at least set the start date and visibility according to the template (it won't effect which blocks are created, however).

David
In reply to David Walton

Re: LDAP enrollment and course creation template

by Jaison Gonzalez -

Hi, I find this forum post very interesting, and I would like to know a bit more about automatic creation of courses.

I do have implemented the LDAP server authentication and it is working perfectly, now I am starting with the LDAP enrolment…

On this post and on the LDAP enrollment I have read something about auto-created but haven’t got a clear idea of how to… I assume that all this is done trough the LDAP configuration… and I have searched on the forums and Google but haven not been so lucky… I get remitted to this forum…

I will really appreciate any help on how to auto-create courses and more info about LDAP enrollment...

Best regards.

Jaison J. González Chaux 

In reply to David Walton

Re: LDAP enrollment and course creation template

by Michael Street -
(We create about 2,500 courses a term using this template, and having the instructors reset the dates is a pain--and making the courses invisible initially is an absolute requirement. That's the main reason this request has particular urgency for us.)

Sorry to jump in here, but I'm very curious how you go about doing this. I've been reading all the docs I can find and I can't seem to come up with a clear way of getting Moodle to auto-create all the courses in our LDAP tree.

My goal is to have all of our courses created and hidden, with no students or faculty in them. We will add the faculty when they request to use Moodle for their course, and then the students are added when they first log in. We currently have LDAP authentication working fine for that.

Any thoughts or suggestions on how to do this would be greatly appreciated, thanks.
In reply to David Walton

Re: LDAP enrollment and course creation template

by Carlos Sánchez Martín -

Hello,

I understand that this is an old post and those settings are now working, at least in Moodle 2.0. I didn't used them in 1.9.

The reason to post something now is to ask if anyone knows if this is possible: 

What I am looking for is a way to push a template during auto-creation of courses through LDAP that not only sets settings like start date, visible, upload size etc. but also what blocks are displayed and where, or prepopulates info, such us configurated pages that all courses must have. It is not practical for us to backup and restore a course to get some stuff in the right place for each blanck course... and the template funtionality in LDAP probably should do this... is this important enough to post it to the tracker system?

Carlos 

It seems to me that it has to be possible to do this, but I don't know how! Any ideas?

Carlos

In reply to Carlos Sánchez Martín

Re: LDAP enrollment and course creation template

by Carlos Sánchez Martín -

I haven't seen any answers so far... and I'm wondering, does everyone create gradebooks from scratch? Is there a way to push a gradebook template that can be modified... instead of creating one with each new course?

Carlos

In reply to Carlos Sánchez Martín

Re: LDAP enrollment and course creation template

by Gisele Brugger -

Hello

In Course default settings (../moodle/admin/settings.php?section=coursesettings )

you can set template:

Formatmoodlecourse | format

Maximum for number of weeks/topicsmoodlecourse | maxsections

Number of weeks/topicsmoodlecourse | numsections

Hidden sectionsmoodlecourse | hiddensections

News items to showmoodlecourse | newsitems

and several other...

how to block standards in all courses you can set the block itself

example block "messages"

open any course -> add block -> messages

See images :

fig01

after:

fig02

 

I hope I have helped you 

In reply to Gisele Brugger

Re: LDAP enrollment and course creation template

by Carlos Sánchez Martín -

Hello Gisele,

Thank you for your post. Those settings help, but I am looking for something that, upon creation, populates the course with a default gradebook, a page with a general explanation on how to Moodle... etc. I know I could create a course and then restore it, but then I am not using the LDAP auto-creation. There are too many courses to do this manually, and all those are settings that we share in all courses, so being part of a template would be the perfect solution!

Thank you!

Carlos

In reply to Carlos Sánchez Martín

Re: LDAP enrollment and course creation template

by Carlos Sánchez Martín -

Hello:

I've created an "issue" in the tracker site: http://tracker.moodle.org/browse/MDL-30455

Hope that helps to work on improving the current LDAP template feature, enabling the system to auto-create courses with certain settings, like prepopulated info, such us configured pages that all courses must have or a basic gradebook.

Thank you,
Carlos

In reply to Carlos Sánchez Martín

Re: LDAP enrollment and course creation template

by Michael Woods -
Picture of Core developers

Hi Carlos,

I doubt it will really help you, but my colleague wrote an automated backup and restore procedure for Moodle 1.9.x. It looks up a table of 'source' and 'target' moodle course IDs, and for each pairing, silently backs up the source course and restores it over the target course. 

We also auto-create courses using LDAP, but we then use this process to default courses to their corresponding master courses. For example, the Year 7 English Master course gets backed up and restored over the 7A, 7B, 7C and 7D English courses at the beginning of the year. This includes the specific gradebook that has been setup.

Some gotchas:

  1. It's 1.9-centric (directly referencing course ID folders in moodledata). We are not upgrading to 2.x until April 2012, so we haven't yet thought through how this will work!
  2. It's expecting a MsSQL table with certain fields. This could be changed to whatever database/table/fields you wanted though.
  3. It's always expecting the target course to pre-exist. We tried to make it auto-create the course as part of the restore, but it always seemed to partially fail. Therefore, it only runs after the LDAP course creation has done it's job.
  4. It needs to sit in the 'backup' folder of your moodle installation (eg. yourmoodle/backup/masterdeploy.php)
  5. Tweak, modify, implement at your own risk wink
Regards,
Michael
In reply to Michael Woods

Re: LDAP enrollment and course creation template

by Carlos Sánchez Martín -

Hello Michael,

It does help to know that we are not the only ones needing something like it! Next week I will take a look at the php page and see if we can adapt it... let's see how different Moodle 1.9 and 2.x are for this! On the other hand, I'm still hopeful that there is a more integrated improvement to do this. Maybe the solution is to be able to modify the original settings for all new blank courses to make them closer to what we want. In the end, you always have to modify them, but making the starting point closer to our standard courses will help us a lot!

Just so you know, we are running Windows Server 2008 R2 Enterprise with Service Pack 1. Microsoft SQL Server 2008. IIS 7

Thank you!
Carlos