LLMS_Privacy_Exporters::quiz_data( string $email_address, int $page )
Export quiz attempt data by email address
Parameters Parameters
- $email_address
-
(string) (Required) Email address of the user to retrieve data for.
- $page
-
(int) (Required) Process page number.
Return Return
(array)
Source Source
File: includes/privacy/class-llms-privacy-exporters.php
public static function quiz_data( $email_address, $page ) { $data = array(); $student = self::get_student_by_email( $email_address ); if ( ! $student ) { return self::get_return( $data ); } $query = self::get_student_quizzes( $student, $page ); $done = true; if ( $query->has_results() ) { $group_label = __( 'Quiz Attempts', 'lifterlms' ); $group_descriptions = __( 'Student quiz attempt data', 'lifterlms' ); foreach ( $query->get_attempts() as $attempt ) { $data[] = array( 'group_id' => 'lifterlms_quizzes', 'group_label' => $group_label, 'group_description' => $group_description, 'item_id' => sprintf( 'order-%d', $attempt->get( 'id' ) ), 'data' => self::get_quiz_attempt_data( $attempt ), ); } $done = $query->is_last_page(); } return self::get_return( $data, $done ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.37.9 | Added $group_description to the group exporter. |
3.18.0 | Introduced. |