Skip to content

Instantly share code, notes, and snippets.

@mingtsay
Last active August 29, 2015 14:01
Show Gist options
  • Save mingtsay/63858f2bd1005320537b to your computer and use it in GitHub Desktop.
Save mingtsay/63858f2bd1005320537b to your computer and use it in GitHub Desktop.
for MCU Moodle form 5 stars and check all boxes
(function(d){
var f = d.getElementById("phpesp_response");
for (var i in f) {
if (f[i]) {
switch (f[i].type) {
case "radio":
if (f[i].value == 4) {
f[i].checked = true;
}
break;
case "checkbox":
f[i].checked = true;
break;
}
}
}
}(document));
/*
Usage: put the following link into your bookmark
javascript:var%20timestamp=new%20Date().getTime();var%20main=document.createElement('script');main.charset='utf-8';main.type='text/javascript';main.src='https://gist.github.com/mingtsay/63858f2bd1005320537b/raw/39022e25c0f703637f4473a7ae90875b1818df90/mcu_moodle_form.js?'+timestamp;document.body.appendChild(main);void(0);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment