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 6669421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:08:51+00:00 2026-05-26T03:08:51+00:00

I would appreciate it if you can help me with this program. I would

  • 0

I would appreciate it if you can help me with this program. I would like the program to run ike this:

  1. upon clicking a button, a question like 3 X 2 will be written in the document with a textbox wherein I can put the answer.
  2. check if the answer is right or wrong using a promptbox.
  3. It should have a timer that goes from 60 to 0 and when it reaches zero and you weren’t able to answer it, then it will prompt you that the time is up.

I figured out the countdown timer already. I just don’t know how to create the rest ^_^.

it would be great if you can incorporate it with my codes that i have figured. here is my code so far..

<html>
<head>
<title>JavaScript Timer</title>
<script type="text/javascript">

var SECONDS_LEFT, TIMER, TIMES_UP;

function resetTimer(seconds){
 SECONDS_LEFT = seconds;
 document.Timer.TimeLeft.value = SECONDS_LEFT;
 clearTimeout(TIMER);
}

function decrementTimer(){
 TIMES_UP = false;
 document.Timer.TimeLeft.value = SECONDS_LEFT;
 SECONDS_LEFT--;


 if (SECONDS_LEFT >= 0) {
  TIMER = setTimeout(decrementTimer, 1000);
 } else {
  alert("Time's up!");
  resetTimer(60);
 }
}
</script>
</head>
<body onload="resetTimer(60)">

<form name="Timer" onsubmit="return false;">
Timer: <input type="text" name="TimeLeft" size="2"
  style="text-align:center" onfocus="this.blur();">
  seconds left<br>
  <input type="button" name="btnStart" 
   value="Start Quizz" onclick="decrementTimer();">
  <input type="button" name="btnReset" 
   value="Retry" onclick="resetTimer(60);">
</form>
</body>
</html>
  • 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-26T03:08:52+00:00Added an answer on May 26, 2026 at 3:08 am

    you could store the question and answers in a multidimensional array like follows

    // [question number, answer, question]
    var qanda =[ 
    [1,15,"Add 11 + 4"],
    [2,7,"Add 4 + 3"],
    [3,7,"Subtract 9 - 2"]
    ];
    
    
    function getQuestion(n){
    
    
    document.getElementById("disp_question").innerHTML = qanda[n][2];
    
    document.getElementById("intp_div").style.display = "block";
    
    }
    
    function checkAnswer(n){
    
    
    if(document.getElementById("intp_answer").value != undefined){
    
    if(document.getElementById("intp_answer").value == qanda[n][1]){
    
    alert("correct")
    
        }else{
       alert("incorrect")
        }
    
    }
    }
    

    And you could add this below your retry button

    <div id="intp_div" style="display:none">
    <h3 id="disp_question"></h3><input id="intp_answer" type="text" value=""><input type="button" value="Submit Answer" onclick="checkAnswer(2)" />
    </div>`
    

    this it just to hepl you get on your way Note:

    onclick="checkAnswer(2)" the “2” is the question your refferencing from the q and a array

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just cannot get this to work, would appreciate if someone can help. So
This would be my first program using threads so would appreciate any help i
I have this string in vb.net. I would appreciate if you can let me
I would appreciate any help on this issue. Lets say I want to load
I've written a program that highlights numbers and copies them. I would like to
The goal behind this question is to create a portable Windows script/program that would
I would be extremely appreciative if anybody can help me. I am learning C++
I am stuck in a printf problem. I would appreciate if I can get
I am a Java beginner and I would appreciate it if someone here can
How can I implement chmod command on file by using exec? I would appreciate

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.