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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 / dashboard / assignments / submitted.php
tutor / templates / dashboard / assignments Last commit date
review.php 8 months ago submitted.php 8 months ago
submitted.php
169 lines
1 <?php
2 /**
3 * Assignment Submitted Page
4 *
5 * @package Tutor\Templates
6 * @subpackage Dashboard\Assignments
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @version 1.4.3
10 */
11
12 if ( ! defined( 'TUTOR_PRO_VERSION' ) ) {
13 return;
14 }
15
16 use Tutor\Helpers\DateTimeHelper;
17 use TUTOR\Input;
18 use TUTOR_ASSIGNMENTS\Assignments_List;
19
20 $order_filter = Input::get( 'order', 'desc' );
21 $assignment_id = Input::get( 'assignment', 0, Input::TYPE_INT );
22 $format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
23 $course_id = tutor_utils()->get_course_id_by( 'assignment', $assignment_id );
24 $assignment_info = tutor_utils()->get_assignment_option( $assignment_id );
25
26 if ( ! $assignment_info || ! tutor_utils()->can_user_edit_course( get_current_user_id(), $course_id ) ) {
27 tutor_utils()->tutor_empty_state();
28 return;
29 }
30
31 $submission_time = $assignment_info['time_duration']['value'] > 1 ? $assignment_info['time_duration']['time'] : str_replace( 's', '', $assignment_info['time_duration']['time'] );
32 $submission_period = ! $assignment_info['time_duration']['value'] ? __( 'No Limit', 'tutor' ) : $assignment_info['time_duration']['value'] . ' ' . $submission_time;
33 $assignments_submitted = Assignments_List::get_submitted_assignments( $assignment_id, $order_filter );
34
35 $max_mark = tutor_utils()->get_assignment_option( $assignment_id, 'total_mark' );
36 $pass_mark = tutor_utils()->get_assignment_option( $assignment_id, 'pass_mark' );
37 $comment_parent = ! empty( $assignments_submitted ) ? $assignments_submitted[0]->comment_parent : null;
38 ?>
39
40 <div class="tutor-dashboard-content-inner tutor-dashboard-assignment-submits">
41 <div class="tutor-mb-24">
42 <a class="tutor-btn tutor-btn-ghost" href="<?php echo esc_url( tutor_utils()->get_tutor_dashboard_page_permalink( 'assignments' ) ); ?>">
43 <span class="tutor-icon-previous tutor-mr-8" area-hidden="true"></span>
44 <?php esc_html_e( 'Back', 'tutor' ); ?>
45 </a>
46 </div>
47
48 <div class="tutor-assignment-review-header tutor-assignment-submitted-page">
49 <div class="tutor-fs-7 tutor-color-secondary">
50 <?php esc_html_e( 'Course', 'tutor' ); ?> : <?php echo esc_html( get_the_title( $comment_parent ) ); ?>
51 </div>
52 <div class="tutor-fs-6 tutor-fw-medium tutor-mt-8">
53 <?php echo esc_html( get_the_title( $assignment_id ) ); ?>
54 </div>
55 <div class="assignment-info tutor-mt-12 tutor-d-flex">
56 <div class="tutor-fs-7 tutor-color-secondary">
57 <?php esc_html_e( 'Assignment Submission Period', 'tutor' ); ?>:
58 <span class="tutor-fs-7 tutor-fw-medium"><?php echo esc_html( $submission_period ); ?></span>
59 </div>
60 <div class="tutor-fs-7 tutor-color-secondary tutor-ml-24">
61 <?php esc_html_e( 'Total Points', 'tutor' ); ?>:
62 <span class="tutor-fs-7 tutor-fw-medium"><?php echo esc_html( $max_mark ); ?></span>
63 </div>
64 <div class="tutor-fs-7 tutor-color-secondary tutor-ml-24">
65 <?php esc_html_e( 'Pass Points', 'tutor' ); ?>:
66 <span class="tutor-fs-7 tutor-fw-medium"><?php echo esc_html( $pass_mark ); ?></span>
67 </div>
68 </div>
69 </div>
70
71 <div class="tutor-dashboard-announcement-sorting-wrap submitted-assignments-sorting-wrap">
72 <div class="tutor-dashboard-announcement-sorting-input">
73 <label class="tutor-fs-7 tutor-color-secondary"><?php esc_html_e( 'Sort By:', 'tutor' ); ?></label>
74 <select class="tutor-announcement-order-sorting tutor-form-control">
75 <option value="desc" <?php selected( $order_filter, 'desc' ); ?>><?php esc_html_e( 'Latest', 'tutor' ); ?></option>
76 <option value="asc" <?php selected( $order_filter, 'asc' ); ?>><?php esc_html_e( 'Oldest', 'tutor' ); ?></option>
77 </select>
78 </div>
79 </div>
80
81 <?php if ( tutor_utils()->count( $assignments_submitted ) ) : ?>
82 <div class="tutor-table-responsive">
83 <table class="tutor-table tutor-table-middle">
84 <thead>
85 <tr>
86 <th width="30%">
87 <?php esc_html_e( 'Student', 'tutor' ); ?>
88 </th>
89 <th width="20%">
90 <?php esc_html_e( 'Submission Date', 'tutor' ); ?>
91 </th>
92 <th width="18%">
93 <?php esc_html_e( 'Submission Deadline', 'tutor' ); ?>
94 </th>
95 <th>
96 <?php esc_html_e( 'Total Points', 'tutor' ); ?>
97 </th>
98 <th>
99 <?php esc_html_e( 'Result', 'tutor' ); ?>
100 </th>
101 <th></th>
102 </tr>
103 </thead>
104 <tbody>
105 <?php
106 foreach ( $assignments_submitted as $assignment ) :
107 $review_url = tutor_utils()->get_tutor_dashboard_page_permalink( 'assignments/review' );
108 $comment_author = get_user_by( 'login', $assignment->comment_author ); // login=username.
109 $is_reviewed_by_instructor = get_comment_meta( $assignment->comment_ID, 'evaluate_time', true );
110 $given_mark = get_comment_meta( $assignment->comment_ID, 'assignment_mark', true );
111 $not_evaluated = '' === $given_mark;
112 $status = 'pending';
113 $button_text = __( 'Evaluate', 'tutor' );
114 $deadline_date = tutor_utils()->get_assignment_deadline_date_in_gmt( $assignment->comment_post_ID, null, $assignment->user_id, $assignment->comment_parent );
115
116 if ( ! empty( $given_mark ) || ! $not_evaluated ) {
117 $status = (int) $given_mark >= (int) $pass_mark ? 'pass' : 'fail';
118 $button_text = __( 'Details', 'tutor' );
119 }
120 ?>
121 <tr>
122 <td>
123 <div class="tutor-d-flex tutor-align-center tutor-gap-2">
124 <?php echo wp_kses( tutor_utils()->get_tutor_avatar( $comment_author->ID ), tutor_utils()->allowed_avatar_tags() ); ?>
125 <div>
126 <?php echo esc_html( $comment_author->display_name ); ?><br/>
127 <span class="tutor-fs-7 tutor-fw-normal tutor-color-muted">
128 <?php echo esc_html( $comment_author->user_email ); ?>
129 </span>
130 </div>
131 </div>
132 </td>
133 <td>
134 <?php echo wp_kses_post( DateTimeHelper::get_gmt_to_user_timezone_date( $assignment->comment_date_gmt ) ); ?>
135 </td>
136 <td>
137 <?php echo esc_html( is_null( $deadline_date ) ? __( 'No Limit', 'tutor' ) : DateTimeHelper::get_gmt_to_user_timezone_date( $deadline_date ) ); ?>
138 </td>
139 <td>
140 <span class="tutor-color-black tutor-fs-7 tutor-fw-medium">
141 <?php echo ! empty( $given_mark ) ? esc_html( $given_mark ) . '/' . esc_html( $max_mark ) : '&nbsp;'; ?>
142 </span>
143 </td>
144 <td>
145 <?php
146 // $status contains HTML
147 echo wp_kses(
148 tutor_utils()->translate_dynamic_text( $status, true ),
149 array(
150 'span' => array( 'class' => true ),
151 )
152 );
153 ?>
154 </td>
155 <td>
156 <a href="<?php echo esc_url( $review_url . '?view_assignment=' . $assignment->comment_ID ) . '&assignment=' . esc_attr( $assignment_id ); ?>" class="tutor-btn tutor-btn-outline-primary tutor-btn-sm">
157 <?php echo esc_html( $button_text ); ?>
158 </a>
159 </td>
160 </tr>
161 <?php endforeach; ?>
162 </tbody>
163 </table>
164 </div>
165 <?php else : ?>
166 <?php tutor_utils()->tutor_empty_state( 'No assignment', 'tutor' ); ?>
167 <?php endif; ?>
168 </div>
169