Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
It's about arranging the jumbled letters in correct order to make a spelling. The question is in the middle div and the letters are around it. Clicking the letter moves it to the answer div one by one to make the spelling. It's working fine, but on restarting the quiz, the score div is not displaying the score. Could you please help to figure out the error?

https://codepen.io/Tarun1980/pen/byQorp[^]

What I have tried:

JavaScript
// Restarting Quiz

    $(document).on('click', '#summary a', restart);
    function restart()
    {
        i = 0;
        k = 0;
        n = 0;
        score = 0;

        $('#summary').fadeOut();
        $('#questionDiv').fadeIn();
        $('#answerDiv').empty();
        $('#answerDiv').fadeIn();
        $('#score').fadeIn();
        $('#btn').fadeIn();
        showQuestions();
        hello();
        world();
        createDivs();
    }
});
Posted
Updated 30-May-19 20:16pm
v2
Comments
[no name] 31-May-19 2:50am    
You mean it's not showing a nought; or it's showing but a nought? Or no nought at all?
#realJSOP 31-May-19 7:21am    
Wought?
ZurdoDev 31-May-19 8:40am    
You didn't post enough of the code and html for us to be able to help. You need to debug this to find out what is happening.
Tarun Rathore 31-May-19 9:41am    
The score is not updating after restarting the game as it is doing in the first round.
I have posted the online link.
Kornfeld Eliyahu Peter 3-Jun-19 6:57am    
What do you mean be restarting? After F5 it still seems to work correctly...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900