Wednesday, January 14, 2015

Updating activity modules at a granular level in the DB....

I had a teacher tell me the other day that a student had an error, a sessionkey error, when submitting in a forum.  I have seen this happen more than once when THE FORUM is set for COMPLETION TRACKING.  We like the completion tracking feature, most of the time, gives students a sense of where they are in the course.  However - the setting is buggy in the Forum activity.

Look in the mdl_course_modules table to find the data for completion tracking settings at the course level.

I accessed the course in question and saw that completion tracking was still set for the forums in this course.  I thought I had set all the forums completion tracking off, site wide, using a script, but I may have chickened out while thinking about doing it.  Large, site wide updates, are just too risky.

I went into my snippets looking for the SQL that would allow me to look at the completion tracking settings for the forums in the course.

SQL to find course completion settings for forums:

SELECT * FROM dbname.mdl_course_modules
WHERE course = 1164 AND module = 7









Notice the 2 in the completion column, that is what I am after,  I will set them to 0.

SQL to update the records from 2 to 0
USE student;

UPDATE mdl_course_modules

SET completion = 0

WHERE course = 1164 AND module = 7
I could also accomplish the same thing by updating the completion tracking setting from the course page by turning on editing.....but that simply takes too long when there are a bunch of them.

No comments:

Post a Comment