Skip to content

Instantly share code, notes, and snippets.

@Announcement
Created January 22, 2014 23:51
Show Gist options
  • Save Announcement/8570012 to your computer and use it in GitHub Desktop.
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.
(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(/\&amp\;/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(/\&amp\;/g,"&").replace(/\&lt\;/g,"<").replace(/\&gt\;/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(/\&amp\;/g,"&").replace(/\&lt\;/g,"<").replace(/\&gt\;/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(/\&amp\;/g, "&")
.replace(/\&lt\;/g, "<")
.replace(/\&gt\;/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(/\&amp\;/g, "&")
.replace(/\&lt\;/g, "<")
.replace(/\&gt\;/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:'',/\&amp\;/g:"&",/\&lt\;/g:"<",/\&gt\;/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