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.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 / assignment / content.php
tutor / templates / single / assignment Last commit date
content.php 6 years ago
content.php
273 lines
1 <?php
2 /**
3 * Created by PhpStorm.
4 * User: mhshohel
5 * Date: 19/6/19
6 * Time: 1:19 PM
7 */
8
9 if ( ! defined( 'ABSPATH' ) )
10 exit;
11 global $wpdb;
12 ?>
13
14 <?php do_action('tutor_assignment/single/before/content'); ?>
15
16 <div class="tutor-single-page-top-bar">
17 <div class="tutor-topbar-item tutor-hide-sidebar-bar">
18 <a href="javascript:;" class="tutor-lesson-sidebar-hide-bar"><i class="tutor-icon-menu-2"></i> </a>
19 <?php $course_id = get_post_meta(get_the_ID(), '_tutor_course_id_for_assignments', true); ?>
20 <a href="<?php echo get_the_permalink($course_id); ?>" class="tutor-topbar-home-btn">
21 <i class="tutor-icon-next-2"></i> <?php echo __('Go to Course Home', 'tutor') ; ?>
22 </a>
23 </div>
24 <div class="tutor-topbar-item tutor-topbar-content-title-wrap">
25 <?php
26 tutor_utils()->get_lesson_type_icon(get_the_ID(), true, true);
27 the_title(); ?>
28 </div>
29
30 </div>
31
32
33
34 <div class="tutor-lesson-content-area">
35 <div class="tutor-assignment-title">
36 <h2><?php the_title(); ?></h2>
37 </div>
38
39 <div class="tutor-assignment-information">
40 <?php
41 $time_duration = tutor_utils()->get_assignment_option(get_the_ID(), 'time_duration');
42 $total_mark = tutor_utils()->get_assignment_option(get_the_ID(), 'total_mark');
43 $pass_mark = tutor_utils()->get_assignment_option(get_the_ID(), 'pass_mark');
44 ?>
45
46 <ul>
47 <li>
48 <?php _e('Time Duration : ') ?>
49 <strong><?php echo $time_duration["value"] ? $time_duration["value"] . ' ' .$time_duration["time"] : __('No limit', 'tutor'); ?></strong>
50 </li>
51 <!--<li>
52 <?php /*_e('Time Remaining : ') */?>
53 <strong><?php /*echo "7 Days, 12 Hour"; */?></strong>
54 </li>-->
55 <li>
56 <?php _e('Total Marks : ') ?>
57 <strong><?php echo $total_mark; ?></strong>
58 </li>
59 <li>
60 <?php _e('Passing Marks : ') ?>
61 <strong><?php echo $pass_mark; ?></strong>
62 </li>
63 </ul>
64 </div>
65
66 <hr />
67
68 <div class="tutor-assignment-content">
69 <h2><?php _e('Description', 'tutor'); ?></h2>
70
71 <?php the_content(); ?>
72 </div>
73
74
75 <?php
76 $assignment_attachments = maybe_unserialize(get_post_meta(get_the_ID(),'_tutor_assignment_attachments', true));
77 if (tutor_utils()->count($assignment_attachments)){
78 ?>
79 <div class="tutor-assignment-attachments">
80 <h2><?php _e('Attachments', 'tutor'); ?></h2>
81 <?php
82 foreach ($assignment_attachments as $attachment_id){
83 if ($attachment_id) {
84
85 $attachment_name = get_post_meta( $attachment_id, '_wp_attached_file', true );
86 $attachment_name = substr($attachment_name, strrpos($attachment_name, '/')+1);
87 ?>
88 <p class="attachment-file-name">
89 <a href="<?php echo wp_get_attachment_url($attachment_id); ?>" target="_blank">
90 <i class="tutor-icon-attach"></i> <?php echo $attachment_name; ?>
91 </a>
92 </p>
93 <?php
94 }
95 }
96 ?>
97 </div>
98 <?php
99 }
100 ?>
101
102
103
104
105 <?php
106 $is_submitting = tutor_utils()->is_assignment_submitting(get_the_ID());
107 if ($is_submitting){
108 ?>
109
110 <div class="tutor-assignment-submit-form-wrap">
111
112 <h2><?php _e('Assignment answer form', 'tutor'); ?></h2>
113
114
115 <form action="" method="post" id="tutor_assignment_submit_form" enctype="multipart/form-data">
116 <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
117 <input type="hidden" value="tutor_assignment_submit" name="tutor_action"/>
118 <input type="hidden" name="assignment_id" value="<?php echo get_the_ID(); ?>">
119
120 <?php $allowd_upload_files = (int) tutor_utils()->get_assignment_option(get_the_ID(), 'upload_files_limit'); ?>
121
122
123 <div class="tutor-form-group">
124 <p><?php _e('Write your answer briefly', 'tutor'); ?></p>
125 <textarea name="assignment_answer"></textarea>
126 </div>
127
128 <?php if ($allowd_upload_files){ ?>
129 <p>Attach assignment files</p>
130 <div class="tutor-assignment-attachment-upload-wrap">
131
132 <?php
133 for ($item = 1; $item <= $allowd_upload_files; $item++){
134 ?>
135 <div class="tutor-form-group">
136 <label for="tutor-assignment-input-<?php echo $item; ?>"><i class="tutor-icon-upload-file"></i><span><?php _e('Upload file', 'tutor'); ?></span></label>
137 <input class="tutor-assignment-file-upload" id="tutor-assignment-input-<?php echo $item; ?>" type="file" name="attached_assignment_files[]">
138 </div>
139 <?php
140 }
141 ?>
142
143 </div>
144 <?php
145 }
146 ?>
147
148 <div class="tutor-assignment-submit-btn-wrap">
149 <button type="submit" class="tutor-button tutor-success" id="tutor_assignment_submit_btn"> <?php _e('Submit Assignment', 'tutor');
150 ?> </button>
151 </div>
152
153 </form>
154
155 </div>
156
157 <?php
158 }else{
159
160 $submitted_assignment = tutor_utils()->is_assignment_submitted(get_the_ID());
161 if ($submitted_assignment){
162 $is_reviewed_by_instructor = get_comment_meta($submitted_assignment->comment_ID, 'evaluate_time', true);
163
164 if ($is_reviewed_by_instructor){
165 $max_mark = tutor_utils()->get_assignment_option($submitted_assignment->comment_post_ID, 'total_mark');
166 $pass_mark = tutor_utils()->get_assignment_option($submitted_assignment->comment_post_ID, 'pass_mark');
167 $given_mark = get_comment_meta($submitted_assignment->comment_ID, 'assignment_mark', true);
168 ?>
169
170 <div class="assignment-result-wrap">
171 <h4><?php echo sprintf(__('You received %s marks out of %s', 'tutor'), "<span class='received-marks'>{$given_mark}</span>", "<span class='out-of-marks'>{$max_mark}</span>") ?></h4>
172 <h4 class="submitted-assignment-grade">
173 <?php _e('Your Grade is '); ?>
174
175
176 <?php if ($given_mark >= $pass_mark){
177 ?>
178 <span class="submitted-assignment-grade-pass">
179 <?php _e('Passed', 'tutor'); ?>
180 </span>
181 <?php
182 }else{
183 ?>
184 <span class="submitted-assignment-grade-failed">
185 <?php _e('Failed', 'tutor'); ?>
186 </span>
187 <?php
188 } ?>
189 </h4>
190 </div>
191 <?php } ?>
192
193
194 <div class="tutor-assignments-submitted-answers-wrap">
195
196 <h2><?php _e('Your Answers', 'tutor'); ?></h2>
197
198 <?php echo nl2br(stripslashes($submitted_assignment->comment_content)); ?>
199
200 <?php
201
202 $attached_files = get_comment_meta($submitted_assignment->comment_ID, 'uploaded_attachments', true);
203
204 if ($attached_files){
205 $attached_files = json_decode($attached_files, true);
206
207 if (tutor_utils()->count($attached_files)){
208
209 ?>
210 <h2><?php _e('Your uploaded file(s)', 'tutor'); ?></h2>
211
212 <?php
213
214 $upload_dir = wp_get_upload_dir();
215 $upload_baseurl = trailingslashit(tutor_utils()->array_get('baseurl', $upload_dir));
216
217 foreach ($attached_files as $attached_file){
218 ?>
219 <div class="uploaded-files">
220 <a href="<?php echo $upload_baseurl.tutor_utils()->array_get('uploaded_path', $attached_file) ?>" target="_blank"><?php echo tutor_utils()->array_get('name', $attached_file); ?>
221 </a>
222 </div>
223 <?php
224 }
225 }
226
227 }
228
229
230 if ($is_reviewed_by_instructor){
231 ?>
232
233 <div class="instructor-note-wrap">
234 <h2><?php _e('Instructor Note', 'tutor'); ?></h2>
235
236 <p><?php echo nl2br(get_comment_meta($submitted_assignment->comment_ID,'instructor_note', true)) ?></p>
237 </div>
238 <?php
239 }
240
241 ?>
242
243 </div>
244
245
246
247 <?php
248 }else {
249
250
251 ?>
252
253 <div class="tutor-assignment-start-btn-wrap">
254 <form action="" method="post" id="tutor_assignment_start_form">
255 <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?>
256 <input type="hidden" value="tutor_assignment_start_submit" name="tutor_action"/>
257 <input type="hidden" name="assignment_id" value="<?php echo get_the_ID(); ?>">
258
259 <button type="submit" class="tutor-button" id="tutor_assignment_start_btn"> <?php _e( 'Start assignment submit', 'tutor' ); ?> </button>
260 </form>
261 </div>
262
263 <?php
264 }
265 }
266 ?>
267
268
269
270
271 </div>
272
273 <?php do_action('tutor_assignment/single/after/content'); ?>