Moodle

create a cleanup script for thousands of bogus grades created by incorrect code in gradebook formulas

Details

  • Type: Task Task
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: STABLE backlog
  • Component/s: Gradebook
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

see linked bug for details, the problem is that we do not really know who is "enrolled" into course
We are either risking data loss or the script would be painfully slow.

Issue Links

Activity

Hide
Wilson Camilo Uribe Neira added a comment -

I have a moodle 1.9.3 with a myisam grade_grades table of 1.188.739 rows and grade_items of 2.307 and this is killing my performance.

What is the status of this task?
How can I help to close it?

Pdt: I try changing grade_grades to innodb but my performance get worst

Show
Wilson Camilo Uribe Neira added a comment - I have a moodle 1.9.3 with a myisam grade_grades table of 1.188.739 rows and grade_items of 2.307 and this is killing my performance. What is the status of this task? How can I help to close it? Pdt: I try changing grade_grades to innodb but my performance get worst
Hide
Petr Škoda (skodak) added a comment -

First of all nobody should have 1.9.3 on any production server.
The clenaup problem is we do not know who is actually enrolled in each course in 1.9.x, you can adapt the patch above, but it is just guessing.
In 2.0 it is much much easier to cleanup the grades tables. I am personally not working on gradebook code at all, hopefully somebody else will do it.

Petr Skoda

Show
Petr Škoda (skodak) added a comment - First of all nobody should have 1.9.3 on any production server. The clenaup problem is we do not know who is actually enrolled in each course in 1.9.x, you can adapt the patch above, but it is just guessing. In 2.0 it is much much easier to cleanup the grades tables. I am personally not working on gradebook code at all, hopefully somebody else will do it. Petr Skoda
Hide
Jonathan Champ added a comment -

These don't seem like real grades:
SELECT g.*
FROM mdl_grade_grades g
JOIN mdl_grade_items gi ON g.itemid = gi.id
JOIN mdl_course c ON gi.courseid = c.id
JOIN mdl_context x ON c.id = x.instanceid AND x.contextlevel = 50
LEFT JOIN mdl_role_assignments ra ON (g.userid = ra.userid AND x.id = ra.contextid)
WHERE ra.id IS NULL AND g.timemodified IS NULL AND g.usermodified IS NULL AND g.overridden = 0 AND g.feedback IS NULL

Show
Jonathan Champ added a comment - These don't seem like real grades: SELECT g.* FROM mdl_grade_grades g JOIN mdl_grade_items gi ON g.itemid = gi.id JOIN mdl_course c ON gi.courseid = c.id JOIN mdl_context x ON c.id = x.instanceid AND x.contextlevel = 50 LEFT JOIN mdl_role_assignments ra ON (g.userid = ra.userid AND x.id = ra.contextid) WHERE ra.id IS NULL AND g.timemodified IS NULL AND g.usermodified IS NULL AND g.overridden = 0 AND g.feedback IS NULL

People

Dates

  • Created:
    Updated: