topical media & game development

talk show tell print

basic-javascript-07-quiz-AskQuestion.htm / htm



  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Ask Questions</title>
  <script language="JavaScript"  type="text/javascript">
  var globalFunctions;
  globalFunctions = window.top.fraTopFrame.fraGlobalFunctions;
  function getAnswer()
  {
  var answer = 0;
  while (document.QuestionForm.radQuestionChoice[answer].checked != true)
     {
  answer++;
     }
  return String.fromCharCode(65 + answer);
  }
  function buttonCheckQ_onclick()
  {
  var questionNumber = globalFunctions.currentQNumber;
  if (globalFunctions.answerCorrect(questionNumber,getAnswer()) == true)
     {
  alert("You got it right");
     }
  else
     {
  alert("You got it wrong");
     }
  window.location.reload();
  }
  </script>
  </head>
  <body style="background-color: #000033;">
  <table align=center border="2" width="70%">
  <tr>
  <td bgcolor=RoyalBlue>
  <form name="QuestionForm">
  <script language="JavaScript"  type="text/javascript">
  document.write(globalFunctions.getQuestion());
  </script>
  </form>
  </td>
  </tr>
  </table>
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.