At the end of last year I ran into a small problem relating to the Course Completion settings for the courses on a Moodle site.
All the active students on the site had to complete all the courses by the end of the year. This was working correctly for some course, but not for others. The administrator wanted to know why this was happening.
The answer is really pretty simple – take a look at your Course Completion settings. To help the client I created a report that shows the Course Completion settings for all the courses in their Moodle site. This allows the Administrator to keep an eye on the settings for the various courses being created on the site. The report is not very complex, but did allow the client to quickly pin-point where the problem was. A hyperlink on the course name links directly to the course completion settings for that particular course.
The problem the client had with the courses not being marked as complete, was the AND/ANY setting in the General section. I have this indicated in the Method column of my report.
Most of their courses have a single SCORM activity. They also allow a Manager or Teacher to mark a course as complete. The solution is pretty obvious when you think about it, but sometimes we miss the obvious in search of a bigger problem. Also, if you don’t collapse that section in the Course Completion settings page, you’ll miss it.
As a rule when I come across this problem, I not only check the settings, but I also manually run the cron job. Sometimes the work has been done, but the cron has not run to update the site.
While building the report I dug a little deeper into the Course Completion settings and also looked at the database where these settings are saved.
The image below shows the relationship between some of the tables used for course completion.
I found that a key table and column to consider was the mdl_course_completion_criteria table, and the criteriatype column in that table.
This column stores values ranging from 1 to 8. The table below shows what each of those values represent.
|7||Manual completion by others
1 – Manager
2 – [Course Creator]
3 – Editing Teacher
4 – Non-editing Teacher
|8||Completion of other courses
1 – All
2 – Any
If we were to look at a single course stored in this table, we would see the results as shown in the image below.
Here we can see that the two criteria type are 4 and 7. Based on the table above we can see that it is an Activity and a Role. Reading across to the right we can then also see that the type of activity is SCORM and the role has a value of 1.
Some of these criteriatype have additional conditions like AND and ANY. These values are stored in the mdl_course_completion_aggr_method table
If we look at the image below we see in the method column a value of 2 and nothing in the criteriatype column. The 2 indicates to us that the General condition setting for the course is ANY. If the value had been a 1, it would have been ALL.
You will also see values for the different criteria type and these link directly to the table above. The default value for activities is ALL (1). If we had more than one activity in a course, but only required one to be completed, then the method value may have been a 2 – ANY.
You can take a look here: https://docs.moodle.org/dev/Course_completion, if you would like to dig further into Moodle’s Course Completion settings.