Importing Parents to Moodle

Re: Importing Parents to Moodle

by Justin P -
Number of replies: 8
Oops!  I just relized that I left in some code I was using for testing.  I've attached the script without the testing code.
In reply to Justin P

Re: Importing Parents to Moodle

by Marc Grober -
I was wondering if you might not take a crack at how one could use the bulk user upload to further streamline this. Once the table was made I would think one could add the additional field to the upload template and link via name....
In reply to Justin P

Re: Importing Parents to Moodle

by Jamie Tinley -
Justin, GER, John, Anthony

I know anthony is too busy to re-write this code. However, it appears both Anthony and Justin already made it work in the mass parent creation and assign parent modules. I really need this to work but don't understand how to create the sql table it reads from or where to place this php.

My situation has changed dramatically. Our moodle courses were opened up to many more students than I had expected. Plus, my main IT admin could not tell me which students are going to use our Moodle course and which will homeschool on their own (why I am trying to understand). I was recieving so many emails (50 a day) from frustrated users with no username/login that I had to import EVERY student 7th to 12th. That way any errors are user errors knowing how to login. I automate this weekly now and create parents accounts with their same name for ease of finding the right one to attach. (stu_johnsmith and Par_johnsmith)

That's over 2000 users now! It's painful attaching them manually. Plus I have to attach teachers to all of them so they too can check on their students. Now they want to add 6th too! Currently I am so overwhelmed with emails that I can only do a handful of attachments at a time. I trained a secretary to help but she is limited on time too. I sort by most recently logged in assuming those not using it don't need this feature yet and won't complain.

Please help me understand how to make this php plugin work or a way to sort users to see who does NOT have an attachment but IS using moodle (enrolled in a course). I like Ger's auto attach when enrolling but don't know how to set it up either. Thank you for any help on the mass creation or assign parent module setup.

James Tinley
In reply to Justin P

Re: Importing Parents to Moodle

by Lael ... -

//Split apart supervisor table element
  $sup = explode(" ", $row_pull_name['supervisor']);

//Count array elements
  $sup_count = count($sup);
  
  //Save supervisors first name
  $sup_fname = $sup[0];
  
  //Save supervisors last name
  $sup_lname = $sup[$sup_count-1];

Justin - looking at this code, I was unsure of what was happening in the supervisor field. Is there a specific format required for the supervisor? eg: firstname lastname or similar?

Lael

In reply to Lael ...

Re: Importing Parents to Moodle

by Jamie Tinley -

Hi Lael,

Is your question also about using the mass parent creation for mentees?  If so, perhaps we can work together to figure out how it works.  Someone already made it and used it, so it must work if we figure it out.  I'm stuck on creating tables in the step below- do you know how to do that? I see database now in server props, but don't know how to add a table? I feel so close now.

==> ??? using ODBC or some other method create a table called parent_list which contains the parent and child usernames paired together as one record. The script assumes the field name are parent_username and child_username

CREATE TABLE `parent_role_assignments` (
  `parent_username` varchar(100) NOT NULL default '',
  `child_username` varchar(100) NOT NULL default '',

.

.

.

==> ??? pull in the data from your parent list table that contains parent_username and child_username\

In reply to Jamie Tinley

Re: Importing Parents to Moodle

by Lael ... -
Hi Jamie,

I will be looking at this with some others on Monday. Will let you know how we get along.

Lael
In reply to Lael ...

Re: Importing Parents to Moodle

by Marc Grober -
Been trying to get a handle on this (I missed this thread first time around) so here is what I have found to date as a bit of a recap.....)
http://moodle.org/mod/forum/discuss.php?d=106157&parent=467792
I also started a new thread in this forum because this thread, as is so often the case can get a bit convoluted, so its there if you want to use it....
Also posted it to Developers Forum
In reply to Lael ...

Re: Importing Parents to Moodle

by Jamie Tinley -
HI Lael,

Thanks - glad to know this is active again! I would love it to work, which it was working at least once before but just needs upgrading and instructions - they main part confusing me on Anthony's directions was directions to making an sql table in moodle. Thanks for working on this and replying.

James
In reply to Lael ...

Re: Importing Parents to Moodle

by Jamie Tinley -
Hi Lael,

what did you find out about making the mentees parent mass creation work in 1.9? Looking forward to your reply - please keep this moving forward! It seems so close if it already worked in 1.8 by Anthony come it can't work for 1.9. I need to learn PHP as I just can't take it any longer and would solve things myself but don't know anything except vba programming! Thanks for your expertise

James