public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/userprogress.php
/**
		 * Load a list of the units that the user has completed in this course.
		 */
Load a list of the units that the user has completed in this course.
Load a list of the units that the user has completed in this course .
private function loadUserUnitProgress() {
			if ( $this->unitListProgress ) {
				return;
			}
			global $wpcwdb, $wpdb;
			$wpdb->show_errors();
			$SQL = $wpdb->prepare( "SELECT * FROM $wpcwdb->user_progress up
									LEFT JOIN $wpcwdb->units_meta um ON up.unit_id = um.unit_id
									WHERE user_id = %d
			  						AND parent_course_id = %d
									ORDER BY unit_order ASC", $this->userID, $this->courseID );
			$this->unitListProgress = array();
			$items = $wpdb->get_results( $SQL );
			if ( $items ) {
				foreach ( $items as $item ) {
					$this->unitListProgress[ $item->unit_id ] = $item;
				}
			}
		}
private function loadUserUnitProgress ( ) { if ( $ this -> unitListProgress ) { return ; } global $ wpcwdb , $ wpdb ; $ wpdb -> show_errors ( ) ; $ SQL = $ wpdb -> prepare ( " SELECT * FROM  $ wpcwdb -> user_progress  up
									LEFT JOIN  $ wpcwdb -> units_meta  um ON up.unit_id = um.unit_id
									WHERE user_id = %d
			  						AND parent_course_id = %d
									ORDER BY unit_order ASC " , $ this -> userID , $ this -> courseID ) ; $ this -> unitListProgress = array ( ) ; $ items = $ wpdb -> get_results ( $ SQL ) ; if ( $ items ) { foreach ( $ items as $ item ) { $ this -> unitListProgress [ $ item -> unit_id ] = $ item ; } } }
Load a list of the units that the user has completed in this course.
Load a list of the units that the user has completed in this course .
// Get a list of all units for this course in absolute order // Always create an array - so we know if we've tried this or not. // If unitListProgress is false, we've not tried to fill it yet. // Convert into an ID => object list