EsupPortail / esup-mod_rocketchat

Interface between Rocket.Chat and Moodle
Other
8 stars 4 forks source link

new student accounts are not created in rocketchat room #117

Open ali-alhaidary opened 3 years ago

ali-alhaidary commented 3 years ago

When a teacher creates a new room instance in his course, and enters this room, Rocket.Chat plugin does not create accounts for students that enrolled after creating this instance unless the teacher adds these new (student) role manually in (Assign roles) of that instant in his course although the option of creating new student accounts in the plugin is set to 'Yes'.

goyome commented 3 years ago

When creating a new room instance, the teacher account is synchronized immediately to let him write in the newly created channel. Student accounts, on the other hand, are created asynchronously through cron. I believe this is the reason you didn't get to see those immediately after creating the new room instance. Could that be the reason of the problem ?

ali-alhaidary commented 3 years ago

Thank you, however, I waited for several minutes and no users were added. I will create new course with students and test again, cron runs each minute.

ali-alhaidary commented 3 years ago

After upgrade to 3.18, even the old created rooms are not accessible with 'No private group with name' error

ali-alhaidary commented 3 years ago

we had to re-create rooms

goyome commented 3 years ago

I'm sorry, but I'm a bit lost. I will recap what I understood. Please tell me what I get wrong to fully understand where could be the origin of the problem.

Concerning the original question, I understood that when a student join a course after the creation of the RC instance, he won't be added to the channel because he doesn't have the "student" role in the course. But if that's the case, I don't understand how student already in the course had the role assigned. Whatever, it's possible to define, globally and by instance, which roles will be users or moderators in the settings. If "student" role is not working for you, you can set other roles.

Concerning your last comments, the error 'No private group with name' can occur if the user you're logged in with is not authorized to see the room. To be sure that the channel doesn't exist in RC, you need to use either the account of the API (which is by default owner of every room created) or an admin account to check in the list of all the rooms if this specific room exists. If the room exists, then the problem occurs when adding users to the room. But I don't see how re-creating the rooms will help. When you say re-create, do you mean delete the module and create another one ?

By chance, do you have any log in moodle or rocket.chat ?

ali-alhaidary commented 3 years ago

I'm sorry, but I'm a bit lost. I will recap what I understood. Please tell me what I get wrong to fully understand where could be the origin of the problem.

Sure

Concerning the original question, I understood that when a student join a course after the creation of the RC instance, he won't be added to the channel because he doesn't have the "student" role in the course. But if that's the case, I don't understand how student already in the course had the role assigned. Whatever, it's possible to define, globally and by instance, which roles will be users or moderators in the settings. If "student" role is not working for you, you can set other roles.

Yes, roles are assigned correctly

Concerning your last comments, the error 'No private group with name' can occur if the user you're logged in with is not authorized to see the room. To be sure that the channel doesn't exist in RC, you need to use either the account of the API (which is by default owner of every room created) or an admin account to check in the list of all the rooms if this specific room exists.

I did that, and rooms were there.

If the room exists, then the problem occurs when adding users to the room. But I don't see how re-creating the rooms will help. When you say re-create, do you mean delete the module and create another one ? Yes, I deleted the instance, and created new ones for almost all courses, and for that all previous chat was lost.

By chance, do you have any log in moodle or rocket.chat ?

Sure, but it is so big, you need to tell what should I look for please.

goyome commented 3 years ago

As rooms were there, you should look for errors when adding users to the rooms. I don't have a specific pattern of error to give you.

But I still don't understand how users can be added when they already were members of the course but new ones were not added. It seems more like a problem when triggering during the access to the course. Maybe we forgot a trigger linked to the way students are added to the course in your case. Could you describe how problematic students were added to the course ? Did they auto-join ? With a key ? Were they added by a teacher, an admin,…