Features & Development

Adding users in WebWork

Adding users in WebWork

by Rishi Dhar -
Number of replies: 7
Hi,

I have a scenario wherein I want to add the users with there unique ID and course who get registered in some other system into webwork database without doing the same manually with admin credentials.

Is there a way in which we can setup the user account with the unique ID's already present somewhere else ?

Thanks,
-Rishi.
In reply to Rishi Dhar

Re: Adding users in WebWork

by Rishi Dhar -
Hi,

It would be really great if I could get some help here.
I'm trying to automate student registration in WebWork with the details already present with University for university portal logins.

Any help would be appreciated.

Thanks,
-Rishi
In reply to Rishi Dhar

Re: Adding users in WebWork

by Michael Gage -
You'll need to give more information.  There are so many different login methods used by universities.  Do they use LDAP? Moodle? blackboard? at your university?  

WeBWorK will interoperate with Moodle for example. It can be programmed to interoperate with other systems if they allow it.  It's possible that someone else on the forum has done some work toward making WW interoperate with your university's system.

In reply to Michael Gage

Re: Adding users in WebWork

by Rishi Dhar -
Thanks for the reply Dr. Gage.

We use both LDAP and CAS Authentication depending on the application.
I can use either.
In reply to Rishi Dhar

Re: Adding users in WebWork

by Michael Gage -
In reply to Michael Gage

Re: Adding users in WebWork

by Rishi Dhar -
Hi Dr. Gage,
I did go through the code for LDAP authentication but what I'm trying to achieve is, enrolling the student in a course in WebWork wherein the course will be made available to me as one of the parameters (Other parameters like FIrstName, LastName & StudentID will also be made available).

Is there any administration script to achieve the above scenario? Since I couldn't find one on Webwork / MAA website.

Regards,
Rishi Dhar.
In reply to Rishi Dhar

Re: Adding users in WebWork

by Danny Glin -
One place to look is

This has contributed scripts for managing users and such.

I'm not clear on exactly what you're looking for, but I see three ways to approach the problem:
  1. When an account is created in the other system, have the other system push the data to WeBWorK.
  2. Do a regular (nightly) sync of accounts from the other system to WeBWorK.
  3. When a student uses their credentials in WeBWorK, have the system automatically create an account.
For 1 and 2, there really is no API in WeBWorK to handle this.  I have method 2 set up to write directly to the WeBWorK database, which is fragile since it is sensitive to changes in the database structure.  Method 1 could be done this way as well, with the same warnings.  It is probably more elegant to look at wwsh to perform such tasks, as it utilizes existing WeBWorK code.  You can also look at Gavin LaRose's updateRosters script which does 2 by comparing the WeBWorK class list to csv files of student data.

For 3, take a look at the LTI authentication module, as it already has code to do this for users authenticated via LTI Basic.  It should be possible to modify this to take data from LDAP or CAS instead of LTI.

Hope some of this helps.

Danny
In reply to Danny Glin

Re: Adding users in WebWork

by Rishi Dhar -
Thanks a lot Danny for the reply.
What I want to achieve is to populate the webwork database with student details and courses that student has taken and I have these details coming as parameters from other application.
Eventually I want to authenticate the students from CAS.

So to achieve CAS authentication I divided the entire task into two parts

Part 1 - Enrolling the student to appropriate course.
Part 2 - Authenticate student from CAS (modification in scripts available on WebWork forum will be required for this.)

I found out the tables which have the entry for students and courses but I'm not really sure how reliable that is. Hence, wanted some help n that.

It would be great if you could share what exactly have you done to acheive it at your end through method 2 that you have mentioned.

This is kind of urgent hence, I'm trying to figure out a ready solution if available before going ahead and investing time in creating a new script altogether.