Skip to content

Instantly share code, notes, and snippets.

@angel-rs
Last active July 31, 2021 14:30
Show Gist options
  • Save angel-rs/dd467e80f992f9e00c14013617352bdb to your computer and use it in GitHub Desktop.
Save angel-rs/dd467e80f992f9e00c14013617352bdb to your computer and use it in GitHub Desktop.
Fill college annoying pools
// this is meant to be run inside the browser
// score: 1 | 2 | 3 | 4 | 5 | 6 | 7
// difficulty: 1 | 2 | 3 | 4
function answerTeacherEvaluation(score, difficulty) {
([...document.querySelectorAll(`input[value$="${difficulty}"]`)].forEach(x => x.click())); // set difficulty
([...document.querySelectorAll(`input[value$="${score}"]`)].forEach(x => x.click())); // set score
}
// example call
// answerTeacherEvaluation(5, 3);
// this is meant to be run inside the browser
[...document.querySelectorAll('span')]
.filter(x => x.innerText.toLowerCase() == 'no')
.forEach((x) => {
x.parentElement.querySelector('input[type="radio"]').click()
})
// this is meant to be run inside the browser
[...document.querySelectorAll('span')]
.filter(x => x.innerText.toLowerCase().includes('no') || x.innerText.toLowerCase().includes('ninguna'))
.forEach((x) => {
x.parentElement.querySelector('input[type="radio"]')?.click()
})
// this is meant to be run inside the browser
[...document.querySelectorAll('span')]
.filter(x => x.innerText.toLowerCase() == 'no padezco')
.forEach((x) => {
x.parentElement.querySelector('input[type="radio"]').click()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment