Bug? Unable to pass theory lesson/course

BdN
Forums
Hello, I'm already struggling a few days with this problem and I think I found a bug in the code, or I'm just being stupid and doing something wrong. In both cases, I hope you can help me with this. I have a course with a few lessons. One of them is a theory lesson with only slides (no questions). First I had set the minimum passing percentage of that lesson to 100%, but because there are no questions where a user can get any score, it will never pass that lesson. So I decided to set the minimum passing percentage to 0%. This solved the first problem and users were able to pass the lesson. A little while later, I noticed the rule "User has passed all required quizzes" was never fired anymore. With some debugging and digging I ran into this little piece of code, which is a conditional for the rule: /profiles/opigno_lms/modules/opigno/opigno_quiz_app/opigno_quiz_app.rules.inc:133 <?php /** * Condition: User has passed quiz. */ function opigno_quiz_app_rules_has_passed_quiz($node, $user) { $score = @current(quiz_get_score_data(array($node->nid), $user->uid)); return !empty($score->percent_score) && $score->percent_score >= $score->percent_pass; } ?> As you can see, there is a !empty($score->percent_score) part which will always return false in my case, because my $score->percent_score is always 0. Shouldn't this be rewritten to fix this issue, or am I making a mistake and do I have to do this in another way? Hopefully you can help me. Thanks in advance! Bryan
axel

Hi Bryan,

Hi Bryan,

Did you add this lesson in the "Lesson required for the course validation" of the course (field in the course interface)?

BdN

Thanks!

Thanks for the fix! It did solve my problem. And yes Axel, the lesson is in the "Lesson required for the course validation".
dottormeno

Hello, I applied the patch,

Hello, I applied the patch, and now pass rate lesson should be 0 or 100 ?