Undo Overidden Grades in bulk

Undo Overidden Grades in bulk

by Chris Chapman -
Number of replies: 9

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!




In reply to Chris Chapman

Re: Undo Overidden Grades in bulk

by Bob Puffer -

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.

In reply to Bob Puffer

Re: Undo Overidden Grades in bulk

by Chris Chapman -

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!

 

In reply to Chris Chapman

Re: Undo Overidden Grades in bulk

by Eric Strom -

Chris,

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

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

In reply to Eric Strom

Re: Undo Overidden Grades in bulk

by Chris Chapman -

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

In reply to Chris Chapman

Re: Undo Overidden Grades in bulk

by Bob Puffer -

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

In reply to Bob Puffer

Re: Undo Overidden Grades in bulk

by Chris Chapman -

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"



In reply to Chris Chapman

Re: Undo Overidden Grades in bulk

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin 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