PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / admin / views / meta-boxes / quiz / assigned.php

assigned.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.8, at inc/admin/views/meta-boxes/quiz/assigned.php

59 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin View: Question assigned Meta box
4 *
5 * @version 1.0.1
6 */
7
8 use LearnPress\Models\CourseModel;
9
10 defined( 'ABSPATH' ) || exit();
11
12 global $post;
13 $curd = new LP_Question_CURD();
14 $quiz = $curd->get_quiz( $post->ID );
15 ?>
16
17 <div class="lp-item-assigned">
18 <?php if ( $quiz ) : ?>
19 <?php $courses = learn_press_get_item_courses( $quiz->ID ); ?>
20
21 <?php if ( $courses ) : ?>
22 <ul class="parent-courses">
23 <?php
24 foreach ( $courses as $course ) :
25 $courseModel = CourseModel::find( $course->ID, true );
26 if ( ! $courseModel ) {
27 continue;
28 }
29 ?>
30 <li>
31 <strong>
32 <a href="<?php echo get_edit_post_link( $course->ID ); ?>" target="_blank"><?php echo get_the_title( $course->ID ); ?></a>
33 </strong>
34 &#8212;
35 <a href="<?php echo learn_press_get_course_permalink( $course->ID ); ?>" target="_blank"><?php esc_html_e( 'View', 'learnpress' ); ?></a>
36 <ul class="parent-quizzes">
37 <li>
38 <strong>
39 <a href="<?php echo get_edit_post_link( $quiz->ID ); ?>" target="_blank">
40 &#8212; &#8212;
41 <?php echo get_the_title( $quiz->ID ); ?></a>
42 </strong>
43 &#8212;
44 <a href="<?php echo $courseModel->get_item_link( $quiz->ID ); ?>" target="_blank"><?php esc_html_e( 'View', 'learnpress' ); ?></a>
45 </li>
46 </ul>
47 </li>
48 <?php endforeach; ?>
49 </ul>
50 <?php else : ?>
51 <strong><a href="<?php echo get_edit_post_link( $quiz->ID ); ?>" target="_blank"><?php echo get_the_title( $quiz->ID ); ?></a></strong>
52 <?php endif; ?>
53 <?php
54 else :
55 esc_html_e( 'Not assigned yet', 'learnpress' );
56 endif;
57 ?>
58 </div>
59