Open abias opened 3 years ago
Hi @rlorenzo and @jrchamp ,
I have been thinking about this issue and have had to see that there are several obstacles.
mod_zoom does not decide which widgets to show based on the Moodle course role or Moodle capabilities. It decides based on the fact if I am a Zoom host / alternative host or not. Because of that, the standard procedures to handle an active role switch do not work here.
Additionally, the Moodle role switch feature just switches the Moodle course role. It does not change the Moodle user. Thus, if I switch the role to the student role, I will still be the same user and as this use I will still be the meeting host.
I still think that the current behaviour is at least unexpected for teacher, maybe it could even be called wrong. But I think there are at least three distinct ways to improve this:
The easy way: On view.php, we test if the user has switched his role. If yes, we pretend that he is another user and not the host user anymore and show only widgets for non-hosts.
The even more simple way: On view.php, we test if the user has switched his role. If yes, we just show a notification banner at the top of the page and inform the user that the role switch does not have an effect on this page.
The complicated but understandable way:
@rlorenzo and @jrchamp , what do you think, which approach would make most sense to you or do you have other proposals?
Option 1 seems like the simplest. In the two places where we calculate $userishost
/ $userisrealhost
, we can check the if there is a roleswitch in progress (and thus, set those to false).
The other idea that I've been considering for a bit now is removing the special treatments for $userishost
and instead using Moodle's permissions. This seems like "the Moodle way" of doing things, but I wonder what kinds of problems we might cause with that change.
Looks like function is_role_switched($courseid)
is the correct function to use for detecting a role switch.
Steps to reproduce:
Expected result:
Actual result:
As this can disturb teachers, I would propose to fix this flaw.