Teacher can't switch role to "student view"

Re: Teacher can't switch role to "student view"

by Karsten Roemke -
Number of replies: 0

Hi, that was the problem on my moodle site too.

I do the following steps to solve it.

SELECT * FROM mdl_role_capabilities WHERE capability LIKE '%moodle/site%doany%'

this leeds to 3 entries:

id contextid roleid capability permission timemodified modifierid
7 1 1 moodle/site:doanything 1 1166636368 0
19828 9997 221 moodle/site:doanything 1 1201871265 2
21038 8813 5 moodle/site:doanything
1 1209382633 28

(timemodified is maybe false, cause I changed the entry with roleid 5 often to reproduce the effects).

I do:

UPDATE mdl_role_capabilities SET capability ='moodle/site:doanything STRANGE error in switch role to student' WHERE id=21038

that solves the problem, but does not explain anything.

If I do the select in a fresh install, then I get:

id contextid roleid capability permission timemodified modifierid
8 1 1 moodle/site:doanything 1 1288857153 0

I don't now, if I have to change the entry with ID 19828

does anybody understand the system.  smile

Thanks to Sergio - he gives the most important hint for me.