-
Notifications
You must be signed in to change notification settings - Fork 208
Description
Steps to Reproduce
- Create a private Course and Lesson with a Quiz
- Complete the Quiz with a pass grade
- Check Learner Management admin page for that course
What I Expected
As all lessons were completed user should be in Completed status. If Lessons are not private but published status, then all works well. This bug happens only with private lessons status.
What Happened Instead
The course for that user is still "In Progress"
PHP / WordPress / Sensei version
PHP 7.3 / WP 5.2.3 / Sensei 1.12.3
Browser / OS version
Any, this is PHP related issue
Context / Source
I identified the issue to be in the wp-content/plugins/woothemes-sensei/includes/class-sensei-utils.php:1584:
$lesson_ids = Sensei()->course->course_lessons( $course_id, 'publish', 'ids' );
If that line it's replaced with
$lesson_ids = Sensei()->course->course_lessons( $course_id, ['publish', 'private'], 'ids' );
then everything works well.
As you can see that part of the code it's ignoring private lessons so it ends up later when comparing if all lessons were completed in a wrong result.
Issue first reported on WP at: https://wordpress.org/support/topic/analysis-date-completed-field-blank-for-course/