jondcampbell
1/19/2017 - 10:46 PM

Test how random a Sensei quiz is

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);
?>