Going mad!! Trying to assign tutor to students! HELP!!

Going mad!! Trying to assign tutor to students! HELP!!

by Dan Jeffries -
Number of replies: 19
Sorry for my OTT plea but I really am going maaaaaaad!

OK - here's the situation.

We are using the PLP block and, in order for tutors to edit the Personal Reports, they have to be assigned as 'Teacher' to the User in User context.

However.

When I have asked Teachers to do this, there is no ROLES tab, and therefore they can't do it. They're using the participants block and then clicking on each student.

As they can't do it, does this mean, as an Admin, I have to assign ALL these roles? This is something I really really REALLY don't want to have to do, as I run 8 other Moodle sites!

Really hope someone can help!

Dan
Average of ratings: -
In reply to Dan Jeffries

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Mike Worth -
This is something I wrote a script to do (from a csv file); with a bit of modification it should suit your needs. Let me know if this would be useful and I'll find you a copy

Mike
In reply to Mike Worth

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Dan Jeffries -
Yes please - that would be ace!

Many thanks smile
In reply to Dan Jeffries

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Mike Worth -
Here is a copy of the current version- it was one of the first bits of moodle related code I wrote, and as such is horribly inefficient and needs re-writing. I've put rewriting this as a block on my todo list

Mike
In reply to Mike Worth

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Mike Worth -
I've re-written it into a block, can be downloaded from here. Moodle Tracker issue CONTRIB-1025

Mike
In reply to Mike Worth

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Dan Jeffries -
Thanks SO much for your work on this - looks great!

I've installed the block and can see it on our front page.

I want to test out the CSV file.

Think I understand the format, e.g.

4,20
4,21
4,22

etc

However - how can I find out the ID numbers of an entire course without manually searching each one and hovering over their profile image?

Thanks!

EDIT: Created a CSV file with two columns - one with tutor number, one with student number. Clicked submit, opens new tab but doesn't display anything. Go to check students profile > roles and nothing assigned.

Any ideas?
In reply to Dan Jeffries

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Mike Worth -
I assume you are using the users 'id' field, not the 'idnumber' field- id is internally created by moodle whereas idnumber can be set externally. We imported our users from our MIS, the idnumbers being the id in the MIS person table. This means that we can export the csv file from the MIS.

If you are simply looking for a quick way to do it, don't have any other system with unique idnumbers for the users, and have commandline mysql(this'll probably work with other databases but no guaranties) then you can use
'update mdl_user set idnumber=id;'
to set everyones idnumbers from the internal moodle id field, then
'select firstname,lastname,idnumber from mdl_user where deleted=0;'
order by lastname
will print a list of all current users and their idnumbers, in alphbetical order

Mike
In reply to Mike Worth

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Jamie Tinley -
Hi Mike,

I am having the same problem with uploading csv names to your tutoring block. I originally used ID numbers from Moodle PHPmyadmin export. Then I tried to create two id numbers in their profile field but that did not work either. Do I need a heading? I'm just using a text file with 1,2 for testing your block out. I really appreciate you writing the tutor block as it will be a great help. I'm also wondering if you have plans to have your block delete mentee/mentor relationships that have expired? that would be nice as ours change all the time.

Thanks for any input that can help me make your csv uploading work.
Here is my errors:

Warning: require_once() [function.require-once]: Unable to access C:\/usr/share/moodle/config.php in C:\moodle\moodle\blocks\tutorlink\process.php on line 4

Warning: require_once(/usr/share/moodle/config.php) [function.require-once]: failed to open stream: No error in C:\moodle\moodle\blocks\tutorlink\process.php on line 4

Fatal error: require_once() [function.require]: Failed opening required '/usr/share/moodle/config.php' (include_path='.;C:\moodle\php\pear\') in C:\moodle\moodle\blocks\tutorlink\process.php on line 4


James
In reply to Jamie Tinley

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Jamie - I replaced the incorrect require_once with a relative link to config.php and committed to CVS. Once the new file regenerates it should be fine. Replace line 4 with:

require_once('../../config.php');

and it should work for you. Peace - Anthony
In reply to Anthony Borrow

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Mike Worth -
Thanks for sorting that- I must have been half asleep or something when I wrote that bitblush
In reply to Anthony Borrow

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Jamie Tinley -

Anthony and Mike,

Thank you thank you thank you

replacing line 4 with your fix above in the block tutor link worked perfectly.

James

In reply to Jamie Tinley

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers

Are there new developments of this module?

As I understand from the documentation I need a csv file which has the tutor ID and student ID.

I hope this is the useraccountname, not the user ID. Can someone confirm this?

What I want is not this: tutor idnumber,tutee idnumber, action; (as stated in the documentation) but I want usernameteacher, username student, action

In reply to Richard van Iwaarden

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Jamie Tinley -
Hi Richard,

It's the ID number - sorry about that. I use an import csv file to update all users so that field has a number. I don't think Mike will change it to username but you can ask him.

Take care,

Jamie
In reply to Jamie Tinley

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Patrick Daly -
How often is the cronfile run?

Am I able to change it or does it automatically run every night or something?
In reply to Patrick Daly

Re: Going mad!! Trying to assign tutor to students! HELP!!

by tony chesney -

"The primary Moodle script that does all this [runs predefined tasks on a computer at regular intervals] is located in the admin directory, and is called cron.php. However, it can not tell itself to run, so you need to set up a mechanism where this script is run regularly (eg every five or ten minutes). "

from http://docs.moodle.org/en/Cron

If you don't know how to set this up, you probably have a systems admin person who does.

Have you put this question in the right thread though?  It doesn't seem to follow the previous discussion.

In reply to Richard van Iwaarden

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Paulo Gingao -
Hello, did you find a way to use the idnumber or the useraccountname on this?

Thanks
In reply to Dan Jeffries

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Mark Olson -

Any chance that this can be altered to work with ID's that have periods in them? 

ex: parent.john.doe, jane.doe, add

It seems that it disregards the period and turns it into: parentjohndoe, janedoe, add

Thanks

In reply to Dan Jeffries

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Garrett Gunderson -
Hello everyone,

I recently installed this block on a test instance of Moodle, and for the life of me I can not make sense of the external database part of the CSV form. No matter what I put in the Mentor ID# it always returns with "Tutor not found("Mentor ID# here")".

I guess I am not understanding the concept of the external database, and was wondering if someone would kindly post a small example, working CSV file that works successfully. I would really appreciate it!

Sincerely,
Garrett Gunderson
In reply to Dan Jeffries

Re: Going mad!! Trying to assign tutor to students! HELP!!

by Alick Brown -

I'm trying to use 'Tutorlink' block on a Moodle 2 set-up - but it's not working.

1.Notifications said it was installed, settings are in Admin, but Cron.php produces this error:

Processing cron function for tutorlink....Cron file doesn't exist.
done.

2. 'Upload tutor relationships' does not appear in'Add a block' pull-down.

I've tried a fresh install.

Any ideas?

Many thanks

Alick Brown