-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcollegedoors.js
More file actions
1 lines (1 loc) · 976 Bytes
/
collegedoors.js
File metadata and controls
1 lines (1 loc) · 976 Bytes
1
let[links,stringIdent,answers,htmlContent]=[[],[],[],[]],testId=document.querySelector("head > script:nth-child(1)").innerText.match(/\d+/)[0];Array.from(document.querySelectorAll("#choose_report > tbody > tr > td > img")).forEach(t=>{links.push(t.src.replace("-q.","-s."))}),Array.from(document.querySelectorAll("#choose_report>tbody>tr>td:nth-child(6)>button")).forEach(t=>{stringIdent.push(t.getAttribute("onclick").match(/\d+/)[0])});for(let x=0;x!=stringIdent.length;x++){let t=await fetch(`https://tests.collegedoors.com/handlers/cdtaqstnview.php?tsid=${testId}&qid=${stringIdent[x]}`),e=await t.text(),r=new DOMParser,n=r.parseFromString(e,"text/html"),s=n.querySelectorAll('td input[type="radio"]'),o=[s[1],s[3],s[5],s[7]];o.forEach((t,e)=>{t.checked&&answers.push(`Question ${x+1}: Option ${e+1}`)})}for(let x=0;x!=answers.length;x++)htmlContent.push(`<h2><b>${answers[x]}</b></h2><img src='${links[x]}'>`);window.open().document.write(htmlContent.join("<br><br>"));