You need to paste this script into the developer tools console on a quiz page where you should see the "Start quiz" button. Don't press "Start quiz" because this will put you into locked mode.
After you're done pasting it into the console, you need to press Enter, and as soon as a new tab opens, you need to press Shift + Tab to move back to the tab you were just in, forcing the opened tab to delay script execution, just enough for our script to run first.
If you did the steps correctly, you should have a tab with the quiz opened, like normal, but inside of the quiz like if it wasn't locked. You can do whatever you want from here. After you are done with the quiz you can just submit it like normal. If you don't see the quiz, close the tab that was opened and redo this step.