Difference between revisions of "Team:Purdue/Quiz"

Line 7: Line 7:
  
  
<h1> Question 1</h1>
+
<h1 id="h1"> Question 1</h1>
 
<p> Men can also get yeast infections? </p>
 
<p> Men can also get yeast infections? </p>
<button id="yes" onclick="counter=yesAnswer(counter)"> Yes </button>
+
<button id="yes" onclick="yesAnswer(counter)"> Yes </button>
<button id="no"> No </button>
+
<button id="no" onclick="noAnswer(counter)> No </button>
 
<h2 id="Commentary"></h2>
 
<h2 id="Commentary"></h2>
 
<div class="clear"></div>
 
<div class="clear"></div>
Line 16: Line 16:
 
<div class="clear"></div>
 
<div class="clear"></div>
 
<p id="Description"></p>
 
<p id="Description"></p>
<button style="visibility:hidden;" onclick="nextQuestion(counter)" id="button">Next Question</button>
+
<button style="visibility:hidden;" onclick="counter=nextQuestion(counter)" id="button">Next Question</button>
 
<script>
 
<script>
 
var counter=0;
 
var counter=0;
Line 30: Line 30:
 
document.getElementById("Commentary").innerHTML="Oops!";
 
document.getElementById("Commentary").innerHTML="Oops!";
 
}
 
}
return cnt;
+
 
 
}
 
}
  
 
function noAnswer(cnt){
 
function noAnswer(cnt){
 +
if(cnt==0){
 +
  document.getElementById("Commentary").innerHTML="Incorrect";
 +
  document.getElementById("Description").innerHTML="Up to god knows how many men get diagnosed with testicular yeast infections per year.";
 +
  document.getElementById("button").style.visibility = "visible";
 +
else{
 +
document.getElementById("Commentary").innerHTML="Oops!";
 +
}
 +
}
 +
 +
nextQuestion(cnt){
 +
 +
if(cnt==0){
 +
  
  
  
 
}
 
}
 +
 +
 +
 +
}
 +
  
 
</script>
 
</script>

Revision as of 13:30, 25 May 2018


Question 1

Men can also get yeast infections?