Skip to content

Instantly share code, notes, and snippets.

@jondcampbell
Created January 19, 2017 22:46
Show Gist options
  • Save jondcampbell/eae9fbc520bd36944d67dfa001b9866b to your computer and use it in GitHub Desktop.
Save jondcampbell/eae9fbc520bd36944d67dfa001b9866b to your computer and use it in GitHub Desktop.
Test how random a Sensei quiz is
<?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