difference in timing in completion reports

difference in timing in completion reports

by Giuseppe Panzarino -
Number of replies: 13

Hello to everyone  my name is Giuseppe and I work as system admin for my company. 

One of my duties is to manage the Moodle server i really like the system and how it works . but we have a strange discrepancies between the reports. 

I apologize if this has been already solved elsewhere but i was not able to find information on this topic.

As i stated in the subject there is a discrepancy in the completion reports. I cannot understand what causes this issue below you will find the differences (report is of coure regarding the same user and the same training)

Activity completion  3/2/2022 10:50 Completed 3/2/2022 10:52 Completed 3/2/2022 11:06 Completed (achieved pass grade) 3/4/2022 9:35
Course completion 2/03/22, 11:33 Completed 2/03/22, 11:33 Completed 2/03/22, 11:33 Completed (achieved pass grade) 9/03/22, 13:43 9/03/22, 13:43

I was not able to understand if this behavior is normal or did we setup something wrong in the system.

Thanks in advance.

Average of ratings: -
In reply to Giuseppe Panzarino

Re: difference in timing in completion reports

by Shirley Gregorczyk -
Picture of Particularly helpful Moodlers
How often is the Cron job running to course completion?
Completion marks as started
Calculate regular completion data
Kind Regards
Average of ratings: Useful (1)
In reply to Shirley Gregorczyk

Re: difference in timing in completion reports

by Giuseppe Panzarino -
Thanks for your reply.

The cron was set up to run every hour (server runs on Microsoft IIS) now it has been lowered to 5 minutes, if this was the reason it would fix the next sessions but i need to find a way to force a check on the one s that have been already submitted .

i do not want to mislead anyone but what I also noticed is that the date format between the two report looks different US format for the activity completion and Italian format for the course completion. My (not so) educated guess is that one reads the server timings and the other one the user PC timings if this is the case how could i solve it?.

Thanks again. Best regards
In reply to Giuseppe Panzarino

Re: difference in timing in completion reports

by Adolfo Mora -
Hi,

I have a similar problem to yours, in my case, the users completed the course weeks ago, however, the LMS decided to update all the completion times and now all activities and course completion time in the "Course completion report" do not match.

https://moodle.org/mod/forum/discuss.php?d=432911

Regards,
Average of ratings: Useful (1)
In reply to Adolfo Mora

Re: difference in timing in completion reports

by Giuseppe Panzarino -
Changing the cron scheduling to 5 minutes actually solved the issue for us, the new students who taken the course were tracked properly with of course 5 minutes of timing resolution that is acceptable for us even if we still need to find a way fix old attempts ( i am aware this might not be possible).

Basically to my understanding the activity progress is instantaneous while the completion runs at scheduled intervals. That 's why i saw the same timing in the completion reports on most of the activity they actually match the previous settings and actually we did not notice that the cron was not running before the first settings tweak.

Our systems runs on MariaDB.
In reply to Giuseppe Panzarino

Re: difference in timing in completion reports

by Randy Thornton -
Picture of Documentation writers
Exactly so. Cron sets the course completion times when it runs its process.

Another important thing to remember is that if a Teacher unlocks the course completions for any reason, usually to change the completion criteria, then all the previous completion times for the users are deleted. When cron runs next, it will recalculate those completions and give all those users NEW completion times. This new time may be days, months, or even years after the time the user actually completed the course.
Average of ratings: Useful (2)
In reply to Randy Thornton

Re: difference in timing in completion reports

by Giuseppe Panzarino -

thanks for the reply, actually is ok if the user losts all completion data (of  course if the affected student has to retake the course).

We actually need the completion timing to be as much as possible near to the activity tracking because we have some courses that need to be validated by state officers (specifically the ones regarding the worker safety) so we need to show evidence of the time spent on each section. 


Is it possible to erase completion data manual for a student that needs to retake a course? (for instance if the person volunteered to test it but the final version is different)


Many thanks in advance 

