Crosslisting courses between Moodle sites

Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
Number of replies: 34
I've developed a way of crosslisting courses between Moodle servers.  That is, a Moodle site can list courses which are hosted on another Moodle site. A student visiting the first site could see such courses in which they are enroled in the second site in the "My Courses" listing at the first site. If they clicked on the link to such a course, they would be automatically logged into the second site and be redirected to the actual course on the second server.

Currently only the authentication and redirection are implemented. The course information and student enrolment has to be manually set up on the first site. It is assumed that the usernames and passwords are the same on both sites.
Average of ratings: -
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
This could e.g.  be usefull for distributing the load of a site over multiple servers: one frontpage/different machines. Is that right?
In reply to koen roggemans

Re: Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
Eventually I hope so.  At the moment it would be rather cumbersome, since all the synchronization of course information and enrolments has to be done manually. In some situations, e.g. a small number of courses with very large enrolments in each course, it might work well enough in its current state.
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Mark Stevens -
This is very cool.  I can see this working within a university with many departments/schools... What kinds of uses were you planning on?  Is the code ready to share? smile
In reply to Mark Stevens

Re: Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
For some earlier discussion about this see the following
http://moodle.org/mod/forum/discuss.php?d=6487

At the moment Petr Skoda is checking the code for possible security lapses. As soon as he is done, I will put the code in a directory in the contrib section of the CVS.  I've already put some hooks in Moodle 1.5dev to call the code if it is placed in the appropriate directories of a Moodle site. 
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Timothy Takemoto -

It would be nice if the same sort of technique might be used for cross posting of forum posts between installations.
http://moodle.org/mod/forum/discuss.php?d=3135
http://moodle.org/mod/forum/discuss.php?d=16129
Timothy

In reply to Timothy Takemoto

Re: Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
It shouldn't be difficult to implement the same technique to add resources to one Moodle site  which link into activities (like forums) on another Moodle site, assuming students have logins at both sites.  It will require rewriting some of the resource module code to enable this to be done with sufficient security. See the following discussion:
http://moodle.org/mod/forum/discuss.php?d=18696
In reply to Timothy Takemoto

Re: Crosslisting activities/courses between Moodle sites

by Zbigniew Fiedorowicz -
I have now adapted my crosslisting code to crosslist resources (e.g. forums) between Moodle sites. The code should be available from the anonymous cvs in a few hours at:
http://cvs.sourceforge.net/viewcvs.py/moodle/contrib/crosslist/
In reply to Zbigniew Fiedorowicz

Re: Crosslisting activities/courses between Moodle sites

by Timothy Takemoto -
Zbigniew
This looks fabulous. I will install it this evening (and be recruiting classes that want to share forums with mine from April).
Timothy
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
I have posted the crosslisting code and some installation instructions to cvs:/moodle/contrib/crosslist

It will take a few hours to propagate to the anonymous CVS server.

In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Martín Langhoff -
Sounds cool!

We were on the brink of implementing something very similar: a "moodle auth plugin" with single-sign-on between two moodles, plus the "my moodle" page listing courses from both Moodle setups.

This was planned to be able to run two "contexts" under Moodle: official courses and student-driven communities. The plan was to have them with themes that were slightly different, indicate the context.

After a brief chat with MD in the last MoodleMoot, he suggested we go back to one of our earlier designs: run it all within one Moodle install, under two top-level categories, and assign theme variations (via CSS) to all course pages, driven by their top-level category.

We are implementing this approach now on a private branch @ catalyst, hoping to merge it in after 1.5 branches. Should show up in 1.6 smile
In reply to Martín Langhoff

Re: Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
I'd be interested in hearing more about your two-server scheme.  How were you planning to synchronize the course information in the "My Courses"  pages on the two servers?

A further refinement which might be worth thinking about is how to crosslink activities between two servers so that grades are also synchronized.
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Martín Langhoff -
In 1.5 there's an "HTML" block. Our intention was to have two separate "my courses" boxes, one for the local Moodle install, teh other one with the "remote" moodle install, using a variation of the HTML block for that one, one that did an HTTP request from the other Moodle.

Alternatively, we were going to publish the courses as RSS and use the RSS reader.
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'm interested in the background that led to you implementing this.  If the sites need to be synchronised to that degree (same usernames/password both ends) then why would you not just use a single Moodle server or cluster?
In reply to Martin Dougiamas

