• Resolved gps9111

    (@gps9111)


    Hi,
    I created a quiz with 60 questions. I want to display the next, previous button and finish button under every time so that the user can directly submit and view the answers without the need of fully attempting the quiz every time. There is only next option below every question. I have applied pagination on every question. I even tried replacing the FINISH NEXT RESULTS START QUIZ text but still, I don’t see any change.

    https://focusmerit.com/june-1st-week-current-affairs-quiz/

    Please help me resolve this issue.

    Regards,
    gps9111

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

Viewing 1 replies (of 1 total)
  • Plugin Author Harmonic Design

    (@harmonic_design)

    Hi gps9111,
    There is no easy way to add in a previous button, but here is a solution that should work well for you.

    Please add the following to your theme’s functions.php file. This will add a new finish button below the quiz that will force quiz completion if your users get bored and want to complete early.

    function hdq_Q_gps9111($quizID)
    {
    ?>
    	<script>
    	function hdq_Q_gps9111(){
    		let q_wrap = document.getElementsByClassName("hdq_quiz")[0];
    		let f = '<div class="hdq_finish" id = "hdq_quick_finish" style = "margin-top: 2rem"><div class="hdq_finsh_button hdq_button" data-id="10">finish</div></div>';
    		q_wrap.insertAdjacentHTML("beforeend", f);
    		
    		document.getElementById("hdq_quick_finish").addEventListener("click", HDQ.submit);
    		document.getElementById("hdq_quick_finish").addEventListener("click", function(){
    			let buttons = document.getElementsByClassName("hdq_next_button");
    			for(let i = 0; i < buttons.length; i++){
    				buttons[i].style.display = "none";
    			}
    		});
    	}
    	window.onload = hdq_Q_gps9111;
    	</script>
    <?php
    }
    add_action("hdq_before", "hdq_Q_gps9111");
Viewing 1 replies (of 1 total)
  • The topic ‘No Start quiz/ Back/ finish option’ is closed to new replies.