Petr, while you're working on the gradebook, I'd like to bring up an issue with user report, considering groupings. The problem is that users can see items in their reports, which they don't have access to, as they don't belong to corresponding grouping. I've made a small patch to fix this, though I'm not sure it does its work completely and always correctly. I'm attaching it here. Would you please take a look at it and this issue? Thanks in advance.