Why use several Moodle servers?

by Gustav W Delius -
Hi Martin, this is an important issue you raise.

Let's consider a university setting where there are several independent academic departments which however allow students to take courses from more than one department. One solution would be, as you say, to have one central Moodle server for the whole University, run by some central computing service. The other solution, apparently chosen by Zig's university, is to let departments run their own Moodle servers. I think the second solution will work much better than the first.

Now this may only make sense to someone who knows how academic disciplines work at a university: each department will have different teaching approaches and techniques, leading to different requirements to the teaching technology. And departments find it essential that they keep the control over how they teach. Once a department has realized that Moodle is going to have a great impact on how they teach, they will want to have full control over their Moodle.

I know many Universities who thought like you that having one central VLE installations would be more efficient. The effect has been that many departments are hostile to the idea of a VLE. Hardly any of the Mathematics Departments I know for example have embraced the centrally supported VLE. Academics do not like to be dependent in their teaching on a central service department. For example if we want to extend the VLE to suit some discipline specific teaching need we don't want to have to beg from the central university whether they would be good enough to implement this for us, a year down the road.
Average of ratings: Useful (1)
In reply to Gustav W Delius

Re: Why use several Moodle servers?

by Martín Langhoff -
Doesn't sound like it leads to a... hmm... consistent user experience to have each faculty have its one VLE. Even if all faculties were to magically agree on Moodle, different versions, themes, URLs and 'site settings'... A UI nightmare.

In NZ students often do cross-faculty degrees, so following courses from 3 faculties is quite common. More structured Uni's are safer from this.

Still, most of the companies you deal with online/offline have different departments, but hide their schyzophrenia when dealing with clients/students/users/etc.
In reply to Martín Langhoff

Re: Why use several Moodle servers?

by Gustav W Delius -
Yes, that is a common argument. However university students don't actually have a problem if for the different subjects they study they have slightly different websites. By the time they reach university they will have seen and used so many websites for all kinds of different purposes that they are not at all surprised to see that the website that they use for studying say philosophy looks different from the one they use to study mathematics (we have a surprising number of students studying both).

At university we are actually trying to give students a varied learning experience. Students will have to cope with a large diversity of material when they meet the real world so we try to get them used to it already while they are here. This applies to the kinds of learning resources we give them as much as to the interface we provide.

However there is no need to make things artificially hard. So subject specific sites make sense because of the different needs of the departments. But we should make it as convenient for users to navigate between the sites.
Average of ratings: Useful (1)
In reply to Martin Dougiamas

Re: Why use several Moodle servers?

by Zbigniew Fiedorowicz -
Let me second all of Gustav's points, elaborate on some of them and add a few of my own.

Ohio State is a large and bureacratic institution. Our IT department tends to be rather unresponsive to needs of individual departments, let alone individual instructors. I doubt that they ever will embrace Moodle - they are too much committed to an expensive commercial solution. However it is not unlikely that some allied department, e.g. physics might also be attracted to Moodle. Now because of bureaucratic problems, any commonly funded initiative by two departments would have to be cleared by the central administration (including IT), and is likely to be rejected. Having two separate Moodle installations would get around this problem.

We also have a couple of high school math teachers using our WeBWorK server. One of the high schools is starting to use Moodle. The easiest way to to integrate this would be via crosslisting of courses. For example I think a Moodle administrator at the high school would be more like to embrace a solution which does not involve our web server having write access to his/her Moodle database, which simple crosslisting would not require. And synchronizing course descriptions/student enrolment could be manually handled by the high school teacher without too much trouble for classes of 20-30 students.

Also I am thinking of generalizing our WeBWorK module to a more general module which will allow transparent interaction between two educational web servers.

Lastly, I think one of attractive features of Moodle vis a vis commercial systems is its flexibility and ability to adapt to user circumstances. There is no central authority dictating the ONE TRUE WAY of doing things.
In reply to Zbigniew Fiedorowicz

Re: Why use several Moodle servers?

by Timothy Takemoto -

Dear Zbigniew,

I tried to install the code crosslisting code, Thank you!

but I had two problems.

