Greasy Fork

来自缓存

Greasy Fork is available in English.

Edpuzzle no pause

Useful AFK tools for EdPuzzle

目前为 2020-04-08 提交的版本。查看 最新版本

// ==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 h=document.createElement("audio");
var muted = false;
h.id="beep";
h.src="https://www.soundjay.com/button/sounds/beep-01a.mp3";
h.type="audio/mpeg";
window.played = false;

setTimeout(function(){
window.bx=document.createElement("input");
bx.type="checkbox";
window.mt=document.createElement("input");
mt.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? ")

mt.onclick = function(){togglemuted()};
document.getElementsByClassName("PNsDTVSfY4")[0].prepend(mt);
document.getElementsByClassName("PNsDTVSfY4")[0].prepend("Mute video? ");
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)






var bbc;
    setInterval(function(){
        bbc=document.getElementsByClassName("_3YDzzvzzXC _2TT-CHq6hp")[0];

        if(document.getElementsByClassName("_3TSUJ0aRCI")[0].textContent=="Continue"&&ctn.checked){
            document.getElementsByClassName("_3TSUJ0aRCI")[0].click();
           };

        try{
        if(bbc.attributes["aria-label"].value=="Play"&&np.checked){
        if(!document.getElementsByClassName("FvwrNg_alY")[0]||document.getElementsByClassName("FvwrNg_alY")[0].textContent=="Show results"){
            bbc.click()}
    }
        } catch(e){
        console.log("hmm..?")
        };
        try{
        if(document.getElementsByClassName("gZkgDqcOdE")[0].children[0].textContent=="MULTIPLE CHOICE QUESTION"&&!played&&bx.checked){
            h.play();
            played=true;
           };

        } catch(e){}
        if(!document.getElementsByClassName("gZkgDqcOdE")[0]){played=false;}


},500)

function togglemuted(){
    if(muted){
    document.getElementsByTagName("video")[0].volume=1;
        muted=false;
    } else {
    document.getElementsByTagName("video")[0].volume=0;
        muted=true;
    }
}



//})();