Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7685435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:15:03+00:00 2026-05-31T19:15:03+00:00

Im trying to make multiple quizes that will keep track of each quiz on

  • 0

Im trying to make multiple quizes that will keep track of each quiz on each page.

So, far i only have 1 counter which cant keep track of which page the quiz are answered.

All of my quizes are in the ID tag =”jquiz” so i only have to use one stylesheet. How would i implement mulitple counters to my code

edit: updated code

 $(".jquiz li ul li").click(function(){

    if (!($(this).parent("ul").hasClass("answered"))) {

        // removes unanswered class and adds answered class so they cannot change answer
        $(this).parent("ul").addClass("answered");

        // runs if they clicked the correct answer
        if ($(this).hasClass("correct")) {
            //adds one to quiz total correct tally
            count++;
             }


             //score check
            if ($('ul.answered').length == 3) {
            $('#page1mark').fadeIn('slow');
            $('#page1total').html('You got a '+count+' out of '+3+' on the page 1quiz.');
        }

        if ($('ul.answered').length == 6) {
            $('#page2mark').fadeIn('slow');
            $('#page2total').html('You got a '+count+' out of '+3+' on the page 2 quiz.');
        }

        if ($('ul.answered').length == howmanyquestions) {
            $('#jquizremarks').fadeIn('slow');
            $('#jquiztotal').html('You got a '+count+' out of '+howmanyquestions+' on the total quiz.');
        }
    }
}};


   //---------The html
        <!-- page1--->
    <ol class="jquiz"> //how do i add IDs to each class in a page?
         <li>
            <p>Cake is yum</p>
                 <ul>
                 <li class="correct">True</li>
                <li>False</li>
    </ul>
    </li>
  </ol>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:15:04+00:00Added an answer on May 31, 2026 at 7:15 pm

    You must not have two html elements with the same ID. So, to do what you want the html elements should be of same classes with differents IDs, so:

    1. Replace id="jquiz" in ol element for class="jquiz"
    2. Change the jquery selector used for count how many questions exists; from $("#jquiz > li") to $(".jquiz > li")
    3. Finally change the jquery selector that set the click handler; from $("#jquiz li ul li") to $(".jquiz li ul li")
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a matplotlib figure that will have multiple horizontal boxplots
I am trying to make a query that will insert multiple values from my
I'm trying to make a search feature that will search multiple columns to find
I am trying to make multiple profile for Userena - each User can only
I am trying to make a multiple page application using winforms. I decied to
i'm trying to make a small project that uses multiple forms (dialogs) for different
I'm trying to make an application in cocos2d that can be used on multiple
While trying to make an automator action that opens multiple tabs from selected text
I have been trying to make wall post from multiple pages but when i
I am trying to make this function that extracts text from html for multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.