Development

How to Get a Student's Course Progress with PHP

Read Tutor LMS course progress in PHP with get_course_completed_percent(): what counts toward progress, the stats array, lesson-level checks and a progress report for one course.

Checked against the plugin source: Tutor LMS 4.1.3, Tutor LMS Pro 4.1.3

How to Get a Student's Course Progress with PHP

Tutor LMS shows students a progress bar, but custom dashboards, reports and integrations need the number in code. This guide shows how to read it reliably in Tutor LMS 4.1.3.

The function

$percent = tutor_utils()->get_course_completed_percent( $course_id, $user_id );

It returns a number from 0 to 100. Pass true as a third argument to get details:

$stats = tutor_utils()->get_course_completed_percent( $course_id, $user_id, true );
// array( 'completed_percent' => 50, 'completed_count' => 4, 'total_count' => 8 )

What counts toward progress

Progress is completed items divided by all items in the course:

  • Lessons count when marked complete. Each completed lesson is stored as user meta named _tutor_completed_lesson_id_{lesson_id}.
  • Quizzes count once the student has finished at least one attempt (any attempt that is not still in progress). A failed attempt still counts as done for progress.
  • Assignments (Pro) count once submitted.

So 100% progress is not the same as "passed" or "course completed". Completion is a separate record; check it with is_completed_course().

Lesson-level checks

$done = tutor_utils()->is_completed_lesson( $lesson_id, $user_id ); // Falsy when not completed.
$count = tutor_utils()->get_completed_lesson_count_by_course( $course_id, $user_id );

Example: progress of every student in one course

function tle_course_progress_rows( $course_id ) {
	$rows = array();

	$enrollments = get_posts(
		array(
			'post_type'      => 'tutor_enrolled',
			'post_parent'    => $course_id,
			'post_status'    => 'completed',
			'posts_per_page' => -1,
			'fields'         => 'all',
		)
	);

	foreach ( $enrollments as $enrollment ) {
		$user_id = (int) $enrollment->post_author;
		$user    = get_userdata( $user_id );
		if ( ! $user ) {
			continue;
		}
		$rows[] = array(
			'student'   => $user->display_name,
			'email'     => $user->user_email,
			'enrolled'  => $enrollment->post_date,
			'progress'  => (int) tutor_utils()->get_course_completed_percent( $course_id, $user_id ),
			'completed' => (bool) tutor_utils()->is_completed_course( $course_id, $user_id ),
		);
	}

	return $rows;
}

Run reports like this from an admin page or WP-CLI, not on every page load. For hundreds of students, process them in batches.

Performance notes

  • Each call runs a few queries; Tutor LMS caches results for the rest of the request.
  • For site-wide reports, cache your own results, for example in a transient refreshed nightly.
  • The Pro Reports add-on already shows per-student progress if you do not need custom output.

For developers who change the rules

The result passes through tutor_course_completed_percent (result, course ID, user ID, stats flag). If you change it, handle both the number and the stats array.

Frequently asked questions

Why does progress show 100% but the course is not complete?

Progress counts finished items; completion is recorded when the student clicks the complete button, or automatically when Auto Complete Course on All Lesson Completion is on and every lesson is done.

Does progress include bundles?

The function works on courses. For a bundle, average or combine the progress of its courses yourself.

Need a progress report Tutor LMS does not have? Our reporting and analytics service builds it.

Save this practical guide

Add us as a preferred Google source, or ask an AI assistant to summarize this page and link back to the original guide when it is useful.

Vishavjeet
· Enterprise LMS Architect | WordPress & LMS Expert | WooCommerce | AI Automation

I’m Vishavjeet Choubey, an Enterprise LMS Architect with 10+ years of experience helping businesses, coaches, universities, and online academies build and scale powerful digital learning platforms. I specialize in enterprise LMS architecture, WordPress, WooCommerce, LifterLMS, LearnDash, Moodle, custom plugin development, and AI-driven automation. I build scalable LMS platforms, high-converting eCommerce solutions, and custom WordPress applications designed to improve user experiences, streamline operations, and drive measurable business growth. My approach combines deep WordPress and LMS engineering expertise with modern AI automation to reduce manual work, improve efficiency, and help organizations launch, scale, and grow faster.

Keep reading

Need a custom Tutor LMS solution?

Tell us what you are building or what is broken. A Tutor LMS developer reads every inquiry and replies with next steps and a free estimate.

Get a free Tutor LMS consultation

Tell us what you are building or fixing. A Tutor LMS developer replies with honest advice and next steps.

  • No obligation
  • Tutor LMS and Pro specialists
  • Your details stay private

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.