Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. var category = $(this).parent().data('category');
  2. var value = $(this).data('question');
  3. var score = $('#unanswered').html();
  4. var tempvar = x[category][value];
  5. var answers = $('#answers');
  6.  
  7. function handleAnswer(){
  8. $('.answer').click(function(){// hide empty the tile, mike it unclickable, update the score if correct, and hide the modal
  9. var tile = $('div[data-category="'+$(this).data('category')+'"]>[data-question="'+$(this).data('question')+'"]')[0];
  10. $(tile).empty().removeClass('unanswered').unbind().css('cursor','not-allowed');
  11. if ($(this).data('correct')){
  12. score += parseInt($(this).data('value'));
  13. }
  14. $('#question-modal').modal('hide');
  15. updateScore();
  16. });
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement