Skip to content

Instantly share code, notes, and snippets.

@raffifu
Last active February 2, 2022 09:21
Show Gist options
  • Save raffifu/6835215d2cc94ef1e5acc129e93862ce to your computer and use it in GitHub Desktop.
Save raffifu/6835215d2cc94ef1e5acc129e93862ce to your computer and use it in GitHub Desktop.
Script Otomatis Evaluasi Dosen Simaster UGM. DISCLAIMER: Pembuat tidak bertanggung jawab atas penyalahgunaan kode dibawah. (Do With Your Own Risk) DWYOR
// Buka Halaman evaluasi dosen => Klik dosen yang ingin dinilai
// Open Console (Click F12)
// Copy Paste kode dibawah ke console
// Enter kode checkEdom(1, 3)
const checkEdom = (from, to) => {
if(from < 1 || from > 4 || to < 1 || to > 4)
return throwError(`${from} or ${to} is not a valid number`);
for(let i = 1; i < 13; i++) {
$(`input[name='jawabanInstrumenPilihan[${i}]'][value='${getRandomInt(from, to)}']`).prop('checked', true);
}
}
const getRandomInt = (min, max) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment