Skip to content

Commit f1fc79e

Browse files
committed
code format
1 parent dc40647 commit f1fc79e

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

models/CourseModel.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ public static function get_topic_progress_by_course_id( $course_id, $student_id
14661466
foreach ( $topics_query->posts as $topic_post ) {
14671467
$topic_id = (int) $topic_post->ID;
14681468

1469-
$total_topic_items = 0;
1469+
$total_topic_items = 0;
14701470
$total_topic_items_completed = 0;
14711471

14721472
$topic = array(
@@ -1517,31 +1517,31 @@ public static function get_topic_progress_by_course_id( $course_id, $student_id
15171517

15181518
} elseif ( tutor()->zoom_post_type === $post_type ) {
15191519

1520-
$zoom_start_date = get_post_meta($post_id, '_tutor_zm_start_datetime', true);
1521-
$start_timestamp = $zoom_start_date ? strtotime( $zoom_start_date ) : 0;
1522-
$is_completed = $start_timestamp && strtotime('now') > $start_timestamp;
1520+
$zoom_start_date = get_post_meta( $post_id, '_tutor_zm_start_datetime', true );
1521+
$start_timestamp = $zoom_start_date ? strtotime( $zoom_start_date ) : 0;
1522+
$is_completed = $start_timestamp && strtotime( 'now' ) > $start_timestamp;
15231523
$topic['items'][] = array(
1524-
'type' => 'zoom_meeting',
1525-
'id' => $post_id,
1526-
'title' => $content_post->post_title,
1527-
'link' => esc_url_raw( get_permalink( $post_id ) ),
1528-
'label' => __( 'Live Class', 'tutor' ),
1529-
'icon' => Icon::ZOOM,
1524+
'type' => 'zoom_meeting',
1525+
'id' => $post_id,
1526+
'title' => $content_post->post_title,
1527+
'link' => esc_url_raw( get_permalink( $post_id ) ),
1528+
'label' => __( 'Live Class', 'tutor' ),
1529+
'icon' => Icon::ZOOM,
15301530
'is_completed' => $is_completed,
15311531
);
15321532

15331533
} elseif ( tutor()->meet_post_type === $post_type ) {
1534-
$google_end_date = get_post_meta($post_id, 'tutor-google-meet-end-datetime', true);
1535-
$end_timestamp = $google_end_date ? strtotime( $google_end_date ) : 0;
1536-
$is_completed = $end_timestamp && strtotime('now') > $end_timestamp;
1534+
$google_end_date = get_post_meta( $post_id, 'tutor-google-meet-end-datetime', true );
1535+
$end_timestamp = $google_end_date ? strtotime( $google_end_date ) : 0;
1536+
$is_completed = $end_timestamp && strtotime( 'now' ) > $end_timestamp;
15371537

15381538
$topic['items'][] = array(
1539-
'type' => 'google_meet',
1540-
'id' => $post_id,
1541-
'title' => $content_post->post_title,
1542-
'link' => esc_url_raw( get_permalink( $post_id ) ),
1543-
'label' => __( 'Live Class', 'tutor' ),
1544-
'icon' => Icon::GOOGLE_MEET,
1539+
'type' => 'google_meet',
1540+
'id' => $post_id,
1541+
'title' => $content_post->post_title,
1542+
'link' => esc_url_raw( get_permalink( $post_id ) ),
1543+
'label' => __( 'Live Class', 'tutor' ),
1544+
'icon' => Icon::GOOGLE_MEET,
15451545
'is_completed' => $is_completed,
15461546
);
15471547

@@ -1566,24 +1566,24 @@ public static function get_topic_progress_by_course_id( $course_id, $student_id
15661566
$topic['topic_completed'] = false;
15671567
} else {
15681568
$topic['topic_started'] = true;
1569-
$total_topic_items_completed++;
1569+
++$total_topic_items_completed;
15701570
}
15711571
}
15721572

1573-
$total_topic_items = count($contents_query->posts);
1573+
$total_topic_items = count( $contents_query->posts );
15741574
}
15751575

15761576
$topic['topic_completion_percentage'] = $total_topic_items > 0 && $total_topic_items_completed > 0
1577-
? (int) round( ( $total_topic_items_completed / $total_topic_items ) * 100)
1577+
? (int) round( ( $total_topic_items_completed / $total_topic_items ) * 100 )
15781578
: 0;
1579-
$topic_list[] = $topic;
1579+
$topic_list[] = $topic;
15801580
}
15811581

15821582
wp_reset_postdata();
15831583

15841584
return $topic_list;
15851585
}
1586-
1586+
15871587
/**
15881588
* Check if the current user has course content access
15891589
*

0 commit comments

Comments
 (0)