Skip to content

Instantly share code, notes, and snippets.

@wlib
Last active June 27, 2024 23:26
Show Gist options
  • Save wlib/bfb90b1c7d243780aac708160d83b808 to your computer and use it in GitHub Desktop.
Save wlib/bfb90b1c7d243780aac708160d83b808 to your computer and use it in GitHub Desktop.
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);
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);
@wlib
Copy link
Author

wlib commented May 18, 2018

run on https://create.kahoot.it or the fetch request will be blocked

Copy link

ghost commented Oct 11, 2019

What is this? WHat does it do?

@RileyJacobs
Copy link

Find the latest revision, works like a charm

@RileyJacobs
Copy link

psych its broken :(

Copy link

ghost commented Feb 25, 2022

this doesn't work

@Allenkimchi
Copy link

dont work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment