Skip to content

Instantly share code, notes, and snippets.

@yyaremenko
Last active December 21, 2024 10:32
Show Gist options
  • Save yyaremenko/4d88efc5e5db96af30a6cd3dc5533770 to your computer and use it in GitHub Desktop.
Save yyaremenko/4d88efc5e5db96af30a6cd3dc5533770 to your computer and use it in GitHub Desktop.
Reset Udemy course progress
// run this script in the Developer Tools' Console
// in the browser of your choice
let panelsSelector = '.ct-sidebar-course-content .ud-accordion-panel-toggler';
let checkboxesSelector = '.ct-sidebar-course-content li input[type=checkbox]:checked';
let click = function(selector) {
console.log('CLICKING...');
let elems = document.querySelectorAll(selector);
elems.forEach(function(item, i) {
setTimeout(function() {
item.click();
}, i * 50)
})
console.log('DONE, clicked total '+elems.length+' items');
}
let clearAll = function() {
// expanding all panels before unchecking checkboxes is a must
click(panelsSelector);
// make sure to give enough time for all panels to expand
setTimeout(function() {
click(checkboxesSelector);
}, 1000);
}
clearAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment