Flatfile by username instead of user ID?

Flatfile by username instead of user ID?

by Clark Moodler -
Number of replies: 1
I'm trying to find an easy way to enroll several already existing students into already existing courses - in large numbers, all at once.

Flatfile would seem to be the way, but I'm having problems with the "user ID" part. Is that supposed to be the # of the user that you seen when you click on a user's name and see their profile?

For example:
www.moodle.com/user/view.php?id=2653&course=1

So I would need to find that user ID for each student (2653) and put that in?

Wouldn't it be way easier if I could add students to courses in bulk with usernames instead of user IDs?

Or is this something that is meant to be used directly with the MySQL table? As an admin without table access, this would seem to be far easier if I could do this with user login names.

Thanks,
Clark

Average of ratings: -
In reply to Clark Moodler

Re: Flatfile by username instead of user ID?

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Is that supposed to be the # of the user that you seen when you click on a user's name and see their profile?

No, you need to specify the 'ID Number' of the user. That's a field you can fill by editing the user profile, with whatever information you want.

If you want to user usernames, just copy the username there. You can do this in a single go by executing the following database query:

UPDATE mdl_user SET idnumber=username;

Beware this will set the 'ID Number' for every single user in your Moodle site (including the guest and admin users).

Saludos. Iñaki.