Questions shortcode not working

Home Forums Legacy Support 4.0 Bugs & Issues Questions shortcode not working

Tagged: 

Viewing 9 posts - 16 through 24 (of 24 total)
  • Author
    Posts
  • #377068
    No One
    Spectator
    Thanks for your effort, Alex, this code unfortuantly breaks the course status page
    #377124
    Anshuman Sahu
    Keymaster
    Yes this is breaking since we are triggering the domcontentloaded event again so that question shortcode triggers and work. ACtually we need to change the question shortcode script a bit in order to support your question shortcodes in tabs of unit content.
    #377125
    Anshuman Sahu
    Keymaster
    I have fixed this and will be available in next update the custom code below have to be added in order for it to work :
    add_filter('wplms_load_dynamic_scripts',function($scripts){
        $scripts[] = array('id'=>'ques','src'=>WPLMS_PLUGIN_URL.'/assets/js/question.js?tanjirokamado');
        
    #377129
    No One
    Spectator
    Unfortuantly, I tried your update, it still to be fixed, Final code used:
    add_filter('wplms_load_dynamic_scripts',function($scripts){
        $scripts[] = array('id'=>'ques','src'=>WPLMS_PLUGIN_URL.'/assets/js/question.js?tanjirokamado');
        return $scripts;
    });
    
    add_action('wp_footer',function(){
        ?>
        <script>
            document.addEventListener('unit_loaded', (e)=>{
                setTimeout(()=>{
                    
            var DOMContentLoaded_event = document.createEvent("Event");
            DOMContentLoaded_event.initEvent("DOMContentLoaded", true, true);
            window.document.dispatchEvent(DOMContentLoaded_event);
                },500);
            });
        </script>
        <?php
    });
    I really apperciate your effoport Alex.
    #377195
    Anshuman Sahu
    Keymaster
    Hi with todays update and code given here it will work :
    #377272
    No One
    Spectator
    updated to WPLMS Version 1.7.2 The code still breacks course status page!
    #377325
    Anshuman Sahu
    Keymaster
    This is the code you should be using this should be the final code :
    add_filter('wplms_load_dynamic_scripts',function($scripts){
        $scripts[] = array('id'=>'ques','src'=>WPLMS_PLUGIN_URL.'/assets/js/question.js?tanjirokamado');
        return $scripts;
    });
    #377477
    No One
    Spectator
    Now it works, but with a limitation, 1. all questions by id will be displayed continuosly (eg. I can't anymore able to place a text between short codes) 2. If I use some [question id=xxx] in a tab, and use [question id=yyy] in the second tab, Tab 1 displays: [question id=xxx] [question id=yyy] Tab 2 displays empty area, So, I must use all questions by id in a one tab with no text enterd between shortcodes
    #377636
    Anshuman Sahu
    Keymaster
    Yes that would be the issue , due to optimization we have merged all the questions to one . We need to create a script from scratch to run your questions .Need some time .
Viewing 9 posts - 16 through 24 (of 24 total)
  • The topic ‘Questions shortcode not working’ is closed to new replies.