Automattic / sensei

Sensei LMS - Online Courses, Quizzes, & Learning
https://senseilms.com
GNU General Public License v2.0
539 stars 198 forks source link

Quiz is autograded when completing lesson when autograding is off. #4890

Open aaronfc opened 2 years ago

aaronfc commented 2 years ago

Steps to Reproduce

  1. Enable Learning Mode to a course.
  2. Disable auto-grading for a lesson's quiz.
  3. Take de quiz and right after that click the complete lesson button.
  4. Go back to check the status of your previous quiz.

What I Expected

Still see awaiting for manual grading.

What Happened Instead

Was automatically graded.

PHP / WordPress / Sensei LMS version

PHP: 7.3.5 Sensei LMS: 4.1.1

Screenshot / Video

Kapture 2022-03-03 at 09 36 36

Context / Source

Reported by a Sensei Pro client: p1646229172813299-slack-C02P7FHLVR9

donnapep commented 2 years ago

I can confirm this is also an issue when Learning Mode is disabled. Although the quiz is marked as "Passed", the grade is not set:

Screen Shot 2022-03-03 at 12 19 43 PM

Moreover, although I have Passing Grade set to 50% and disabled Pass Required, I'm still seeing the following message after submitting a quiz:

Pass Required - Disabled

This makes me wonder if the other quiz settings might not be working as well.

m1r0 commented 2 years ago

This looks like intended behavior. It doesn't make much sense, but when a lesson with a quiz is completed, its status goes to "passed" no matter if the quiz is graded or not.

Some of the logic (like is_quiz_submitted for example) relies on things working that way, so changing this might cascade into more bugs.

One route to solving this would be to set the status to "complete" instead of "passed" and try to track down all the logic that is involved and make updates. Another would be to introduce a new status or meta.

@donnapep Do you have any suggestions on how to tackle this?

donnapep commented 2 years ago

@m1r0 Weird. Originally we were concerned that this may have been an issue that was introduced by a recent release. Since that doesn't appear to be the case, I think we can deprioritize this and take our time to figure out what, if anything, we should do about it, especially given the high risk of negatively impacting other things.