1) I realised part of the way through that not only do I need two 1.5 moodles. I only have 1.5 Moodle, the others are still only 1.4.1, and when I tried to bring those three files up to date I hit sesskey() errors. More hacking would be required. 

2) I realised that students would have to be enrolled onto both Moodles. I am looking for a way of allowing students to enrol onto only their own moodle installation and their forum posts to be piped to another moodle without their being the need to enroll in the "other" Moodle. This is essential. The cross-site security would have to be left to the cross-site password.

I think that you have covered the reasons for cross-lising courses. I agree. It is mainly a university politics thing, but I can see reasons why moodle's proliferate within an institution even if it were better if there were only one.

As for Cross Site listiing of "2p2" Forums
I am excited about the possibility of having forums on mulitple moodles, because I would like to give my students the chance to communicate with students in other classes in other countries. This is useful in both language classes, where Japanese and Finns might speak to each other in English, perhaps, and in content classes, where Japanese and Americans might speak to each other about views of the atomic bombings perhaps.

A p2p moodle-to-moodle interconnectivity would be useful because:

1) Login Method. I use my university's IMAP server to log in. This is important. I find that there are always problems with manual registration of students. Visitor students cannot use my university's IMAP sever, and our university's IMAP server will not be connected to another university.  

2) Personal Information Security. I don't want to allow other students to log in to our university's server because of personal information concerns.  I would want to limit "outside" user access to a part of the site, such as one or two forums.

3) Grade Administration. Particularly, I want to be able to grade my own students for their contributions to the forum, and presumably the other teacher would want to do the same, without the other teacher having access to the grades I have given my students and vice versa. Ideally the grades button would be appear only below students from my moodle. Also if the visitors were to take tests on my moodle then I would have the problem of sorting their grades from the gradebook.

4) Copyright. Sometimes I use copyright images and words on my moodle sites, on what i see as being a basis of fair use, within the classroom. If there are students from other classrooms joining in it becomes more difficult to argue that the moodle homepage is within the classroom, and more difficult to ensure that the copyright materials are not copied and used elsewhere.

5) Disciplining. It is difficult to foresee what can go wrong with a participants behaviour on a moodle course site but if they are ones own students then one can discipline/control/administer them quite easily. It would be more of a headache if those students were from another country.

6) Language. My moodles are generally set in Japanese (recently UTF-8) to make them easy for my students to use. There are Japanese course names and Japanese labels. The latter at least would be gibberish to any visitors. Additionally, I send posts to my students in Japanese. If the visitors were enrolled on my moodle then either they would be recieving gibberish (as far as they are concerned) or I would not be able to post to my students in japanese, or I would have to enrol them in another course to communicate.

Perhaps I will be able to pay Jamie to make improvements to your cross site listing to allow students to post without being logged in.

Timothy

In reply to Timothy Takemoto

Re: Why use several Moodle servers?

by Zbigniew Fiedorowicz -
Hi Timothy,

1) I realised part of the way through that not only do I need two 1.5 moodles. I only have 1.5 Moodle, the others are still only 1.4.1, and when I tried to bring those three files up to date I hit sesskey() errors. More hacking would be required.

No, you don't need to have 1.5. My testing setup for this code has a Moodle 1.5 server communicating with a 1.4.3. The very minor edits you need to make in 3 version 1.4.3 scripts are shown here:
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/course/view.php?r1=1.82&r2=1.83
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/login/index.php?r1=1.63&r2=1.64
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/mod/resource/type/file/resource.class.php?r1=1.23&r2=1.25

2) I realised that students would have to be enrolled onto both Moodles. I am looking for a way of allowing students to enrol onto only their own moodle installation and their forum posts to be piped to another moodle without their being the need to enroll in the "other" Moodle. This is essential. The cross-site security would have to be left to the cross-site password.

A very minor edit to my scripts will remove the need for authenticating their passwords. Change the lines:

$hashdata = $USER->username . $clicktime . $accessCode[$authindex] . $USER->password;
$hashdata = $user->username . $clicktime . $accessCode[$authindex] . $user->password;
to
$hashdata = $USER->username . $clicktime . $accessCode[$authindex];
$hashdata = $user->username . $clicktime . $accessCode[$authindex];
respectively.
In reply to Zbigniew Fiedorowicz

