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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 / dashboard / assignments / submitted.php
tutor / templates / dashboard / assignments Last commit date
review.php 4 years ago submitted.php 4 years ago
submitted.php
135 lines
1 <?php
2
3 /**
4 * @package TutorLMS/Templates
5 * @version 1.4.3
6 */
7
8 global $wpdb;
9
10 $order_filter = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'desc';
11 $assignment_id = sanitize_text_field( $_GET['assignment'] );
12 $assignments_submitted = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->comments} WHERE comment_type = 'tutor_assignment' AND comment_post_ID = %d ORDER BY comment_ID $order_filter", $assignment_id ) );
13
14 $max_mark = tutor_utils()->get_assignment_option( $assignment_id, 'total_mark' );
15 $pass_mark = tutor_utils()->get_assignment_option( $assignment_id, 'pass_mark' );
16 $format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
17 $deadline = tutor_utils()->get_assignment_deadline_date( $assignment_id, $format, __( 'No Limit', 'tutor' ) );
18 ?>
19
20 <div class="submitted-assignment-title">
21 <a class="prev-btn" href="<?php echo esc_url( tutor_utils()->get_tutor_dashboard_page_permalink( 'assignments' ) ); ?>"><span>&leftarrow;</span><?php esc_html_e( 'Back', 'tutor' ); ?></a>
22 </div>
23
24 <?php
25 if ( tutor_utils()->count( $assignments_submitted ) ) {
26 ?>
27
28 <div class="tutor-assignment-review-header tutor-assignment-submitted-page">
29 <p>
30 <?php esc_html_e( 'Course', 'tutor' ); ?> :
31 <a href="<?php echo esc_url( get_the_permalink( $assignments_submitted[0]->comment_parent ) ); ?>" target="_blank">
32 <?php echo esc_html( get_the_title( $assignments_submitted[0]->comment_parent ) ); ?>
33 </a>
34 </p>
35 <h3>
36 <a href="<?php echo esc_url( get_the_permalink( $assignment_id ) ); ?>" target="_blank">
37 <?php echo esc_html( get_the_title( $assignment_id ) ); ?>
38 </a>
39 </h3>
40 <div class="assignment-info">
41 <p>
42 <?php esc_html_e( 'Submission Deadline', 'tutor' ); ?>:
43 <span><?php echo esc_html( $deadline ); ?></span>
44 </p>
45 <p>
46 <?php esc_html_e( 'Total Points', 'tutor' ); ?>:
47 <span><?php echo esc_html( $max_mark ); ?></span>
48 </p>
49 <p>
50 <?php esc_html_e( 'Pass Points', 'tutor' ); ?>:
51 <span><?php echo esc_html( $pass_mark ); ?></span>
52 </p>
53 </div>
54 </div>
55
56 <div class="tutor-announcement-table-wrap">
57
58 <div class="tutor-dashboard-announcement-sorting-wrap submitted-assignments-sorting-wrap">
59 <div class="tutor-form-group">
60 <label><?php esc_html_e( 'Sort By:', 'tutor' ); ?></label>
61 <select class="tutor-announcement-order-sorting ignore-nice-select">
62 <option value="desc" <?php selected( $order_filter, 'desc' ); ?>><?php esc_html_e( 'Latest', 'tutor' ); ?></option>
63 <option value="asc" <?php selected( $order_filter, 'asc' ); ?>><?php esc_html_e( 'Oldest', 'tutor' ); ?></option>
64 </select>
65 </div>
66 </div>
67
68 <table class="tutor-dashboard-announcement-table tutor-dashboard-assignment-table" width="100%">
69 <thead>
70 <tr>
71 <th style="width:25%;"><?php esc_attr_e( 'Date', 'tutor' ); ?></td>
72 <th><?php _e( 'Student', 'tutor' ); ?></td>
73 <th style="width:15%;"><?php esc_attr_e( 'Total Points', 'tutor' ); ?></td>
74 <th style="width:12%;"><?php esc_attr_e( 'Result', 'tutor' ); ?></td>
75 <th style="width:10%;">&nbsp;</td>
76 </tr>
77 </thead>
78
79 <tbody>
80 <?php
81
82 foreach ( $assignments_submitted as $assignment ) {
83 $comment_author = get_user_by( 'login', $assignment->comment_author ); // login=username
84 $is_reviewed_by_instructor = get_comment_meta( $assignment->comment_ID, 'evaluate_time', true );
85 $given_mark = get_comment_meta( $assignment->comment_ID, 'assignment_mark', true );
86 $not_evaluated = $given_mark === '';
87 $status = sprintf( __( '%1$s Pending %2$s', 'tutor' ), '<span class="review-required">', '</span>' );
88 $button_text = __( 'Evaluate', 'tutor' );
89 if ( ! empty( $given_mark ) || ! $not_evaluated ) {
90 $status = (int) $given_mark >= (int) $pass_mark ? sprintf( __( '%1$s Pass %2$s', 'tutor' ), '<span class="result-pass">', '</span>' ) : sprintf( __( '%1$s Fail %2$s', 'tutor' ), '<span class="result-fail">', '</span>' );
91 $button_text = __( 'Details', 'tutor' );
92 }
93
94 $review_url = tutor_utils()->get_tutor_dashboard_page_permalink( 'assignments/review' );
95
96 ?>
97 <tr>
98 <td><?php echo date( 'j M, Y,<\b\r>h:i a', strtotime( $assignment->comment_date ) ); ?></td>
99 <td>
100 <div class="student-column">
101 <div class="student-avatar">
102 <?php echo tutils()->get_tutor_avatar( $comment_author->ID ); ?>
103 </div>
104 <div class="student-details">
105 <h4><?php echo esc_attr( $comment_author->display_name ); ?></h4>
106 <p><?php echo esc_attr( $comment_author->user_email ); ?></p>
107 </div>
108 </div>
109 </td>
110 <td><?php echo esc_attr( ! empty( $given_mark ) ? $given_mark . '/' . $max_mark : $max_mark ); ?></td>
111 <td><?php echo $status; ?></td>
112 <td>
113 <a href="<?php echo esc_url( $review_url . '?view_assignment=' . $assignment->comment_ID ) . '&assignment=' . $assignment_id; ?>" class="tutor-btn bordered-btn tutor-announcement-details">
114 <?php echo $button_text; ?>
115 </a>
116 </td>
117 </tr>
118 <?php
119 }
120 ?>
121
122 </tbody>
123 </table>
124 </div>
125
126 <?php
127 } else {
128 ?>
129 <p><?php _e( 'No assignment has been submitted yet', 'tutor' ); ?></p>
130 <?php
131 }
132 ?>
133
134 </div>
135