Skip to content

Instantly share code, notes, and snippets.

@ynishi2014
Created August 16, 2019 08:51
Show Gist options
  • Save ynishi2014/f9a642f18a143b3fccdd65947a77ec03 to your computer and use it in GitHub Desktop.
Save ynishi2014/f9a642f18a143b3fccdd65947a77ec03 to your computer and use it in GitHub Desktop.
function makeQuizExec(){
var min = parseInt(jQuery("#math_gen_min").val());
var max = parseInt(jQuery("#math_gen_max").val());
var op = jQuery("[name=op]:checked").val();
var count = parseInt(jQuery("#math_gen_count").val());
jQuery("#math_gen_result").val(makeQuizN(min, max, op, count));
}
function handleDownload(){
var data = jQuery("#math_gen_result").val();
var blob = new Blob([data], {type: "text/plain"});
var a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.target = '_blank';
a.download = 'quiz.txt';
a.click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment