| 1 |
<?php |
| 2 |
/** |
| 3 |
* @author Thimpress |
| 4 |
* @version 1.0.1 |
| 5 |
*/ |
| 6 |
|
| 7 |
if ( ! isset( $user ) || ! isset( $course ) || ! isset( $course_result ) || ! isset( $course_data ) ) { |
| 8 |
return; |
| 9 |
} |
| 10 |
|
| 11 |
$passing_condition = $course->get_passing_condition(); |
| 12 |
/*$completed_percent = 0; |
| 13 |
|
| 14 |
if ( isset( $course_result['count_items'] ) && isset( $course_result['completed_items'] ) |
| 15 |
&& $course_result['count_items'] > 0 ) { |
| 16 |
$completed_percent = round( $course_result['completed_items'] * 100 / $course_result['count_items'], 2 ); |
| 17 |
}*/ |
| 18 |
|
| 19 |
?> |
| 20 |
|
| 21 |
<div class="course-results-progress"> |
| 22 |
<div class="items-progress lp-progress-row"> |
| 23 |
|
| 24 |
<?php $heading = apply_filters( 'learn-press/course/items-completed-heading', esc_html__( 'Items completed:', 'learnpress' ) ); ?> |
| 25 |
|
| 26 |
<?php if ( $heading ) : ?> |
| 27 |
<h4 class="lp-course-progress-heading"><?php echo esc_html__( 'Items completed:', 'learnpress' ); ?></h4> |
| 28 |
<?php endif; ?> |
| 29 |
|
| 30 |
<span class="number"><?php printf( __( '%1$d of %2$d items', 'learnpress' ), $course_result['completed_items'] ?? 0, $course->count_items() ); ?></span> |
| 31 |
</div> |
| 32 |
|
| 33 |
<div class="course-progress lp-progress-row"> |
| 34 |
|
| 35 |
<?php $heading = apply_filters( 'learn-press/course/result-heading', esc_html__( 'Course progress:', 'learnpress' ) ); ?> |
| 36 |
|
| 37 |
<?php if ( $heading ) : ?> |
| 38 |
<h4 class="lp-course-progress-heading"> |
| 39 |
<?php echo esc_html( $heading ); ?> |
| 40 |
</h4> |
| 41 |
<?php endif; ?> |
| 42 |
|
| 43 |
<div class="lp-course-status"> |
| 44 |
<span class="number"> |
| 45 |
<?php echo round( $course_result['result'], 2 ); ?> |
| 46 |
<span class="percentage-sign">%</span> |
| 47 |
</span> |
| 48 |
|
| 49 |
<?php $graduation = $course_data->get_graduation(); ?> |
| 50 |
<?php if ( $graduation ) : ?> |
| 51 |
<span class="lp-graduation <?php echo esc_attr( $graduation ); ?>" style="color: #222; font-weight: 600;"> |
| 52 |
- <?php learn_press_course_grade_html( $graduation ); ?> |
| 53 |
</span> |
| 54 |
<?php endif; ?> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
|