Skip to content

Instantly share code, notes, and snippets.

@slashinfty
Last active September 29, 2020 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slashinfty/3fef9ce468f6178dc7eaf823235193a8 to your computer and use it in GitHub Desktop.
Save slashinfty/3fef9ce468f6178dc7eaf823235193a8 to your computer and use it in GitHub Desktop.
Getting information out of DeltaMath

Student History on a Skill

Create a bookmark in Chrome, name it what you want, and put the following for the page:

javascript:(function(){const a=[...document.querySelectorAll("tr:not(.flatly-table-header)")];let s="";a.forEach((e,t)=>{let n=e.children,i=n[n.length-1].children,l="";for(let e=0;e<i.length;e++){if(i[e].classList.contains("fa-times"))l+="X";else if(i[e].classList.contains("fa-check"))l+="O";else if(i[e].classList.contains("fa-film"))continue;e+1!=i.length&&(l+=",")}""===l&&(l="none"),s+=n[1].innerText+", "+n[0].innerText+" - "+n[2].innerText+" - Record: "+n[4].innerText+" - History: "+l,t+1!=a.length&&(s+="\n")}),navigator.clipboard.writeText(s).then(()=>alert("Text copied to clipboard!"));})();

When you click it, a list will be copied to your clipboard. Paste it in a document to see the results. It will give you student name, period, record, and history (O means check).

Here is the complete code, if anyone is curious:

const a = [...document.querySelectorAll("tr:not(.flatly-table-header)")];
let s = '';
a.forEach((tr, index) => {
    let b = tr.children;
    let h = b[b.length - 1].children;
    let r = '';
    for (let i = 0; i < h.length; i++) {
        if (h[i].classList.contains("fa-times")) r += "X";
        else if (h[i].classList.contains("fa-check")) r += "O";
        else if (h[i].classList.contains("fa-film")) continue;
        if (i + 1 != h.length) r += ",";
    }
    if (r === '') r = 'none';
    s += b[1].innerText + ', ' + b[0].innerText + ' - ' + b[2].innerText + ' - Record: ' + b[4].innerText + ' - History: ' + r;
    if (index + 1 != a.length) s += '\n';
});
navigator.clipboard.writeText(s).then(() => alert("Text copied to clipboard!"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment