Skip to content

Instantly share code, notes, and snippets.

@andreacampi
Created February 23, 2012 13:54
Show Gist options
  • Save andreacampi/1892971 to your computer and use it in GitHub Desktop.
Save andreacampi/1892971 to your computer and use it in GitHub Desktop.
How to get the best score on an Oatmeal quiz
# navigate to the quiz with your favorite browser;
# open up a JavaScript console (e.g. Inspector if you use Safari / Chrome; Firebug if you use Firefox);
# paste the JavaScript snippet that you find below
$('#questions .question').each(function() { var max=-1,best; console.info(parseInt($('.question_number', this).text())+'. '+$('h3', this).text()); $('li', this).each(function() { var v=$('input[type=radio]', this).attr('value'); if (v > max) { max = v; best = this; } }); console.info($('label', best).text()); }); null
@linda1980
Copy link

awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment