Skip to content

Commit

Permalink
Fix fatal error when unenrolled users view a lesson without a quiz (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbossenger authored Dec 11, 2024
1 parent 6ede536 commit 813b159
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ function update_quiz_actions( $block_content ) {
function is_quiz_ungraded() {
$lesson_id = Sensei_Utils::get_current_lesson();
$quiz_id = Sensei()->lesson->lesson_quizzes( $lesson_id );
if ( ! $quiz_id ) {
return false;
}
$user_id = get_current_user_id();
$quiz_progress = Sensei()->quiz_progress_repository->get( $quiz_id, $user_id );

Expand Down

0 comments on commit 813b159

Please sign in to comment.