Created
October 21, 2019 06:51
-
-
Save antonjlin/20902edda7fbfbc6b8bd5f98336e4c46 to your computer and use it in GitHub Desktop.
hypergrade-test-case-shower
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function() { | |
for (let i of document.scripts) { | |
if (i.src == "") { | |
var regex = /var js_test_cases = (.*);/g; | |
var found = i.text.match(regex); | |
eval(found[0]); | |
for (let k of Object.keys(js_test_cases)) { | |
for (let u of js_test_cases[k]) { | |
if (u.hide === 1) { | |
console.log(u.id, u.output); | |
let docID = 'tc_' + u.id.toString(); | |
let div = `<div class="form-group"><pre class="correct_output"><span class="">${u.output.trim()}<span class="nonprintable">\\n</span> | |
</span></pre></div>`; | |
document.getElementById(docID).innerHTML += div; | |
} | |
} | |
} | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minified: