LLMS_Quiz_Attempt_Question::get_status_icon()

Retrieve the status icon HTML based on the question’s status/answer


Return Return

(string)


Top ↑

Source Source

File: includes/models/model.llms.quiz.attempt.question.php

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
public function get_status_icon() {
 
    $icon = '';
 
    switch ( $this->get_status() ) {
 
        case 'graded':
            if ( $this->is_correct() ) {
                $icon = 'check';
                $tip  = esc_attr__( 'Correct answer', 'lifterlms' );
            } else {
                $icon = 'times';
                $tip  = esc_attr__( 'Incorrect answer', 'lifterlms' );
            }
            break;
        case 'waiting':
            $icon = 'clock-o';
            $tip  = esc_attr__( 'Awaiting review', 'lifterlms' );
            break;
 
    }
 
    if ( $icon ) {
        return sprintf( '<span class="llms-status-icon-tip tip--top-left" data-tip="%1$s"><i class="llms-status-icon fa fa-%2$s"></i><span>', $tip, $icon );
    }
 
    return '';
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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