Skip to content
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

Open
cleardesign opened this issue Nov 14, 2019 · 5 comments · May be fixed by #2879
Open

Private completed lessons prevent user from completing the course #2802

cleardesign opened this issue Nov 14, 2019 · 5 comments · May be fixed by #2879

Comments

@cleardesign
Copy link

Steps to Reproduce

  1. Create a private Course and Lesson with a Quiz
  2. Complete the Quiz with a pass grade
  3. 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/

@richardmtl richardmtl changed the title Private completed lessons prevent user to complete the course Private completed lessons prevent user from completing the course Nov 18, 2019
@donnapep
Copy link
Collaborator

donnapep commented Feb 15, 2020

@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.

@donnapep donnapep added the [Status] Needs Author Reply Requires response from the author label Feb 15, 2020
@lkraav
Copy link
Contributor

lkraav commented Feb 16, 2020

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.

@cleardesign
Copy link
Author

@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.

@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.

@lkraav
Copy link
Contributor

lkraav commented Feb 17, 2020

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.

Risky model. You will need many overrides to make this work. Move towards derisking?

@donnapep donnapep removed the [Status] Needs Author Reply Requires response from the author label Feb 17, 2020
@donnapep
Copy link
Collaborator

On our site, we only want logged in members to be able to register for courses.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants