• Resolved smartwoo

    (@smartwoo)


    Hello! I’ve been using LifterLMS to create an LMS and am currently working with the BuddyBoss theme. I’ve encountered an issue in the “Quiz Results Clarification” section. When I click on the results, they automatically hide. This problem doesn’t arise with other themes, such as the SkyPilot theme. I’ve demonstrated the issue in the video linked below. Does anyone have any suggestions on how to resolve this? Perhaps there’s some additional CSS code I could add? Thank you for your assistance.

    Issues in Buddyboss Theme:
    https://player.vimeo.com/video/854103523?badge=0&autopause=0&player_id=0&app_id=58479

    How it works in SkyPilot theme

    • This topic was modified 1 year, 3 months ago by smartwoo.
    • This topic was modified 1 year, 3 months ago by smartwoo.
    • This topic was modified 1 year, 3 months ago by smartwoo.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Nick Mariano

    (@reddotinmotion)

    @smartwoo,

    This issue happens because the BuddyBoss theme adds a second click event handler to the quiz clarification. This second click event handler is an exact copy of the click event handler already loaded by LifterLMS.

    In particular, the file wp-content/themes/buddyboss-theme/lifterlms/quiz/results-attempt-questions-list.php adds the code below. This same handler is loaded by /wp-content/plugins/lifterlms/assets/js/llms.js.

    <script>
    ( function( $ ) {
    	$( '.llms-quiz-attempt-question-header .toggle-answer' ).on( 'click', function( e ) {
    
    		e.preventDefault();
    
    		var $curr = $( this ).closest( 'header' ).next( '.llms-quiz-attempt-question-main' );
    
    		$( this ).closest( 'li' ).siblings().find( '.llms-quiz-attempt-question-main' ).slideUp( 200 );
    
    		if ( $curr.is( ':visible' ) ) {
    			$curr.slideUp( 200 );
    		}  else {
    			$curr.slideDown( 200 );
    		}
    
    	} );
    } )( jQuery );
    </script>

    This duplication is the reason why this only happens with the BuddyBoss theme and not the Sky Pilot theme.

    To fix the issue, please go to WordPress Dashboard > BuddyBoss > Theme Options > Custom Codes and toggle JavaScript to On. Once JavaScript is toggledOn, please copy the code below, paste it on the JavaScript text field, and click on the Save Changes button.

    (function($){
        $( window ).on( "load", function() {
            var selector = ".llms-quiz-attempt-question-header a.toggle-answer";
            var events = $._data($( selector ).get(0), "events");
            $( selector ).unbind('click', events['click'][0]['handler'])
        }); 
    })(jQuery);

    This code above will remove one the two click event handlers attached to the quiz clarifications. As a result, only one click even handler is left, and the bug is fixed.

    Please let us know how our solution works for you, or if you encounter further issue. We’ll look for your response, and please let us know if you have further questions.

    Thread Starter smartwoo

    (@smartwoo)

    Thank you for your detailed explanation and solution. I followed the steps you provided and can confirm that the issue has been resolved on my end. The quiz clarifications are now working as expected, with only one click event handler attached.

    I appreciate the timely and effective solution. Your expertise and guidance have been invaluable in resolving this problem.

    Thanks again and best regards!

    https://vimeo.com/855037471?share=copy

    • This reply was modified 1 year, 3 months ago by smartwoo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Auto-hide Issue in Quiz Results with BuddyBoss Theme on LifterLMS: Need Help’ is closed to new replies.