Skip to content

Instantly share code, notes, and snippets.

@JohnDinhDev
Last active April 29, 2024 18:36
Show Gist options
  • Save JohnDinhDev/330df494981ca97c92a95b65e28967d3 to your computer and use it in GitHub Desktop.
Save JohnDinhDev/330df494981ca97c92a95b65e28967d3 to your computer and use it in GitHub Desktop.
Reset Udemy Progress

Reset Udemy Progress

Last Updated: 09/30/2022

Step 1. Go to Udemy course in browser

Go to the course and have any video up. The following code relies on the right sidebar to be visible to uncheck all your progress.

Step 2. Open browser console

You can do this with ctrl+shift+j and making sure the console tab is selected for chrome/brave

For FireFox, use ctrl+shift+i and select the console tab

Step 3. Run code in browser console

Copy and paste this code in the console Hit the enter key to run

// Stores all unexpanded section headers, and clicks on the unexpanded section headers to expand them
const sectionEl = document.querySelectorAll("section[data-purpose='sidebar'] div.udlite-btn");
sectionEl.forEach((section) => {
  const isClosed = section.parentElement.querySelector("span").getAttribute("data-checked") !== "checked"
  if (isClosed) section.click()
});

// Stores all checkboxes on the page, and clicks on any checkboxes on that currently checked
const checkboxes = document.querySelectorAll("input[type='checkbox']");
checkboxes.forEach((checkbox) => {
  if(checkbox.checked) {
    checkbox.click();
  }
})

Note that your Udemy progress % will not update back to 0%. This is on Udemy's server's end, which I can't control. If you start going through the course again, having a few sections checked off, the percentage should update accordingly.

If this helped you and you want to show your appreciation, consider buying me a coffee ☺ https://ko-fi.com/johndinhdev

@IsraeLucena
Copy link

IsraeLucena commented Jan 21, 2024

const sectionEl = document.querySelector("section[data-purpose='sidebar']"); const checkboxes = sectionEl.querySelectorAll("input[type='checkbox']"); checkboxes.forEach((checkbox) => { if (checkbox.checked) { checkbox.disabled = false; checkbox.click(); } });

It works for me!

However, please be mindful to expand all sections before running the script.

@kavehtehrani
Copy link

Working

Expand all sections

const checkboxes = document.querySelectorAll("input[type='checkbox']");
checkboxes.forEach((checkbox) => {
if(checkbox.checked) {
checkbox.click();}})

Mark as Complete

const sectionEl = document.querySelector("section[data-purpose='sidebar']"); const checkboxes = sectionEl.querySelectorAll("input[type='checkbox']"); checkboxes.forEach((checkbox) => { if (!checkbox.checked) { checkbox.disabled = false; checkbox.click(); } });

Awesome thank you.

@ekrishnas
Copy link

Awesome thank you.

@596050
Copy link

596050 commented Apr 14, 2024

To open all sections:

$x("/html/body/div[1]/div[1]/div/div/main/div/div[2]/section/div[2]/div/div/div/div[1]").map(el => el.click())

To uncheck all checkboxes:

const checkboxes = document.querySelectorAll("input[type='checkbox']");
checkboxes.forEach((checkbox) => {
if(checkbox.checked) {
checkbox.click();}})

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