Instructor Analytics Design and Functionalities #2297
Instructor Analytics Design and Functionalities #2297sanjana4khan wants to merge 142 commits into4.0.0-devfrom
Conversation
shewa12
left a comment
There was a problem hiding this comment.
Please check the requested changes.
classes/Utils.php
Outdated
| * | ||
| * @return string Rendered template output. | ||
| */ | ||
| public function render_template( $template, $data, $once = true ) { |
There was a problem hiding this comment.
Where are we using this method?
classes/Utils.php
Outdated
| * | ||
| * @return array[] Topic progress data. | ||
| */ | ||
| public function get_topic_progress_by_course_id( $course_id, $student_id ) { |
There was a problem hiding this comment.
Need to shift this method to the corredponsing controller class.
classes/Utils.php
Outdated
| $post_type = $content_post->post_type; | ||
| $is_completed = true; | ||
|
|
||
| if ( 'tutor_quiz' === $post_type ) { |
There was a problem hiding this comment.
Use the helper function instead of writing a hard-coded string.
tutor()->quiz_post_type
classes/Utils.php
Outdated
| $topic['items'][] = array( | ||
| 'type' => 'quiz', | ||
| 'id' => $post_id, | ||
| 'link' => esc_url( get_permalink( $post_id ) ), |
There was a problem hiding this comment.
We should use esc_url_raw for direct usage & to store in the database. esc_url is used when we print URL.
classes/Utils.php
Outdated
| 'time_type' => tutor_utils()->get_quiz_option( $post_id, 'time_limit.time_type' ), | ||
| ); | ||
|
|
||
| } elseif ( 'tutor_assignments' === $post_type ) { |
There was a problem hiding this comment.
tutor()->assignment_post_type
classes/Utils.php
Outdated
| $topic['items'][] = array( | ||
| 'type' => 'lesson', | ||
| 'id' => $post_id, | ||
| 'link' => esc_url( get_permalink( $post_id ) ), |
models/OrderModel.php
Outdated
| $period_clause = ''; | ||
| $course_clause = ''; | ||
| $group_clause = ' GROUP BY DATE(date_format) '; | ||
| $group_clause = ' GROUP BY MONTH(date_format) '; |
There was a problem hiding this comment.
Why are we changing the GROUP BY DATE?
| @@ -0,0 +1,45 @@ | |||
| <?php | |||
There was a problem hiding this comment.
There is already a method for generating a star rating. This template seems not required.
|
|
||
| // Default values. | ||
| $icon_size = $icon_size ?? 24; | ||
| $variation = isset( $variation ) ? $variation : 'enrolled'; |
There was a problem hiding this comment.
Longhand: $variation = isset( $variation ) ? $variation : 'enrolled';
Shorthand: $variation = $variation ?? 'enrolled';
| $variation = isset( $variation ) ? $variation : 'enrolled'; | ||
| $value = isset( $value ) ? $value : 0; | ||
| $change = isset( $change ) ? $change : ''; | ||
| $show_graph = isset( $show_graph ) ? $show_graph : false; | ||
| $data = isset( $data ) ? $data : array( 0, 0, 0 ); | ||
|
|
||
| // Required fields validation. | ||
| if ( ! isset( $card_title ) || empty( $card_title ) ) { |
There was a problem hiding this comment.
When we check empty, we don't need to check isset.
Uh oh!
There was an error while loading. Please reload this page.