Downloaded grader report contains duplicate rows for some users

Re: Downloaded grader report contains duplicate rows for some users

by Craig Meltzer -
Number of replies: 0
Hi Mat,

The problem was with the Role assignments in the course. I don't know how it occurred in the first place, but I was able to cleanup the database by removing a particular set of rows from mdl_role_assignments.

On my installation the duplicate role was for any user who had a mdl_context.contextlevel of 40.

So when I ran the sql below, I could get a handle on all the offending rows:

SELECT * FROM `mdl_role_assignments` AS mra
WHERE mra.contextid
IN (SELECT id FROM `mdl_context` AS mc
WHERE mc.`contextlevel` = 40)

I then deleted them (after testing several times) and the reports were fine.

Good luck!
Craig