Here's the scenario. If you have a certification set up, with a recertification window that comes up automatically, then when the recert window opens, Totara should clear the course and activity completion records for the cert's requirements. Specifically, it "archives" them.
The problem is, that for OJT this does not work correctly. After the recert window opens, the activity completion gets cleared correctly, but the course completion does not.
Replication
In brief:
Set up an OJT activity, with activity completion and course completion
Set up a certification that has the OJT activity's course as a requirement
Make the certification have a recertification window that opens up some time after certification
Have a user complete the activity (and thus the course, and thus the certification)
Wait for recertification (or turn the clock forward to cause recertification to be triggered)
Expected result: Totara has reset the user's certification, activity completion, and course completion status.
Actual result: Totara has reset the user's certification and activity completion. But course completion is not reset.
In detail:
Creating the course, activity, and certification
Do a clean install of Totara, with the mod/ojt plugin installed.
Create a test course
Add an OJT activity to the test course, with activity tracking enabled.
In the activity settings go to the "Activity completion" section
Tick "Show activity as complete when conditions are met"
Tick "All required topics are complete and, if enabled, witnessed"
Enter the OJT activity and add at least one topic, and at least one required topic item.
Enable course completion for the course
In the course go to "Course administration -> Editing settings -> Completion tracking"
Set "Enable completion tracking" to "yes"
Set "Due date" to "none"
Go to "Course administration -> Course completion"
General
Select "Course is complete when ALL conditions are met"
Condition: Activity completion
Tick the box next to your activity
Create a test learner user
Enrol the learner user in the course with the learner role
Create a certification
Site administration -> Learning -> Certification
Add new certification
Leave all settings (except the name if you want) on default
Click on "Content" tab
Certification Content
Add a new set of courses
Set "Minimum time required" to "No minimum time"
Click "Add course" and add your course
Recertification Path
Tick "Use same..." checkbox
Click save
Click on "Certification" tab
Active period
Certification is active for: set to 3 days
Recertification window
Period window opens before expiration: set to 2 days (must be less than the certification period)
Click on "Assignments" tab
In "Add..." menu, select "Individuals"
In the popup, pick your user and add them
Trigger completion and recertification
Log in as admin
Go to the test OJT activity
Click "Evaluate students"
Locate the test learner and click "Evaluate"
Tick the box for their topic item(s) to indicate that they've completed it
This should now have triggered completion. Inspect:
Certification: "Site administration -> Learning -> Certifications -> (the category) -> (the certification) -> "Edit certification details" -> "Completion"
User should show "certified"
Clicking into the users details shows "Certified, before window opens"
Update the certification record in the database so that it's immediately ready for renewal.
select * from mdl_certif_completion where userid = ?;
update mdl_certif_completion set timewindowopens=floor(extract(epoch from now())) where id = ?;
Run the cron
Note: the necessary cron task ("Update certifications") is only scheduled to run once per hour. So if it doesn't run, go to "Site administration -> Server -> Server -> Scheduled tasks" and change its schedule to run every minute.
View the user's activity status, course completion status, and certification status again, as in step 6.
Certification: should have changed to "Certified, window is open"
Here's the scenario. If you have a certification set up, with a recertification window that comes up automatically, then when the recert window opens, Totara should clear the course and activity completion records for the cert's requirements. Specifically, it "archives" them.
The problem is, that for OJT this does not work correctly. After the recert window opens, the activity completion gets cleared correctly, but the course completion does not.
Replication
In brief:
In detail:
Creating the course, activity, and certification
Trigger completion and recertification
select * from mdl_certif_completion where userid = ?;
update mdl_certif_completion set timewindowopens=floor(extract(epoch from now())) where id = ?;