Skip to content

Instantly share code, notes, and snippets.

@joemaller
Created August 18, 2019 21:19
Show Gist options
  • Save joemaller/bd21dbdcd8bb04843dbd61013680b08c to your computer and use it in GitHub Desktop.
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
// 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()
@joemaller
Copy link
Author

joemaller commented Aug 30, 2021

Notes: Navigation is controlled by cp.jumpToSlide(arg) where arg 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment