Created
January 19, 2017 22:46
-
-
Save jondcampbell/eae9fbc520bd36944d67dfa001b9866b to your computer and use it in GitHub Desktop.
Test how random a Sensei quiz is
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 | |
$questions_wanted = 2000; | |
$questions_got = 0; | |
$all_questions = []; | |
while($questions_got < $questions_wanted){ | |
$questions = Sensei()->lesson->lesson_quiz_questions( get_the_ID() ); | |
if( count( $questions ) > 0 ){ | |
foreach($questions as $question): | |
array_push($all_questions, $question->ID); | |
$questions_got++; | |
endforeach; | |
} | |
} | |
?> | |
<?php | |
//$unique_questions = array_unique($all_questions); | |
$counts = array_count_values($all_questions); | |
var_dump($counts); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment