Quizlet Learn

Highlight the correct answer

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Quizlet Learn
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Highlight the correct answer
// @author       pigPen6969
// @match        *quizlet.com/*/learn
// @icon         https://www.google.com/s2/favicons?domain=quizlet.com
// @grant        none
// ==/UserScript==


(function() {
    'use strict';
    var trms = []
    let i=0
    for (let o of Quizlet.assistantModeData.studiableData.studiableMediaConnections){
        if (i%2 == 0){
            trms.push([o.text.plainText])
        }else{
            trms[trms.length-1].push(o.text.plainText)
        }
        i++
    }
    setInterval(function(){
        try{
            let d = document.querySelector("div.FormattedText.notranslate")
            if (d != null){
                let t = d.getAttribute("aria-label");
                let ret = "";
                for (let tmr of trms){
                if (tmr[0]==t){
                 ret = tmr[1];}
                if (tmr[1] == t){
                ret = tmr[0];}
                for (let tmr of document.querySelectorAll(".wbkjose")){
                    if (tmr.children[1].textContent == ret){
                    tmr.style.backgroundColor = "blue"
                    }
                }
                }

            }
        }catch(e){}
    }, 100);
})();