Not really a student or a teacher?!?!?!

Not really a student or a teacher?!?!?!

by Marc Hermon -
Number of replies: 10
I think I understand all the assigning roles stuff but in our new Moodle which we set up I have one teacher that shows up as a teacher and a student in every course that ever gets created. However, he's not really a student or a teacher in any of those courses. When I click on his name in the roster list it says he is not an enrolled student. And although he is listed as a teacher he can't do anything as a teacher in the courses. However if some student emails the teacher in the course he will receive those e-mails. I am at my wits end with this annoying problem. I have poured over the database tables but to no avail. Any ideas?
Average of ratings: -
In reply to Marc Hermon

Re: Not really a student or a teacher?!?!?!

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
If you go to site administration>users>permissions>assign system roles does he appear in the list of teachers and students? If so ,take him out.
In reply to Mary Cooch

Re: Not really a student or a teacher?!?!?!

by Marc Hermon -
No. He does not appear in any places where I can assign him roles. I originally had a problem because he was in our system with two usernames and so I deleted his other username. I don't know if that has contributed to this or not.
In reply to Marc Hermon

Re: Not really a student or a teacher?!?!?!

by Robert Brenstein -
Deleting user should be removing him from everywhere. Another place to check is whether that person is not assigned the teacher and student roles in the context of course category. Such an assignment would also cascade into any courses in the course tree below.
In reply to Robert Brenstein

Re: Not really a student or a teacher?!?!?!

by Marc Hermon -
I have been contemplating for a long time whether to delete him and then put him back in. I have given him the role of teacher in a Trig class and he has done some work in there so what are the ramifications of deleting him and then putting him back in?
In reply to Marc Hermon

Re: Not really a student or a teacher?!?!?!

by Robert Brenstein -
Whatever he did in a student role will be disconnected from him. However, once he gets a teacher role in that course, he will be able to access all what he did before as teacher. Note that you will need a new username for him.
In reply to Robert Brenstein

Re: Not really a student or a teacher?!?!?!

by Josh Whitver -
Hello,

I'm the IT manager for the Moodle install that Marc's talking about.

Can you give any more details about where we'd find the course category roles?

Also, you mentioned that if we just deleted him, he'd need a new username later on -- this isn't possible, unfortunately, since our Moodle usernames are tied to our LDAP database.

The problem seems to have originated from the fact that he logged in using a username that's a "secondary" username on our LDAP server, instead of his primary username. For whatever reason, Moodle just doesn't seem to handle non-primary usernames correctly, so if a teacher's (or student's) account on our LDAP server has more than one username associated with it, we've found that they have to be very careful with which one they use when logging in to Moodle.
In reply to Josh Whitver

Re: Not really a student or a teacher?!?!?!

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Hi. In terms of where you would find the course category roles, go to a category and top right you will see an assign roles link -if you click on it, it will show you the list of users with roles in that category.
As admin for example go to
http://YOURMOODLE.co.uk/course/category.php?id=1
where 1/2 etc are the course IDs
In reply to Mary Cooch

Re: Not really a student or a teacher?!?!?!

by Josh Whitver -
Thanks! I looked through all the categories, and this phantom account isn't assigned any roles within any of them.

Is there an SQL table somewhere that we should be investigating? I'm guessing we've just run into a bug somewhere, and the UI for Moodle probably isn't going to yield the final solution.
In reply to Josh Whitver

Re: Not really a student or a teacher?!?!?!

by Robert Brenstein -
To inspect role assignment directly in the database, go to Administration > Server > Database and check the table mdl_role_assignments, searching for the userid of your user. roleid will tell you the role and contextid will tell you where the assignment is done.
In reply to Josh Whitver

Re: Not really a student or a teacher?!?!?!

by Robert Brenstein -
As you probably know, when deleting users in Moodle, normally, they are just flagged as deleted but their record stays. It is, of course, possible to go and change the username directly in the database to free it for re-using. I am also not sure how LDAP plays in here since we don't use it.

You may want to bring the LDAP issue in the authentication forum. There are lots of LDAP experts there.