Re: Why use several Moodle servers?

by Zbigniew Fiedorowicz -
For some reason I can't edit my previous post and part of it was deleted.

Although you don't need to have visiting students from other sites to have regular accounts on your system, they will have to have some kind of user accounts. You can use the uploaduser script to import them into your system and assign them an unguessable password and disable their email. That way the only way they can enter your site is via the crosslisting code.

Lastly I just noticed Martin made a minor improvement to my code, so you should make the edits indicated in
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/mod/resource/type/file/resource.class.php?r1=1.23&r2=1.26
instead of the link above.
In reply to Zbigniew Fiedorowicz

Re: Why use several Moodle servers?

by Zbigniew Fiedorowicz -
A further thought.  You could assign the visiting students to a separate group within your course and use group mode to impose appropriate restrictions on them.  If that doesn't accomplish precisely what you want, it would likely be worthwhile to enhance group mode functionality, rather than writing special code for the case of crosslisted students, as that would likely be more generally applicable.
In reply to Zbigniew Fiedorowicz

Re: Why use several Moodle servers?

by Timothy Takemoto -

Dear Zbigniew,

I have 1.4.1 so I would have to do somethign about sesskey() (that started with 1.4.3) too. But I will upgrading to 1.5 sometime today.

I have also been thinking and forsee some other problems.

1) Is it true that for any one resource, the links only go in one direction? In other words (unlike perhaps the double link sharer mentioned below) there is no forum on the visitor course for the visitor teacher to mark. My guess is that the visitor teacher will also want to mark the forum in their course. My students would thus be "visitors" on the other course. Hence your suggestion of a sort of lower privelidge visitor-group, is not really what I am looking for.

2) I think that creating student accounts for students in another course might be quite difficult. It would be great if the users stay inside their own moodle, but the moodles talk to each other such that the posts appear in both Moodles (except perhaps without a link to visitors profile, or the ability to mark). 

I first posted about using the notion of "trackback" (like blogs) or RSS,  but I was really thinking of a forum that I created to allow my students at Kurume Unviersity talk with students in an American Air Force Academy in New York State, USA, about the merits or otherwise of the bombings of Hiroshima and Nagasaki. I hacked a free perl message board, doubling the entry pages, such that there were English and Japanese pages both posting to the same database. Students of both countries wrote their articles in English, but the forms and words like "post," "edit" and "preview" where in different languages depending upon the point of entry.  That was the sort of thing I had in mind. Perhaps a better analogy would be siamese twin Moodles that share a organ, or part of their database.

Dear Zbigneiew, please do not put your self to more trouble to provide this sort of functionality. It is quite beyond what you had in mind. I should be paying someone to do it. Jamie Pratt has already offered, and if I had some more money I would be taking it up with him.

Timothy

In reply to Timothy Takemoto

Re: Why use several Moodle servers?

by Zbigniew Fiedorowicz -
I have 1.4.1 so I would have to do somethign about sesskey() (that started with 1.4.3) too. But I will upgrading to 1.5 sometime today.

No, you could make the indicated changes in 1.4.1 scripts.  There is no need to make sesskey() changes (except to secure your Moodle against things like the Santy worm and similar nasties).

1) Is it true that for any one resource, the links only go in one direction? In other words (unlike perhaps the double link sharer mentioned below) there is no forum on the visitor course for the visitor teacher to mark. My guess is that the visitor teacher will also want to mark the forum in their course. My students would thus be "visitors" on the other course. Hence your suggestion of a sort of lower privelidge visitor-group, is not really what I am looking for.

I think group-mode (perhaps with some enhancements) could be used to achieve this.  If there were not too many students, the visiting teacher could manually import grades into his/her own site, perhaps into an offline assignment or into one of the gradebook enhancements on their own site.  Or a script could be written to automate this process.

2) I think that creating student accounts for students in another course might be quite difficult. It would be great if the users stay inside their own moodle, but the moodles talk to each other such that the posts appear in both Moodles (except perhaps without a link to visitors profile, or the ability to mark).

This would be much more difficult and would require major changes in the Moodle core code.  And you would need to constantly revise your code to keep up with Moodle version upgrades.

In reply to Zbigniew Fiedorowicz

