Guest User

Untitled

a guest
Jul 1st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. function buttonGenerator(){
  2. var allAnswers = [21],
  3. randomizer = [];
  4.  
  5. // Generates 3 random answers
  6. for(a = 0 ; a < 3; a++) {
  7. wrongAnswers = Math.floor((Math.random() * 100) + 1);
  8. allAnswers.push(wrongAnswers);
  9. }
  10.  
  11. // Generates random buttons while inputting the correct and incorrect answers randomly
  12. for(i = 0 ; i < 4; i++) {
  13. var buttonArea = $("#answerOptions");
  14. input = $('<button class="col-xs-6 btn btn-primary"></button>');
  15. input.appendTo(buttonArea);
  16. }
  17.  
  18. shuffle(allAnswers);
  19. console.log(allAnswers);
  20. }
  21.  
  22. buttonGenerator();
Add Comment
Please, Sign In to add comment