Users insertion in Class though CSV didn't work anymore
The example file (CSV or XML) don't have the field 'ClassName' anymore: it existed before 1.9.0 and was very useful to register hundreds of users in their class in one click...
I checked /main/admin/user_import.php, but couldn't find where to add the field.
Insert user csv in platform in a class (usergroup) with class id - ref #6680
Updated by Hubert Borderiou almost 8 years ago
I put a field ClassName at the end of the sample csv file we can download
LastName;FirstName;Email;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;Courses;ClassName Mcfly;Marty;email@example.com;marty;secret;platform;12345678;001-123-456-789;user;COURSE1|COURSE2|COURSE3;plop Brown;Emmert;firstname.lastname@example.org;emmert;;platform;;;teacher;COURSE2;plop
I always have the error
Ce nom de classe n'est pas disponible: marty (Marty Mcfly) Ce nom de classe n'est pas disponible: emmert (Emmert Brown)
Moreover, I dont think we should use the ClassName.
We should use the Class ID.
Because the ClassName may contain characters " or ' or ; ...
It works if I use the sample csv file
LastName;FirstName;Email;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;Courses Mcfly;Marty;email@example.com;marty;secret;platform;12345678;001-123-456-789;user;COURSE1|COURSE2|COURSE3 Brown;Emmert;firstname.lastname@example.org;emmert;;platform;;;teacher;COURSE2
Updated by Yannick Warnier over 7 years ago
- Category set to Classes
- Status changed from Needs testing to Assigned
- Assignee set to Hubert Borderiou
- Priority changed from High to Normal
- % Done changed from 70 to 50
We need some kind of closure here. The current fix is not enough and there are missing visual pieces to fix the item mentionned by Hubert.
Updated by Hubert Borderiou over 7 years ago
- Status changed from Assigned to Needs testing
- Assignee deleted (
Add functionnality to insert users in the platform with csv registerd in class (usergrou) with class ID
You can see ClassId in the Classes amin tool.
Updated by Julio Montoya over 7 years ago
- Assignee deleted (
When you add a user to a class (usergroup) you're registering the user to the session and courses automatically (that's the idea of using a class).
So instead of using the new custom "$usergroup->addUser()" the function that should be use is "$usergroup->subscribe_users_to_usergroup()".
I sent this change: