LLMS_Student::get_overall_progress( boolean $use_cache = true )

Retrieve a student’s overall progress Overall progress is the total percentage completed based on all courses the student is enrolled in Cached data is cleared every time the student completes a lesson


Parameters Parameters

$use_cache

(boolean) (Optional) if false, calculates the progress, otherwise utilizes cached data (if available)

Default value: true


Top ↑

Return Return

(float)


Top ↑

Source Source

File: includes/models/model.llms.student.php

808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
        // If we have at least one grade.
        $count = count( $grades );
        if ( $count ) {
 
            $grade = round( array_sum( $grades ) / $count, 2 );
 
        } else {
 
            $grade = _x( 'N/A', 'overall grade when no quizzes', 'lifterlms' );
 
        }
 
        // Cache the grade.
        $this->set( 'overall_grade', $grade );
 
    }
 
    return apply_filters( 'llms_student_get_overall_grade', $grade, $this );
 
}
 
/**
 * Retrieve a student's overall progress
 * Overall progress is the total percentage completed based on all courses the student is enrolled in
 * Cached data is cleared every time the student completes a lesson
 *
 * @param    boolean $use_cache  if false, calculates the progress, otherwise utilizes cached data (if available)
 * @return   float
 * @since    3.2.0
 * @version  3.2.0
 */
public function get_overall_progress( $use_cache = true ) {
 
    $progress = null;
 
    // Attempt to pull from the cache first.
    if ( $use_cache ) {
 
        $progress = $this->get( $this->meta_prefix . 'overall_progress' );
 
        if ( is_numeric( $progress ) ) {
            $progress = floatval( $progress );
        }
    }
 
    // Cache disabled or no cached data available.
    if ( ! $use_cache || null === $progress || '' === $progress ) {
 
        $progresses = array();


Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.