llms_update_3160_update_quiz_settings()

Add yes/no vals for quiz new quiz settings


Return Return

(void)


Top ↑

Source Source

File: includes/functions/updates/llms-functions-updates-3160.php

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function llms_update_3160_update_quiz_settings() {
 
    global $wpdb;
    $ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_type = 'llms_quiz'" );
 
    foreach ( $ids as $id ) {
 
        $quiz = llms_get_post( $id );
 
        if ( $quiz->get( 'time_limit' ) > 0 ) {
            $quiz->set( 'limit_time', 'yes' );
        }
 
        if ( $quiz->get( 'allowed_attempts' ) > 0 ) {
            $quiz->set( 'limit_attempts', 'yes' );
        }
    }
 
}


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.