LLMS_Quiz_Attempt::get_question_objects( boolean $cache = true, boolean $filter_removed = false )
Retrieve an array of attempt question objects
Parameters Parameters
- $cache
-
(boolean) (Optional) If
true, save data to to the object for future gets. Defaulttrue. Cached questions won't take into account the$filte_removedparameter.Default value: true
- $filter_removed
-
(boolean) (Optional) If
true, removed questions will be filtered out. Defaultfalse.Default value: false
Return Return
(array)
Source Source
File: includes/models/model.llms.quiz.attempt.php
* @return array
*/
public function get_question_objects( $cache = true, $filter_removed = false ) {
$questions = array();
foreach ( $this->get_questions( $cache ) as $qdata ) {
$question = new LLMS_Quiz_Attempt_Question( $qdata );
if ( ! $filter_removed || $question->get_question() instanceof LLMS_Question ) {
$questions[] = $question;
}
}
return $questions;
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.3.0 | Add a parameter to filter out removed questions. |
| 3.16.0 | Introduced. |