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.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / single / quiz / top.php
tutor / templates / single / quiz Last commit date
parts 4 years ago body.php 4 years ago content.php 4 years ago no_course_belongs.php 5 years ago previous-attempts.php 4 years ago single_quiz_contents.php 4 years ago top.php 4 years ago
top.php
162 lines
1 <?php
2 /**
3 * @package TutorLMS/Templates
4 * @version 1.4.3
5 */
6
7 global $post;
8 global $next_id;
9 $course_content_id = get_the_ID();
10 $course_id = tutor_utils()->get_course_id_by_subcontent($course_content_id);
11
12 $content_id = tutor_utils()->get_post_id($course_content_id);
13 $contents = tutor_utils()->get_course_prev_next_contents_by_id($content_id);
14 $previous_id = $contents->previous_id;
15 $next_id = $contents->next_id;
16 $currentPost = $post;
17 $quiz_id = get_the_ID();
18 $is_started_quiz = tutor_utils()->is_started_quiz();
19 $course = tutor_utils()->get_course_by_quiz(get_the_ID());
20 $previous_attempts = tutor_utils()->quiz_attempts();
21 $attempted_count = is_array($previous_attempts) ? count($previous_attempts) : 0;
22
23 $attempts_allowed = tutor_utils()->get_quiz_option(get_the_ID(), 'attempts_allowed', 0);
24 $passing_grade = tutor_utils()->get_quiz_option(get_the_ID(), 'passing_grade', 0);
25 $attempt_remaining = (int) $attempts_allowed - (int) $attempted_count;
26
27 do_action('tutor_quiz/single/before/top');
28 ?>
29 <?php if (!$is_started_quiz && $attempted_count == 0): ?>
30 <div class="tutor-start-quiz-wrapper tutor-p-48">
31 <div class="tutor-start-quiz-title tutor-pb-28">
32 <div class="text-regular-body tutor-color-black tutor-pb-8">
33 <?php _e('Quiz', 'tutor'); ?>
34 </div>
35 <div class="text-medium-h4 tutor-color-black">
36 <?php echo get_the_title(); ?>
37 </div>
38 <div class="">
39 <?php echo get_the_content(); ?>
40 </div>
41 </div>
42 <div class="tutor-quiz-info-area tutor-mb-60 tutor-mt-24">
43 <?php
44 // Show total question count
45 $total_questions = tutor_utils()->total_questions_for_student_by_quiz(get_the_ID());
46 if($total_questions){
47 ?>
48 <div class="tutor-quiz-info">
49 <span class="text-regular-body tutor-color-muted"><?php _e('Questions', 'tutor'); ?>:</span>
50 <span class="text-regular-body tutor-color-black">
51 <?php echo $total_questions; ?>
52 </span>
53 </div>
54 <?php
55 }
56
57 // Show time limit
58 $time_limit = tutor_utils()->get_quiz_option(get_the_ID(), 'time_limit.time_value');
59 if ($time_limit){
60 $time_type = tutor_utils()->get_quiz_option(get_the_ID(), 'time_limit.time_type');
61
62 $available_time_type = array(
63 'seconds' => $time_limit>1 ? __( 'Seconds', 'tutor' ) : __( 'Second', 'tutor' ),
64 'minutes' => $time_limit>1 ? __( 'Minutes', 'tutor' ) : __( 'Minute', 'tutor' ),
65 'hours' => $time_limit>1 ? __( 'Hours', 'tutor' ) : __( 'Hour', 'tutor' ),
66 'days' => $time_limit>1 ? __( 'Days', 'tutor' ) : __( 'Day', 'tutor' ),
67 'weeks' => $time_limit>1 ? __( 'Weeks', 'tutor' ) : __( 'Week', 'tutor' ),
68 );
69
70 ?>
71 <div class="tutor-quiz-info">
72 <span class="text-regular-body tutor-color-muted"><?php _e('Quize Time', 'tutor'); ?>:</span>
73 <span class="text-regular-body tutor-color-black">
74 <?php echo $time_limit.' '.sprintf( __( '%s', 'tutor' ), isset( $available_time_type[$time_type] ) ? $available_time_type[$time_type] : $time_type ); ?>
75 </span>
76 </div>
77 <?php
78 }
79 ?>
80
81 <!-- Show Total attempt count -->
82 <div class="tutor-quiz-info">
83 <span class="text-regular-body tutor-color-muted">
84 <?php _e('Total Attempted', 'tutor'); ?>:
85 </span>
86 <span class="text-regular-body tutor-color-black">
87 <?php echo $attempted_count . '/' . ($attempts_allowed == 0 ? '&#8734;' : $attempts_allowed); ?>
88 </span>
89 </div>
90
91 <?php
92 // Show Passign grade
93 if($passing_grade){
94 ?>
95 <div class="tutor-quiz-info">
96 <span class="text-regular-body tutor-color-muted"><?php _e('Passing Grade', 'tutor'); ?></span>
97 <span class="text-regular-body tutor-color-black">(<?php echo $passing_grade . '%'; ?>)</span>
98 </div>
99 <?php
100 }
101 ?>
102 </div>
103 <?php
104 if ($attempt_remaining > 0 || $attempts_allowed == 0) {
105 do_action('tuotr_quiz/start_form/before', $quiz_id);
106 $skip_url = get_the_permalink($next_id ? $next_id : $course_id);
107 ?>
108 <div class="tutor-quiz-btn-grp">
109 <form id="tutor-start-quiz" method="post">
110 <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
111
112 <input type="hidden" value="<?php echo $quiz_id; ?>" name="quiz_id"/>
113 <input type="hidden" value="tutor_start_quiz" name="tutor_action"/>
114
115 <button type="submit" class="tutor-btn tutor-btn-primary tutor-btn-md start-quiz-btn" name="start_quiz_btn" value="start_quiz">
116 <?php _e( 'Start Quiz', 'tutor' ); ?>
117 </button>
118 </form>
119
120 <button class="tutor-btn tutor-btn-disable-outline tutor-no-hover tutor-btn-md skip-quiz-btn" data-tutor-modal-target="tutor-quiz-skip-to-next">
121 <?php _e( 'Skip Quiz', 'tutor' ); ?>
122 </button>
123
124 <div id="tutor-quiz-skip-to-next" class="tutor-modal">
125 <span class="tutor-modal-overlay"></span>
126 <button data-tutor-modal-close class="tutor-modal-close">
127 <span class="tutor-icon-line-cross-line"></span>
128 </button>
129 <div class="tutor-modal-root">
130 <div class="tutor-modal-inner">
131 <div class="tutor-modal-body tutor-text-center">
132 <div class="tutor-modal-icon">
133 <!-- <img src="<?php echo tutor()->url; ?>assets/images/icon-trash.svg" /> -->
134 </div>
135 <div class="tutor-modal-text-wrap">
136 <h3 class="tutor-modal-title">
137 <?php esc_html_e('Skip This Quiz?', 'tutor'); ?>
138 </h3>
139 <p>
140 <?php esc_html_e('Are you sure you want to skip this quiz? Please confirm your choice.', 'tutor'); ?>
141 </p>
142 </div>
143 <div class="tutor-modal-btns tutor-btn-group">
144 <button data-tutor-modal-close class="tutor-btn tutor-is-outline tutor-is-default">
145 <?php esc_html_e('Cancel', 'tutor'); ?>
146 </button>
147 <a class="tutor-btn" href="<?php echo $skip_url; ?>">
148 <?php esc_html_e('Yes, Skip This', 'tutor'); ?>
149 </a>
150 </div>
151 </div>
152 </div>
153 </div>
154 </div>
155 </div>
156 <?php
157 }
158 ?>
159 </div>
160 <?php endif; ?>
161 <?php do_action('tutor_quiz/single/after/top'); ?>
162