简体   繁体   中英

when mdl_course_completion is updating in moodle

I am building a scheduler. This scheduler will check all users' course end date and send email to notify them to complete their course. But it should not send to those users who have completed their course. I am unable to track users' course completion record.

I found a useful link from https://docs.moodle.org/27/en/ad-hoc_contributed_reports to complete this. But found that in any case mdl_course_completion is not updating.

I just want to know that when mdl_course_completion is updating.

How can I complete the users' course and when mdl_course_completion is updating.

The course_completions table should update regularly if two items are set correctly:

  1. The course completion settings are set/saved for the course(s) you want to track
    • These settings are in the course settings menu for each course and are separate from completion settings for each activity/module in the course.
    • If you set completion rules for each activity/module, but not for the overall course, and then a student completes all the modules successfully, you can end up with data in your course_modules_completions table but no data in your course_completions table.
    • Learners/students must meet the course completion requirements.
  2. The Moodle cron command is setup correctly
    • For example, if you are running Moodle in Linux, the command is often added to the crontab file. If using a Windows server, you'd create a scheduled task.
    • When setup correctly, this fires a series of core Moodle tasks, including checking for new completions; it also will fire any custom tasks you have setup.
    • A quick way to check if cron is setup correctly is to look in Site Administration -> Notifications. If you see something like "It has been more than 24 hours since your last cron run" or something similar, that is a signal your cron is not configured correctly.

If these are both setup, the course_completions table should update with any new completions every time the cron command is set to execute.

Hope this is useful - good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM