Created
May 31, 2020 02:30
-
-
Save Logicbloke/bd97002354460e427842002a8a6a95fc to your computer and use it in GitHub Desktop.
Cheat: Revealing all questions and answers of a Kahoot quiz.
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
<?php | |
error_reporting(null); | |
if(!isset($_GET["pin"])) | |
die("No PIN?"); | |
$url = "https://kahoot.it/rest/challenges/pin/".$_GET["pin"]; | |
$response = file_get_contents($url); | |
$jresponse = json_decode($response, TRUE); | |
$questions = $jresponse["kahoot"]["questions"]; | |
foreach ($questions as $question) { | |
echo $question["question"].": ".array_pop(array_filter($question["choices"], "check_true"))["answer"]."\n"; | |
} | |
function check_true($choice) { | |
return $choice["correct"]; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Makes sense. If you figure out a way to get it working, let me know. I’ll take a look at the Kahoot code once I run out of other things to do an ill let you know if I find anything :)