Edpuzzle no pause

Useful AFK tools for EdPuzzle

As of 2020-04-21. See the latest version.

// ==UserScript==
// @name        Edpuzzle no pause
// @namespace    http://tampermonkey.net/
// @version      3.0
// @description  Useful AFK tools for EdPuzzle
// @author       J
// @match        https://edpuzzle.com/*
// @run-at       document-end
// @grant        none
// ==/UserScript==

//(function() {

var beep=document.createElement("audio");
beep.id="beep";
beep.src="https://www.soundjay.com/button/sounds/beep-01a.mp3";
beep.type="audio/mpeg";
var played = false;

setTimeout(function(){
    window.bx=document.createElement("input");
    bx.type="checkbox";
    window.np=document.createElement("input");
    np.type="checkbox";
    window.ctn=document.createElement("input");
    ctn.type="checkbox";

    document.getElementsByClassName("PNsDTVSfY4")[0].prepend(bx)
    document.getElementsByClassName("PNsDTVSfY4")[0].prepend("Beep on question? ")
    document.getElementsByClassName("PNsDTVSfY4")[0].prepend(np);
    document.getElementsByClassName("PNsDTVSfY4")[0].prepend("No pause? ");
    document.getElementsByClassName("PNsDTVSfY4")[0].prepend(ctn);
    document.getElementsByClassName("PNsDTVSfY4")[0].prepend("Auto continue? ");
}, 1500)

setInterval(tick,50);

function tick(){
    //No Pause
    try{
        if(document.getElementsByClassName("_3BJiQRVise")[0].ariaLabel=="Play"&&np.checked){
            document.getElementsByClassName("_3BJiQRVise")[0].click();
        }
    } catch(e){
        //nobody cares!
    }
    //Auto continue
    try{
        if(document.getElementsByClassName("_3pAlsuWUO9 _33wl7jxuFe")[0].innerText!=="Submit"&&ctn.checked){
            document.getElementsByClassName("_3pAlsuWUO9 _33wl7jxuFe")[0].click();
        }
    } catch(e){
        //nobody cares again!
    }
    //Beep on question
    try{
        if(document.getElementsByClassName("_3pAlsuWUO9 _33wl7jxuFe")[0].innerText=="Submit"&&bx.checked){
            if(!played){
                played=true;
                beep.play();
            }
        } else {
            played=false;
        }
    } catch(e){
        //nobody cares again!
    }
}




//})();