ga-wdi-exercises / project1

[project] GA- Project 1
3 stars 75 forks source link

Random Possible Answers not Displaying Properly #134

Closed lscottcook closed 9 years ago

lscottcook commented 9 years ago

Problem: I have a trivia games that randomly selects multiple choice questions. The questions are populating with the 4 correct possible answers onto the HTML page. However, the answers are not displaying correctly. All the possible 4 answers are replacing each of the 4 slots. So 4 answers are listed on slot 1, 4 answers for slot 2, etc

What it Should be: Only one answer per slot.

My code:

 var randomNumber = Math.floor(Math.random ()*4);
 $("#question").html(questions[randomNumber].question)
  $(".choice").html(questions[randomNumber].possibleAnswers)
lscottcook commented 9 years ago

Problem: I have a trivia games that randomly selects multiple choice questions. The questions are random but possible answers are not bound to the question. So the possible answers are random too.

Desired Outcome: Random questions display with correlating possible answers

Code:

 var randomNumber = Math.floor(Math.random ()*4);
 $("#question").html(questions[randomNumber].question)
  $(".choice").eq(0).html(questions[randomNumber].possibleAnswers[0]