Hi Alick. I just looked at the code. This sounds a bit weird to me. I am able to track down how you are getting the error (thanks for providing the debugging info). But I am unable to reproduce it. For me, it works as expected.
Does this happen for all students? Or just some particular student account? Can it be that the student account was previously given the teacher access to the workshop? Can you please provided detailed step by step description on how can the error be reproduced?
Thanks for reporting this David