Hi there,
We user the "<span style="background-color: #f1f1f1; color: #23282d; font-family: -apple-system, system-ui, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 14px; font-weight: 600;">Auto-mark unit complete when user proceeds to next unit</span>" option:
https://gyazo.com/b6b414d93b381cecb666a768189d21bc
So it works good.
However, let's say we have 30 units in the course.
I've completed 5 units. Next time I'll comeback to the course the system will redirect me to the unit #6.
Why? This is counterintuitive for users. Why not the unit #5 ?
How can we change this? So every time a user comes to a course she would see the the last opened unit? Not the new unit every time.
Many thanks in advance
@PrettyBoyElias,
The code of this logic is written in such a way that if the user passes the unit or marked the unit complete. Again, when he comes back he'll be promoted to the next successive unit.
In your case, if the user opened the unit 5 and not marked it complete then when he comes back he'll be redirected to unit 5. According to the Logic the unit is not completed by the user in this case
This reply has been marked as private.
@PrettyBoyElias,
Please paste this code in wp-admin > Plugins > Editor > Select WPLMS Customizer Plugin > wplms-customizer.php
add_filter('wplms_get_course_unfinished_unit',function($unit_id,$course_id){
$course_curriculum=bp_course_get_curriculum_units($course_id);
if(!empty($course_curriculum) && count($course_curriculum)){
$key = array_search($unit_id, $course_curriculum);
if(!empty($key) && !empty($course_curriculum[$key-1])){
$unit_id =$course_curriculum[$key-1];
}
}
return $unit_id;
},99,2);
This code works in this case:
1. You have completed a unit and before proceeding to the next unit, click on back to course button.
2. Again when you click on the continue course. You'll fall to the unit which you marked completed.
you guys rock ! :) many thanks
@PrettyBoyElias,
Thanks for confirming. Closing the topic.
Please do rate us on themeforest