Gradebook

Undo Overidden Grades in bulk

 
Picture of Chris Chapman
Undo Overidden Grades in bulk
 

Hi all,

I've done a bit of digging since my earlier post https://moodle.org/mod/forum/discuss.php?d=259922

and found that the grades are in an overidden state indicated by the orange. (2.5+)

1. Is there a way to undo this in bulk for an assignment or a number of assignments and students?

2. How do I disable this 'Over-ride' setting for future?

I have database access, if it comes to that...


Many thanks!




Picture of Bob Puffer
Re: Undo Overidden Grades in bulk
Plugin developersTesters

UPDATE mdl_grade_grades g SET overridden = 0
JOIN mdl_grade_items i on i.id = g.itemid
WHERE i.courseid = <ID FOR YOUR COURSE>


There isn't presently a way to turn off overrides though I wish there were.

Picture of Chris Chapman
Re: Undo Overidden Grades in bulk
 

Hi Bob, cheers for that, just tested on my Local 2.6 Install,  however I get a syntax error on line 2 (using Moodle Adminer)


any ideas?

I tried the command without the Join- therefore clearing all overridden in all courses which works fine, weirdly.

and tried <11> and = 11 to no avail (11 is my courseid)- I don't do SQL much- sorry if this is obvious!

 


Picture of Eric Strom
Re: Undo Overidden Grades in bulk
 

Chris,

You won't need/want the <> characters in the SQL statement

Have you tried quotes around your course id? "11"

Picture of Chris Chapman
Re: Undo Overidden Grades in bulk
 

yep tried that, still the same error, unfortunately are the tables different on 2.6 to 2.5?

Picture of Bob Puffer
Re: Undo Overidden Grades in bulk
Plugin developersTesters

Post your SQL again, Chris, there isn't any reason why this wouldn't work in any recent version.

Picture of Chris Chapman
Re: Undo Overidden Grades in bulk
 

still not working sad

UPDATE mdl_grade_grades g SET overridden = 0
JOIN mdl_grade_items i on i.id = g.itemid
WHERE i.courseid = "11"




Picture of Emma Richardson
Re: Undo Overidden Grades in bulk
Documentation writersParticularly helpful MoodlersPlugin developers

This is the script that worked for me.

UPDATE`mdl_grade_grades` LEFT JOIN `mdl_grade_items`

ON mdl_grade_grades.itemid=mdl_grade_items.id

SET overridden=0

WHERE mdl_grade_items.courseid = 37

Picture of Chris Chapman
Re: Undo Overidden Grades in bulk
 

worked a treat, Emma- many thanks!!!!

Picture of Bob Puffer
Re: Undo Overidden Grades in bulk
Plugin developersTesters

The key here is when you have a numeric field like courseid you can't wrap it in quotes