Created
August 18, 2019 21:19
-
-
Save joemaller/bd21dbdcd8bb04843dbd61013680b08c to your computer and use it in GitHub Desktop.
Assistive technology pager for NY State Anti-Sexual Harassment Training https://www1.nyc.gov/site/cchr/law/sexual-harassment-training.page
This file contains 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
// Paste this into the console | |
// | |
// Why? The site is horribly built and it's very easy to lose your progress and be forced to start over. | |
wait = () => { | |
setTimeout(() => { | |
console.log("tap"); | |
if ($("#Text_Entry_Box_2").length) return; | |
Array.from($("video")).forEach(v => (v.currentTime = v.duration - 0.25)); | |
const sel = [ | |
".cp-singleChoiceInput", | |
".cp-multipleChoiceInput", | |
".cp-frameset[role=button]:not([aria-label~=previous]):not([aria-label~=story])" | |
]; | |
Array.from($(sel.join(", "))).forEach(i => i.click()); | |
wait(); | |
}, 1000); | |
}; | |
wait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notes: Navigation is controlled by
cp.jumpToSlide(arg)
wherearg
is an integer. All data from the training can be found in this very large JS file: https://www1.nyc.gov/assets/cchr/training/english/assets/js/CPM.js