Created
January 22, 2014 23:51
-
-
Save Announcement/8570012 to your computer and use it in GitHub Desktop.
Edmodo code for computer science auto bot
open up quiz, go to chrome console, copy paste one in, enter. there is your Q&A's.
This file contains 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
(function(){ | |
var qs=document.getElementsByClassName("viewQuestion"); | |
for (var q in qs){ | |
var code=qs[q].children[1].innerText.replace(/(Find the output(\:|))/im,"").trim(); | |
console.log(code); | |
eval(code.replace(/(System\.out\.println)/gim,"console.log").replace(/(int)/gim,"var")); | |
}})() | |
(function(){ | |
var qs=document.getElementsByClassName("text"); | |
for (var q in qs){ | |
var code=qs[q].innerHTML.trim().replace("Find","").replace(/\s+/g,"").replace(/\&\;/g,"&"); | |
console.log(code); | |
console.log(eval(code)); | |
}})() | |
(function(){ | |
var qs=document.getElementsByClassName("text"); | |
for (var q in qs){ | |
var code=qs[q].innerHTML.trim().replace("Find Product:","").replace(/\s+/g,"").replace(/\<br\>/g,'').replace(/\&\;/g,"&").replace(/\<\;/g,"<").replace(/\>\;/g,">").replace('out.print','console.log').replace(/int/g,''); | |
console.log(code); | |
console.log(eval(code)); | |
}})() | |
(function(){ | |
var qs=document.getElementsByClassName("text"); | |
for (var q in qs){ | |
var code=qs[q].innerHTML.trim().replace("Find Product:","").replace(/\s+/g,"").replace(/\<br\>/g,'').replace(/\&\;/g,"&").replace(/\<\;/g,"<").replace(/\>\;/g,">").replace('out.print','console.log').replace(/int/g,''); | |
console.log(code); | |
console.log(eval(code)); | |
}})() | |
(function () { | |
var intro = "Find Count:"; /***Change me for your question***/ | |
var qs = document.getElementsByClassName("viewQuestion"); | |
var i = 0; | |
var ls = ""; | |
function logset(x){ls=x;} | |
for (var v in qs) { | |
var q =qs[v].children[1], | |
code=q.innerHTML.trim() | |
.replace(intro, "") | |
.replace(/\s+/g, " ") | |
.replace(/\<br\>/g, '') | |
.replace(/\&\;/g, "&") | |
.replace(/\<\;/g, "<") | |
.replace(/\>\;/g, ">") | |
.replace('out.print', 'logset') | |
.replace(/int/g, 'var'); | |
console.log('#' + (++i) + 'Q: ' + code); | |
eval(code); | |
qs[v].getElementsByClassName('answerShortAnswer')[0].value = ls; | |
console.log('#' + (++i) + 'A: ' + ls); | |
} | |
})() | |
(function () { | |
var intro = "Find Count:"; /***Change me for your question***/ | |
var qs = document.getElementsByClassName("viewQuestion"); | |
var i = 0; | |
var ls = ""; | |
function logset(x){ls=x;} | |
for (var v in qs) { | |
var q =qs[v].children[1], | |
code=q.innerHTML.trim() | |
.replace(intro, "") | |
.replace(/\s+/g, " ") | |
.replace(/\<br\>/g, '') | |
.replace(/\&\;/g, "&") | |
.replace(/\<\;/g, "<") | |
.replace(/\>\;/g, ">") | |
.replace('out.print', 'logset') | |
.replace(/int/g, 'var'); | |
console.log('#'+(++i)+'Q:'+code); | |
eval(code); | |
console.log('#'+i+'A: '+ls); | |
} | |
})() | |
(function () { | |
var intro = "Find Count:"; /***Change me for your question***/ | |
var qs = document.getElementsByClassName("viewQuestion"); | |
var i = 0; | |
var ls = ""; | |
function logset(x){ls=x;} | |
function rep(s,o){var t = s;for (var k in o){t=t.replace(k,o[k]);}return t;} | |
for (var v in qs) { | |
var q =qs[v].children[1] | |
, code=rep(q.innerHTML.trim(),{intro:"",/\s+/g:" ",/\<br\>/g:'',/\&\;/g:"&",/\<\;/g:"<",/\>\;/g:">",'out.print':'logset',/int/g:'var'}); | |
console.log('#'+(++i)+'.) '+code); | |
eval(code); | |
console.log(ls+'\n\n'); | |
} | |
})() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment