Browse: Home / Classes / WpProQuiz_Helper_QuestionOrder /

WpProQuiz_Helper_QuestionOrder::get_resume_question_set

WpProQuiz_Helper_QuestionOrder::get_resume_question_set( WpProQuiz_Model_Question[] $pool,  int[] $saved_pro_ids,  int $target )

Builds the question set to resume an attempt with: the saved order restored, then topped up to the target count with other valid questions.


Description #

Single entry point for the resume restore so callers do not have to chain ordering and backfilling themselves. Used when resuming a quiz with random questions and/or a question subset, where the saved order can reference a question that has since been deleted, updated (new pro ID), or dropped from the subset.


Parameters #

$pool

(WpProQuiz_Model_Question[]) (Required) All available questions to draw from.

$saved_pro_ids

(int[]) (Required) Saved order of question pro IDs (resume "randomOrder").

$target

(int) (Required) Desired number of questions.


Return #

(WpProQuiz_Model_Question[]) Questions in saved order with unresolvable IDs skipped, topped up towards $target, as a sequential list.


Source #

File: includes/lib/wp-pro-quiz/lib/helper/WpProQuiz_Helper_QuestionOrder.php


Changelog #

Changelog
Version Description
5.1.6 Introduced.