Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Privacy_Exporters::get_quiz_attempt_data( LLMS_Quiz_Attempt $attempt )

Get export data for a single quiz attempt


Parameters Parameters

$attempt

(LLMS_Quiz_Attempt) (Required) Quiz attempt object.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/privacy/class-llms-privacy-exporters.php

291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
private static function get_quiz_attempt_data( $attempt ) {
 
    $data = array();
 
    $quiz = $attempt->get_quiz();
    if ( $quiz ) {
        $data[] = array(
            'name'  => __( 'Title', 'lifterlms' ),
            'value' => $quiz->get( 'title' ),
        );
    }
 
    $data[] = array(
        'name'  => __( 'Attempt ID', 'lifterlms' ),
        'value' => $attempt->get_key(),
    );
 
    $data[] = array(
        'name'  => __( 'Attempt Number', 'lifterlms' ),
        'value' => $attempt->get( 'attempt' ),
    );
 
    $data[] = array(
        'name'  => __( 'Status', 'lifterlms' ),
        'value' => $attempt->l10n( 'status' ),
    );
 
    $grade  = $attempt->get( 'grade' );
    $data[] = array(
        'name'  => __( 'Grade', 'lifterlms' ),
        'value' => is_numeric( $grade ) ? $grade . '%' : '–',
    );
 
    return $data;
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.18.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.