populating grader report by editing the database

populating grader report by editing the database

by Billy Zwiener -
Number of replies: 8

What table in the database is the grader report populated from? Is it mdl_grade_grades or is there a combination of tables, none of the above?

I am attempting to populate and update my grades by importing select tables into my 2.3 database. I am not being very successful but it seems theoretically this would work. Does anyone have any insight on this? Thanks.

In reply to Billy Zwiener

Re: populating grader report by editing the database

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

You would have to work with grade_items as well as these two tables cross reference.  Might be tricky if you already have the assignments imported because the grade items will have different ids to your actual grades.  Can't you just import the courses with grades attached?  

In reply to Emma Richardson

Re: populating grader report by editing the database

by Billy Zwiener -
Emma, that might be the appropriate route to take. I didn't know of that option nor did I know it was the appropriate action to take since all my courses exist fine. They simply aren't up to date with the grades of current students that were taking the course while I was in development on the course.  I tried to import just the gradebook but because the courses were in progress when I imported them it had blank entries in some quizzes, thus those updated null fields then became "set" and when a student continued to take the course the zero grade overrode their attempt no matter how well they did. It would cause me to have to manually tell the grade book to allow the grade to be overridden for many many many grades. If importing the course with grades seems like it would get around this issue and get my current students in my 2.3 upgrade it would be wonderful! The students are all there, the courses are all there, I just need up to date records of their grades in between the two weeks I developed the 2.3 upgrade to work. I am pulling this from a 1.9 install. If that seems like the appropriate action to take please let me know. Thanks so much.
In reply to Billy Zwiener

Re: populating grader report by editing the database

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

If you have complete courses with grades up to date, then, yes, it would make sense to import the courses with the users and the grade history from your 1.9 instance.  However, it sounds like you now maybe have some grades in the 1.9 instance and some in the 2.3 or maybe I am confused?!  Did you recreate the course in 2.3 from scratch or did you import it from 1.9?  Did you bring the users across that way?

If you can, I recommend exporting the 1.9 course with users and grades selected in the export process and then using the course import to import the entire thing into 2.3.  I haven't actually done this from 1.9 to 2.3 before but it is my understanding that you can bring across courses to 2.3 now with little trouble.

If for some reason this doesn't work, there are sql scripts that allow you to set all grades to not overridden so that might solve your empty quiz grades.

In reply to Emma Richardson

Re: populating grader report by editing the database

by Billy Zwiener -

You're not confused and what you say makes sense smile I do in fact have grades that match from the 1.9 that are sitting on my 2.3. The problem is they aren't up to date anymore. When I upgraded from 1.9 to 2.3 it took me about a week to get the upgrade to work smoothly. This meant that there was a week difference between my grade database and the the now new 2.3 as people continued to use the 1.9 site while I developed the 2.3 instance. So now the 2.3 instance is ready to go BUT if I throw my students on it they are all in different places than what is actually represented in the 2.3 (using a dated but functioning 2.3 databse). (They are all still using the 1.9 as I speak and the 1.9 is up to date with their grades). The 2.3 went through so many database changes I can't just throw that database into the 2.3 one (as far as I know).

Anyway, I'm going to try to export the course data in the course backup button in the 1.9 and try to import it into 2.3. At least I havent tried that yet smile Thanks so much.

BTW. To answer your question. I didn't recreate the course in 2.3 from scratch. It successfully upgraded from the 1.9 after I figured out a smooth way to do it. The users were the same. It was a one peice deal when the upgrade finished. Only problem is the difference in grades from an older date to what is currently accurate.

In reply to Billy Zwiener

Re: populating grader report by editing the database

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, so when you import, I would suggest importing as a new course - don't try and merge - I am concerned you will run into conflicts between the upgraded version and the old version.  

In reply to Emma Richardson

Re: populating grader report by editing the database

by Billy Zwiener -

Uh oh... 

Backup and restore from 1.9 to 2

Courses created in 1.9 can be backed up and then restored into a 2.1 Moodle or later but blocks are not currently restored and nor is user data (such as forum posts, grades, submissions etc)

 

So I guess this route is out of the question. Looks like I need to look into these scripts you speak of. Thanks.

In reply to Billy Zwiener

Re: populating grader report by editing the database

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dang it - I wasn't sure on that - sorry!  

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 = put your courseid number here

This script will just work on individual courses, I prefer that to setting all grades to be unchecked as you might have some that you have purposely overridden.  This will uncheck every grade in the course, so be aware of that!

In reply to Billy Zwiener

Re: populating grader report by editing the database

by Debbie Unterseher -

If it is just the quizzes that are causing problems, you could click the "Regrade quizzes" option for each quiz.


I just got done doing the script that Emma mentioned below (to set overridden to 0) because all of my grades were overridden.  However when I did that script, the quiz grades were still not showing for some students in the gradebook, and so doing the "Regrade quizzes" option worked.  Luckily it was for only one or two classes!