Last active
December 29, 2015 02:39
-
-
Save kerryChen95/7602226 to your computer and use it in GitHub Desktop.
UESTC evaluate teaching script
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
(function evaluate(){ | |
var ifr = document.querySelector('#iframeautoheight'), | |
ifrDoc = ifr.contentDocument, | |
selects = ifrDoc.querySelector('#DataGrid1').querySelectorAll('.select'), | |
i, l, | |
options, | |
submitBtn = ifrDoc.querySelector('#Button2'); | |
if( submitBtn.value.search(/提\s*交/) === -1 ){ | |
for(i = 0, l = selects.length; i < l; ++i){ | |
options = selects[i].options; | |
selects[i].selectedIndex = parseInt(Math.random() * (options.length - 1)) + 1; | |
} | |
ifr.addEventListener('load', function onIfrLoad(){ | |
this.removeEventListener('load', onIfrLoad, false); | |
evaluate(); | |
}, false); | |
ifrDoc.querySelector('#Button1').click(); | |
} | |
else if(confirm('完成评教了,要提交吗?')){ | |
submitBtn.click(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment