LLMS_Quiz_Attempt::get_siblings( array $args = array(), string $return = 'attempts' )
Get sibling attempts
Parameters Parameters
- $args
-
(array) (Optional) List of args to be passed as params of the quiz attempts query. See
LLMS_Query_Quiz_AttemptandLLMS_Database_Queryfor the list of args. By default theper_pageparam is set to 1000.Default value: array()
- $return
-
(string) (Optional) Type of return [ids|attempts]. Default 'attempts'.
Default value: 'attempts'
Return Return
(int[]|LLMS_Quiz_Attempt[]) Type depends on value of $return.
Source Source
File: includes/models/model.llms.quiz.attempt.php
public function get_siblings( $args = array(), $return = 'attempts' ) {
$defaults = array(
'per_page' => 1000,
);
$args = wp_parse_args( $args, $defaults );
$query = new LLMS_Query_Quiz_Attempt(
array_merge(
$args,
array(
'student_id' => $this->get( 'student_id' ),
'quiz_id' => $this->get( 'quiz_id' ),
)
)
);
return 'ids' === $return ? wp_list_pluck( $query->get_results(), 'id' ) : $query->get_attempts();
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.2.0 | Introduced. |