Last active
June 27, 2024 23:26
-
-
Save wlib/bfb90b1c7d243780aac708160d83b808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:fetch(`https://create.kahoot.it/rest/kahoots/${prompt("Paste the Kahoot ID")}/card/?includeKahoot=true`).then(res=>res.json()).then(json=>json.kahoot.questions.map((q,number)=>{const{choices}=q;for(let i=0;i<choices.length;i+=1){if(choices[i].correct){switch(i){case 0:return `Q${number+1}: red triangle - ${choices[i].answer }`;break;case 1:return `Q${number+1}: blue diamond - ${choices[i].answer }`;break;case 2:return `Q${number+1}: yellow circle - ${choices[i].answer }`;break;case 3:return `Q${number+1}: green square - ${choices[i].answer }`;break}}}}).join("\n")).then(answers=>open().document.body.innerText=answers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch(`https://create.kahoot.it/rest/kahoots/${prompt("Paste the Kahoot ID")}/card/?includeKahoot=true`) | |
.then(res => res.json()) | |
.then(json => | |
json.kahoot.questions | |
.map((q, number) => { | |
const { choices } = q; | |
for (let i = 0; i < choices.length; i++) { | |
if (choices[i].correct) { | |
switch (i) { | |
case 0: | |
return `Q${number + 1}: red triangle - ${choices[i].answer}`; | |
break; | |
case 1: | |
return `Q${number + 1}: blue diamond - ${choices[i].answer}`; | |
break; | |
case 2: | |
return `Q${number + 1}: yellow circle - ${choices[i].answer}`; | |
break; | |
case 3: | |
return `Q${number + 1}: green square - ${choices[i].answer}`; | |
break; | |
} | |
} | |
} | |
}) | |
.join("\n") | |
) | |
.then(answers => open().document.body.innerText = answers); |
What is this? WHat does it do?
Find the latest revision, works like a charm
psych its broken :(
this doesn't work
dont work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
run on https://create.kahoot.it or the fetch request will be blocked