Last active
November 16, 2018 03:20
-
-
Save iRGBit/8e415a49c92de7f3e94f28b7c16971ce to your computer and use it in GitHub Desktop.
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
| // ==UserScript== | |
| // @name stream-automark-graded | |
| // @namespace stream-automark-graded | |
| // @include https://stream.massey.ac.nz/mod/assign/*grade* | |
| // @version 1.1 | |
| // @author CMP / Creative Tech Wizards | |
| // @grant none | |
| // ==/UserScript== | |
| var buttonAP = document.createElement("div"); | |
| buttonAP.innerHTML='A+'; | |
| buttonAP.style.height='36px'; | |
| buttonAP.style.fontWeight='bold'; | |
| buttonAP.style.cursor='pointer'; | |
| buttonAP.style.float='right'; | |
| buttonAP.style.width=''; | |
| buttonAP.style.color='white'; | |
| buttonAP.style.textAlign='center'; | |
| buttonAP.style.borderStyle='outset'; | |
| buttonAP.style.paddingTop='2px'; | |
| buttonAP.style.backgroundColor="ForestGreen"; | |
| buttonAP.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=95; | |
| }); | |
| var buttonA = document.createElement("div"); | |
| buttonA.innerHTML='A'; | |
| buttonA.style.height='36px'; | |
| buttonA.style.fontWeight='bold'; | |
| buttonA.style.cursor='pointer'; | |
| buttonA.style.float='right'; | |
| buttonA.style.width='30px'; | |
| buttonA.style.color='white'; | |
| buttonA.style.textAlign='center'; | |
| buttonA.style.borderStyle='outset'; | |
| buttonA.style.paddingTop='2px'; | |
| buttonA.style.backgroundColor="ForestGreen"; | |
| buttonA.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=88; | |
| }); | |
| var buttonAM = document.createElement("div"); | |
| buttonAM.innerHTML='A-'; | |
| buttonAM.style.height='36px'; | |
| buttonAM.style.fontWeight='bold'; | |
| buttonAM.style.cursor='pointer'; | |
| buttonAM.style.float='right'; | |
| buttonAM.style.width='30px'; | |
| buttonAM.style.color='white'; | |
| buttonAM.style.textAlign='center'; | |
| buttonAM.style.borderStyle='outset'; | |
| buttonAM.style.paddingTop='2px'; | |
| buttonAM.style.backgroundColor="ForestGreen"; | |
| buttonAM.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=83; | |
| }); | |
| var buttonBP = document.createElement("div"); | |
| buttonBP.innerHTML='B+'; | |
| buttonBP.style.height='36px'; | |
| buttonBP.style.fontWeight='bold'; | |
| buttonBP.style.float='right'; | |
| buttonBP.style.width='30px'; | |
| buttonBP.style.color='white'; | |
| buttonBP.style.textAlign='center'; | |
| buttonBP.style.borderStyle='outset'; | |
| buttonBP.style.paddingTop='2px'; | |
| buttonBP.style.backgroundColor="MediumBlue"; | |
| buttonBP.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=78; | |
| }); | |
| var buttonB = document.createElement("div"); | |
| buttonB.innerHTML='B'; | |
| buttonB.style.height='36px'; | |
| buttonB.style.fontWeight='bold'; | |
| buttonB.style.cursor='pointer'; | |
| buttonB.style.float='right'; | |
| buttonB.style.width='30px'; | |
| buttonB.style.color='white'; | |
| buttonB.style.textAlign='center'; | |
| buttonB.style.borderStyle='outset'; | |
| buttonB.style.paddingTop='2px'; | |
| buttonB.style.backgroundColor="MediumBlue"; | |
| buttonB.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=73; | |
| }); | |
| var buttonBM = document.createElement("div"); | |
| buttonBM.innerHTML='B-'; | |
| buttonBM.style.height='36px'; | |
| buttonBM.style.fontWeight='bold'; | |
| buttonBM.style.cursor='pointer'; | |
| buttonBM.style.float='right'; | |
| buttonBM.style.width='30px'; | |
| buttonBM.style.color='white'; | |
| buttonBM.style.textAlign='center'; | |
| buttonBM.style.borderStyle='outset'; | |
| buttonBM.style.paddingTop='2px'; | |
| buttonBM.style.backgroundColor="MediumBlue"; | |
| buttonBM.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=68; | |
| }); | |
| var buttonCP = document.createElement("div"); | |
| buttonCP.innerHTML='C+'; | |
| buttonCP.style.height='36px'; | |
| buttonCP.style.fontWeight='bold'; | |
| buttonCP.style.cursor='pointer'; | |
| buttonCP.style.float='right'; | |
| buttonCP.style.width='30px'; | |
| buttonCP.style.color='white'; | |
| buttonCP.style.textAlign='center'; | |
| buttonCP.style.borderStyle='outset'; | |
| buttonCP.style.paddingTop='2px'; | |
| buttonCP.style.backgroundColor="GoldenRod"; | |
| buttonCP.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=63; | |
| }); | |
| var buttonC = document.createElement("div"); | |
| buttonC.innerHTML='C'; | |
| buttonC.style.height='36px'; | |
| buttonC.style.fontWeight='bold'; | |
| buttonC.style.cursor='pointer'; | |
| buttonC.style.float='right'; | |
| buttonC.style.width='30px'; | |
| buttonC.style.color='white'; | |
| buttonC.style.textAlign='center'; | |
| buttonC.style.borderStyle='outset'; | |
| buttonC.style.paddingTop='2px'; | |
| buttonC.style.backgroundColor="GoldenRod"; | |
| buttonC.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=58; | |
| }); | |
| var buttonCM = document.createElement("div"); | |
| buttonCM.innerHTML='C-'; | |
| buttonCM.style.height='36px'; | |
| buttonCM.style.fontWeight='bold'; | |
| buttonCM.style.cursor='pointer'; | |
| buttonCM.style.float='right'; | |
| buttonCM.style.width='30px'; | |
| buttonCM.style.color='white'; | |
| buttonCM.style.textAlign='center'; | |
| buttonCM.style.borderStyle='outset'; | |
| buttonCM.style.paddingTop='2px'; | |
| buttonCM.style.backgroundColor="GoldenRod"; | |
| buttonCM.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=53; | |
| }); | |
| var buttonD = document.createElement("div"); | |
| buttonD.innerHTML='D'; | |
| buttonD.style.height='36px'; | |
| buttonD.style.fontWeight='bold'; | |
| buttonD.style.cursor='pointer'; | |
| buttonD.style.float='right'; | |
| buttonD.style.width='30px'; | |
| buttonD.style.color='white'; | |
| buttonD.style.textAlign='center'; | |
| buttonD.style.borderStyle='outset'; | |
| buttonD.style.paddingTop='2px'; | |
| buttonD.style.backgroundColor="Maroon"; | |
| buttonD.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=46; | |
| }); | |
| var buttonE = document.createElement("div"); | |
| buttonE.innerHTML='E'; | |
| buttonE.style.height='36px'; | |
| buttonE.style.fontWeight='bold'; | |
| buttonE.style.cursor='pointer'; | |
| buttonE.style.float='right'; | |
| buttonE.style.width='30px'; | |
| buttonE.style.color='white'; | |
| buttonE.style.textAlign='center'; | |
| buttonE.style.borderStyle='outset'; | |
| buttonE.style.paddingTop='2px'; | |
| buttonE.style.backgroundColor="Maroon"; | |
| buttonE.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=21; | |
| }); | |
| var buttonNS = document.createElement("div"); | |
| buttonNS.innerHTML='NS'; | |
| buttonNS.style.height='36px'; | |
| buttonNS.style.fontWeight='bold'; | |
| buttonNS.style.cursor='pointer'; | |
| buttonNS.style.float='right'; | |
| buttonNS.style.width='30px'; | |
| buttonNS.style.color='white'; | |
| buttonNS.style.textAlign='center'; | |
| buttonNS.style.borderStyle='outset'; | |
| buttonNS.style.paddingTop='2px'; | |
| buttonNS.style.backgroundColor="Maroon"; | |
| buttonNS.addEventListener('click', function(){ | |
| var scores = document.querySelectorAll('[id*="score"]'); | |
| scores.forEach(function(e){e.value=0}); | |
| scores[scores.length-1].value=0; | |
| }); | |
| setInterval(function(){ | |
| document.getElementById('guide-advancedgrading').appendChild(buttonAP); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonA); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonAM); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonBP); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonB); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonBM); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonCP); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonC); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonCM); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonD); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonE); | |
| document.getElementById('guide-advancedgrading').appendChild(buttonNS); | |
| }, 1000) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment