Updating course activity and activity completion

Updating course activity and activity completion

by Thomas Barna -
Number of replies: 3
I have read about this in the forum somewhere but can't remember where.

1. What is best practice if I need to update an activity (module) to a new version (with new content) and need the completion status for that activity to be reset for all enrolled?

2. I have moved a number of courses from an old system to Moodle. How can I mark single activities (modules) as completed so that the new status reflects what we had in the old system? I don't want everyone to retake all courses from the beginning again.

Thanks,
Thomas


Average of ratings: -
In reply to Thomas Barna

Re: Updating course activity and activity completion

by Gary Lynch -

Hi

In answer to first point, i normally duplicate the content/activity-hide it- make changes needed then apply completion tracker to it. Hide old one. one thing to remember if you do this is that if you have any restrictions to complete before moving on the user will have to redo any following content.


Second point -  when moving old courses did you not bring over the enrolled users ? this would reflect on the new system if you had if not then enrolment would be blank as no users would have been transferred.


Gary

Consider rating if my post helps smile

Average of ratings: Useful (1)
In reply to Gary Lynch

Re: Updating course activity and activity completion

by Thomas Barna -

Hi Gary and thanks or your reply,

For the first point, that seems like a good option - thanks.

For the second point - no, that was a non Moodle system (based on ASP.Net and SQL Server). Unfortunately it was not possible to backup courses or user data. That's why I would need to manually update the completion status for each activity/module in Moodle.

My guess is that I would have to update 'mdl_course_modules_completion' but I don't know if there are more tables that need updating. Is it enough to set column 'completionstate' to '1' or do I need to update more columns and/or tables?

Thanks,

Thomas

In reply to Thomas Barna

Re: Updating course activity and activity completion

by Thomas Barna -

After some investigation I understand that 'mdl_course_modules_completion' is the table that needs to be updated.

I also understand that this table is only updated by Moodle when a user accesses an activity for the first time. If the user has not opened the activity there is no record in the table for that user/activity.

So I guess I have to run an INSERT statement on that table like;
INSERT mdl_course_modules_completion (coursemoduleid, userid, completionstate, viewed) VALUES (525, 35, 1, 0);

Can anyone confirm if I am correct in this? What about the timestamp (timemodified)? Is it added automatically by Moodle/MySQL? If not, what timeformat should be used?

Thanks in advance for any input on this.

// Thomas