External enrollment questions

External enrollment questions

by Nikki Macfarlane -
Number of replies: 6
I am storing my student details on an external table within the same database as Moodle uses when they purchase a course. I would like to use this data as external enrollment so we do not have to manually enter the student record or send enrollment keys to them. A couple of questions.

1. My payment system (oscommerce) stores the student record over three tables:

- customer id and password are on one table
- order id and customer id are on a second table
- product id (course) and order id are on a third table

Can I map across the full three tables using some sort of join? Or do I have to run a job first that extracts this information and loads it into a new table so all the details are in one place for Moodle to use?

2. What happens if you are using external database enrollment and a student purchases a new course? This would mean they would then have two records on the external database. Can Moodle figure out on its own that the student has access to two courses or does this cause some problems?

Thanks,

Nikki
Average of ratings: -
In reply to Nikki Macfarlane

Re: External enrollment questions

by Ess Gee -

Hey Nikki,

We have been successful in integrating oscommerce and moodle to sell courses,accreditation examinations and quizzes

It is an automatical solution that takes the user automatically to the moodle site and autoenrolls for credit card payments.

checkout :

http://www.turbocashtraining.co.za/os

Regards

Selwyn Wacks

swacks@sentechsa.com

In reply to Ess Gee

Re: External enrollment questions

by Nikki Macfarlane -
Sounds like exactly what I need Selwyn. A couple of questions.

I have managed to get the external authorisation working so Moodle is now looking on the oscommerce customers table to find its enrolments. Is this how your system works as well? I am trying to figure out how I do the enrolment into each course. Do you use an external table for that as well or supply enrolment keys instead? If enrolment keys, how do you send these to the student? Are they sent an email when their credit card is processed that has the enrolment key in it?

I would love to know how you manage the auto log in to Moodle. Do you have any code you would be willing to share on this?

One question on passwords and subsequent course pruchasing. Lets say we have the following scenario.

Student logs on to oscommerce and purchase course A. They set their oscommerce account up with the password "first". After the course is paid for and the credit cared authorised, they are logged into Moodle. moodle uses external authorization to check the oscommerce database (I am assuming you have Moodle use the customers table for this). The following day the student then changes their password in moodle to "second". Moodle updates the Moodle tables but does not affect oscommerce. The following week the student then logs on to oscommerce and purchases course B. They have to log on to oscommerce using the password "first". Now they have two courses they have purchased but different passwords on the Moodle and customer tables. When they next log on to Moodle, will it check the Moodle tables first to see if the user is there or will it go straight to the oscommerce tables? If it goes to oscommerce, will they need to use "first" or "second" to log on to Moodle? Confused?

I guess what I am struggling with is if you are using external checking for the user access, does Moodle still check the Moodle tables first to see if the user exists?

Any suggestions you have on how I can integrate this smoothly would be greatly appreciated!

thanks,

Nikki
In reply to Nikki Macfarlane

Re: External enrollment questions

by Martín Langhoff -
Ideally, you could make a view to achieve this -- but OSCommerce only runs on MySQL. Not sure if there's an easy fix other than writing a glue script there.

We've done a full OSCommerce integration that I'm hoping on merging into 1.6 -- it doesn't read OSCommerce tables directly, it uses an enrolment token instead to enrol users.

The patchlog is here, but it shows all the merges too: http://locke.catalyst.net.nz/gitweb?p=moodle.git;a=shortlog;h=mdl-osc-ceed
In reply to Martín Langhoff

Re: External enrollment questions

by Nikki Macfarlane -
Hi Martin. Great to hear other people are managing to get Moodle and oscommerce integrated successfully. I looked through the patchlog you sent me. I am not a programmer so struggling with understanding it! Is every entry on these pages related to oscommerce? If so, I am not sure where I start to find the code that does the oscommerce integration. I am sorry to be so clueless - can you offer some guidance?

I have tried to work out which files in the list work with moodle but am not having a lot of luck! Is there a cvs anywhere with a download of all the files needed and documentation? I have figured out how to get the user authorization to use the oscommerce table customers to check for users. It is the next part where a student can enrol in the courses they have paid for I am struggling with!

Do your students always go to moodle first and then enrol or can they just go stright into oscommerce and purchase their course and then be taken to the moodle system?

One other question for yourself or anyone using an external table for user authorization. Do I need to add all my existing students to the oscommerce table customer in order to keep their access or will moodle check its owqn tables first and only go to the external one if the user cannot be found?

Appreciate any help available here!

Thanks,

Nikki



In reply to Nikki Macfarlane

Re: External enrollment questions

by Martín Langhoff -

Nikki,

the link I provided is showing you a list of commits - unfortunately, there commits are merged with all the commits happening in Moodle 1.5.x so it's pretty hard to spot the stuff you need. I don't have a way to provide this easily at this time for you to try. At any rate, you'll need a programmer to set things up.

WRT the 'workflow', users enrol in Moodle normally -- internally we create a record in OSC when the user logs in for the first time. When the user wants to enrol in a course marked for OSC, we send the user to OSC. Once the user has paid for one or more courses, OSC gives them one encrypted token per course. The tokens are used as proof of purchase and to actually enrol.

From the transaction complete page, the user clicks on a link that takes her back to Moodle and passes the tokens along. When Moodle sees the tokens, it enrols the user accordingly.

There is also an addition to the 'Participants' page to allow teachers to grant extensions to the enrolment (as we used enrolment periods with the OSC-enabled courses).

It is a fairly clean job (thanks to Patrick Li!). It does not use auth/db or enrol/database plugins; instead, it is based on SSO plugins. This has the added advantage that you can run it in parallel with different auth and enrolment plugins.

The code is available using Cogito/GIT (a new version control system developed by the creator of Linux). To check it out you'll need a Linux or MacOSX system, you'll need to install GIT and Cogito, and do

    cg-clone http://locke.catalyst.net.nz/git/moodle.git#mdl-osc-ceed

Cheers -

In reply to Martín Langhoff

Re: External enrollment questions

by Ess Gee -

Hi Nikki,

This was custom developed for the TurboCASH Accounting Project.

http://www.turbocash.co.za or http://www.turbocashtraining.co.za

I have to revert back to the programmer and just discuss the licencing issues on this.Again ,I myself am not a programmer.But I can find out about your issues.

The Project Leader of TurboCASH which is an open souce accounting package, is very keen on Open-sourcing the Oscommerce Moodle Intergration, if we can overcome the licencing issues.

It has the advantage of being seemless for credit card transactions.We could have done this with EFT as well but we decided that we would land up debt-collecting unpaid courses. So there is a manual log-in for Bank Transfers.

All the programming is done on the OSC side. The basic thought process is to use the model field in OSC as the ID field to compare to the course ID field in moodle,and authenticate with the enrollments

The moodle login is firstname ,oscommerce password.

I believe a user can purchase multiple courses in oscommerce.

But you bring up a very relevant point now, i.e. Can user re-take a course.

We  never considered this aspect . But since we are going to sell accreditation courses which users will have to repurchase if they fail ,this will be necessary.

Best regards,