Students can't edit if groups are used. It doesn't matter if group mode is "Separate" or "visible" Students can edit only if there are no groups in Wiki. It works when a teacher uses "Login as" button.
I didn't try to change the code but now it works.
How do you configure to let students edit a wiki? I have my classes set up in groups so can either use the set-up fo teachers or individual. They are already grouped.