In reply to Giuseppe Panzarino

Re: difference in timing in completion reports

by Randy Thornton -
Picture of Documentation writers
If all you need to do is reset activity completion dates or some of the manual settings in the course completion (eg Manual approval by role), any teacher can do that in the Activity completion report or in the Course completion report, respectively. Just un check the varioius activity completion box.

If you need to do more than that, such as reset other criteria, there is currently not an easy way to do that. The Course Recompletion plugin that Adolfo mentions is excellent, but it is based on a schedule and only works on users that have completed the course already, so that they could retake it with a clean slate. You can't manually choose which user's completion data to delete using it.
In reply to Randy Thornton

Re: difference in timing in completion reports

by Adolfo Mora -
Correct,

I think in my case (https://moodle.org/mod/forum/discuss.php?d=432911) I am experiencing exactly the same as this other (https://moodle.org/mod/forum/discuss.php?d=406113) where the completion dates were changed with apparent no reason, I do also have a scorm and this has happen only to one course. I checked the course logs and course completion or activity completion has not been updated/changed.

After the dates were changed I have a mess in the course;

  • Activity completion and Course completion times for activities do not match ( I understand course completion time is created with a cron Job, which in my case runs every min, but I thought the "Course completion" would take the activities completion times from "mdl_course_modules_completion", but this is not the case).
  • If I update mdl_course_completions.timecompleted, it will update the course completion time, but the activities completion time in the "Course completion" report are still showing the old date, which does not even match the "Activity report" completion times. I wonder where do the "Completion report" takes the completion times for the activities.
I am preparing a query to update mdl_course_completions.timecompleted based on the "first" completion event shown in the course logs (mdl_logstore_standard_log).

I will share it when I tested it in case this happens to someone again. If you have any idea where do the "Completion report" takes the completion times for the activities, that will be very much appreciated, so I could update these as well to match the "Activity report" times.

Regards,
In reply to Adolfo Mora

Re: difference in timing in completion reports

by Hal MacLean -
As far as I know, and I could be wrong, the activity completion will be set at the date/time the actual activity was completed. The course completion is set at the date /time the cron job ran, and evaluated the student's activity completions as meeting the course completion criteria. Therefore, the activities may complete at different times to the course, and if Cron is running every ten minutes or so then it will be later than the activity completion settings by around that time.

However, it could be very different if the completion criteria has been adjusted manually - unlocked, and reset, for example. In this case, the course completion will be evaluated once you've saved the new settings, and all the data relating to completions prior to that will be lost (in the course completion, at least). The activity completion data will not change, so you could end up with all activities completing way before the course is complete, if the course completion was later unlocked and changed.

If you do not unlock course completion and it is not showing a date/time close to when all activities or requirements are met, then check your Cron jobs. It's possible that Cron is set to run at a different time to the default, or that it is not running at all...
In reply to Hal MacLean

Re: difference in timing in completion reports

by Adolfo Mora -
Thanks Hal,

I do think you are right in all you mentioned, in my case, the course completion was not changed and the cron job is running every 1 minute.

We have seen this problem when we have courses with a large number of users (+5000). For far it has happened twice and we do not know why.

I opened this thread -> https://moodle.org/mod/forum/discuss.php?d=432979

Thanks,
In reply to Randy Thornton

Re: difference in timing in completion reports

by Randy Thornton -
Picture of Documentation writers
By the way, what I have said here is only one particular use case.

Actually, the course completion calculates do often try to save the times according to one of the criteria for the course completion, including grabbing the latest activity completion. If you are using only activity completion criteria, it usually does this - from what I have seen. So, sometimes the course completion data is the same as the most recent activity completion date.

But there's a lot of other possible criteria too. It saves most of those times in a special table for things that otherwise don't have dates (course_completion_crit_comp). Exactly which dates it grabs for this this and when it uses the cron time, it a bit of a mystery as Adolfo says above.

If someone figures it all out, I hope they post it here.