-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Private completed lessons prevent user from completing the course #2802
Comments
@cleardesign I'm curious as to how your students are taking these courses when they don't show up on the front end? For example, private courses are not listed on the Courses page, but if I'm an admin or an editor I can browse directly to the page for the course. However, if I then start taking the course, I still don't see the list of lessons. Again though, I can browse directly to the private lesson. And private courses aren't listed at all in Sensei LMS > Learner Management. It seems as though private courses and lessons don't work well in general, and not marking them as completed is only one small part of the problem. |
Our main use case has been where we deprecate a lesson, and replace it with a better one. Old one goes to either Private or Draft mode - they should not stay part of the calculations. |
@donnapep On our site, we only want logged in members to be able to register for courses. So, we have published all course lessons/quizzes as Private posts, and created a new user type in WordPress for Members, which has the permission to read Private posts. But, of course, course completion and grading in Sensei doesn’t work as expected for Privately published Lesson posts. |
Risky model. You will need many overrides to make this work. Move towards derisking? |
I may be missing something, but I believe this is already Sensei's default behaviour. The user sees a Register button on the single course page, and when they click that button they will need to either log in or create a new account before they can take the course. |
Steps to Reproduce
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/
The text was updated successfully, but these errors were encountered: