Lost grade progress while updating to Palm

Sorry if I sound like a broken record, but I have to ask again: Have you tried to run the backfill command compute_grades as described here, on your new instance?

https://openedx.atlassian.net/wiki/spaces/AC/pages/755171487/Migrating+to+Persistent+Grading#The-Persistent-Grades-Backfill

My concern with generating stuff in your old instance and copying the data across is that it might have implicit assumptions about other data that should have been generated from the publish, e.g. links back to S3 stored files.

If you do something like this from the LMS:

python manage.py lms compute_grades -v1 --settings=production --courses {YOUR COURSE KEY}

Does that fill in values for those tables as you would expect? Or does it cause an error? After that command is run for a specific course, does downloading a grade report look like you would expect it to?

Where do the grades’ source information come from, to be calculated and put in the db? I.e. if it’s ultimately just coming from somewhere else, perhaps I should just be checking that somewhere else and whether it got copied over between servers, so that maybe the data could be re-computed properly? Because if that source data isn’t there, won’t future grade re-computes still be wrong if they’re currently computing zero grades on the new server?

There are at least a couple of inputs into this:

  • The Course Blocks API, which is where grades gets its “what does the content look like for this particular user”. The ultimate source for that data is in the ModuleStore (i.e. MongoDB), but this API builds its own representation of that data after every course publish. If you’re moving the data across instances, you should probably run the simulate_publish command from a Studio instance, so you can trigger it across all courses without having to edit each one through the UI.
  • The student’s state in courseware_studentmodule and the submissions_score table.

Running the compute_grades management command is supposed to then read from those and materialize all the students grade information into the grades_* tables so that future download tasks can read from that. So when you ask for a grade report, it should be reading purely from those tables and will make the assumption that if someone doesn’t have an entry there, it means they never did the content. (Every time a user submits an answer, it also triggers a celery task that updates those grades_ tables, particularly grades_persistentsubsectiongrade.) If the compute_grades command doesn’t fill in those tables, does it give some kind of error in its logs?

:slightly_frowning_face: Okay, that sounds like a race condition tried to shove duplicate data into that table for a particular (user, subsection) combination. I don’t know why it’s doing that.

1 Like