Skip to content

Instructor Analytics Design and Functionalities #2297

Open
sanjana4khan wants to merge 142 commits into4.0.0-devfrom
instructor-analytics-free
Open

Instructor Analytics Design and Functionalities #2297
sanjana4khan wants to merge 142 commits into4.0.0-devfrom
instructor-analytics-free

Conversation

@sanjana4khan
Copy link
Collaborator

@sanjana4khan sanjana4khan commented Jan 5, 2026

  • Overview
  • Earnings
  • Statements
  • Students
  • Courses
  • Export

Copy link
Collaborator

@shewa12 shewa12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the requested changes.

*
* @return string Rendered template output.
*/
public function render_template( $template, $data, $once = true ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are we using this method?

*
* @return array[] Topic progress data.
*/
public function get_topic_progress_by_course_id( $course_id, $student_id ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to shift this method to the corredponsing controller class.

$post_type = $content_post->post_type;
$is_completed = true;

if ( 'tutor_quiz' === $post_type ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the helper function instead of writing a hard-coded string.
tutor()->quiz_post_type

$topic['items'][] = array(
'type' => 'quiz',
'id' => $post_id,
'link' => esc_url( get_permalink( $post_id ) ),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use esc_url_raw for direct usage & to store in the database. esc_url is used when we print URL.

'time_type' => tutor_utils()->get_quiz_option( $post_id, 'time_limit.time_type' ),
);

} elseif ( 'tutor_assignments' === $post_type ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tutor()->assignment_post_type

$topic['items'][] = array(
'type' => 'lesson',
'id' => $post_id,
'link' => esc_url( get_permalink( $post_id ) ),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before

$period_clause = '';
$course_clause = '';
$group_clause = ' GROUP BY DATE(date_format) ';
$group_clause = ' GROUP BY MONTH(date_format) ';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing the GROUP BY DATE?

@@ -0,0 +1,45 @@
<?php
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Longhand: $variation = isset( $variation ) ? $variation : 'enrolled';

Shorthand: $variation = $variation ?? 'enrolled';

Comment on lines 14 to 21
$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 ) ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we check empty, we don't need to check isset.

@sanjana4khan sanjana4khan marked this pull request as draft February 3, 2026 06:05
@sanjana4khan sanjana4khan reopened this Feb 3, 2026
@sanjana4khan sanjana4khan marked this pull request as ready for review February 3, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.0 Tutor v4.w0w

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants