PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in
-
Hello,
When using mycred with tutor LMS, we get the following critical error when a student completes a quiz.
[07-Jan-2025 10:42:14 UTC] PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /home/SITEPATH/wp-content/plugins/mycred-toolkit/includes/addons/mycred-tutor-lms/includes/mycred-pass-quiz.php:76
Stack trace: 0 /home/SITEPATH/wp-includes/class-wp-hook.php(326): mycred_tutor_lms_Geneal_Quiz_Hook_Class->my_cred_quiz_pass_func() 1 /home/SITEPATH/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 2 /home/SITEPATH/wp-includes/plugin.php(517): WP_Hook->do_action() 3 /home/SITEPATH/wp-content/plugins/tutor/classes/Quiz.php(819): do_action() 4 /home/SITEPATH/wp-content/plugins/tutor/classes/Quiz.php(544): TUTOR\Quiz::manage_attempt_answers() 5 /home/SITEPATH/wp-content/plugins/tutor/classes/Quiz.php(487): TUTOR\Quiz::tutor_quiz_attemp_submit() 6 /home/SITEPATH/wp-includes/class-wp-hook.php(324): TUTOR\Quiz->answering_quiz() 7 /home/SITEPATH/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 8 /home/SITEPATH/wp-includes/plugin.php(517): WP_Hook->do_action() 9 /home/SITEPATH/wp-includes/template-loader.php(13): do_action() 10 /home/SITEPATH/wp-blog-header.php(19): require_once(‘/home/SITEPATH/…’) 11 /home/SITEPATH/index.php(17): require(‘/home/SITEPATH/…’) 12 {main}thrown in /home/SITEPATH/wp-content/plugins/mycred-toolkit/includes/addons/mycred-tutor-lms/includes/mycred-pass-quiz.php on line 76
Hooks are setup for both completing and passing a quiz with the default settings.However, removing “Passing a Quiz (Tutor LMS)” resolves the issue, which was triggered because the student failed the quiz which isolates the cause.
If “Passing a Quiz (Tutor LMS)” is enabled but the student fails. the above critical error is caused.
The topic ‘PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in’ is closed to new replies.