Edpuzzle no pause

Useful AFK tools for EdPuzzle

目前為 2020-04-08 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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;
    }
}



//})();