Re: Why use several Moodle servers?

by Timothy Takemoto -

Dear Zbigniew

I have uploaded to 1.5, yeah.

Bearing in mind that I am thinking about a lot of students, I think that I will have to wait, or pay for, the major revisions to the moodle core, so that forums can share a backend or database.

Thanks for all your work on this.

Timothy

In reply to Zbigniew Fiedorowicz

Re: Why use several Moodle servers?

by Martín Langhoff -
Ok, fair enough. There is a need for a diversity in Moodle installations, and Moodle has always been about bottom-up, anyway. It's the BBs and WebCTs that tend to get the nod from the top smile

To share user/password in a many-moodles environment like you describe, t just make sure the IT department maintains an LDAP server with the student info. That way, any department/faculty wanting to run their own Moodle/atutor/ilias can do so, and just hook up to the authentication server. You can also do this with IMAP/POP3 and others.

If all the servers are within the same domain (or in subdomains) you can hack things so that there's SSO (I've described a scheme in Moodle security recently to achieve this). If the servers are not under the same domain, kiss SSO goodbye sad

Cross-listing of courses, calendar events, etc starts getting tricky, as you have to force the different faculties to run a particular version of Moodle, with special patches. It's doable, but a custom job, and one that reduces faculty independence.
In reply to Martin Dougiamas

Re: Crosslisting courses between Moodle sites

by Mark Stevens -
Martin, I can see lots of advantages to a central server, if you can get one, but since we can't get one I have to agree with Gustav and Zig.  I think what Zig described might be happening on lots of campuses.  Our central IT is not Moodle.  I know our budget can't purchase a new server, but other departments could purchase boxes that could be crosslisted with us.  This would lessen the load on our smallish server.  Also, our subnets are much faster and more stable than going accross campus.  I would love to implement this today simply for the ability to have site events that apply just to our department.  Our faculty complain that other departments' events show up on their calendars.  
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Robert Lefebvre -
I was working on something similar and started to think that a modified link exchanger script might work, actually it was two separate link exchange scripts working together in tandem. I don't know if this has any application in what you are working on or not but hopefully it will.

If each Moodle site has a link exchange script so that those other departments that want their courses listed can submit them to be listed.  They may choose to have their courses listed at dept 1, 3, 5 and 7 and not at dept 2,4, and 6.

And in conjunction with that script you also maintain a central link exchange where evryone submits their courses to a central list. Then each moodle can pull their main list from there.

A good feature of these scripts is they verify links for you. With all the courses it would be easy to get broken links. These scripts will make managing them easier.


In reply to Robert Lefebvre

Re: Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
I would definitely like to see your scripts and see if I can adapt them.  You can email them to me (email in my profile). Thanks in advance.
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by jovi . -
Isn't it possible to just modify the database tables so that Installation2 uses the user and authentication tables from Installation1? If so, I wonder which tables would need to be modified.

What I am thinking of is two installs, different content, different customization but with the same user base.
In reply to jovi .

Re: Crosslisting courses between Moodle sites

by Zbigniew Fiedorowicz -
The circumstances I contemplate using this for involves Moodle installations on different machines and users enrolled in different classes in both Moodles.

I think the best approach for your situation would be to set up an LDAP server whose database contains the user information for both Moodle installations and which will serve as authenticator for both Moodles.

Using one user table for two Moodle installations would not be a feasible approach IMHO, as it would require modifying the database code so that the user table be treated differently than all the other database tables.
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by jovi . -
Thats a great idea! Thanks!
In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by Dirk Herr-Hoyman -
Could you say about more about how you have implemented this?

What I'm looking for is a loosely coupled model. One where the URL
to each course site has a well-defined "public ID" syntax, not merely
an internal identifier. For example
http://courses.wisc.edu/phys101-fa05-001

In reply to Zbigniew Fiedorowicz

Re: Crosslisting courses between Moodle sites

by David Fountain -

I've been trying to install this today and I'm only getting a blank screen when I click on the "Redirect to remote server" link.

A couple of questions:

is the accesscodes.php the same on both servers, or does server1 become server2 (I've tried all combinations of this but no joy).

Does it only work with students - I've got students in one course who I would like to access a remote moodle installation as teachers.