public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/userprogress.php
/**
		 * Checks if the specified unit was the last unit in the module to complete.
		 *
		 * @param Integer $unitID The ID of the unit that's being checked.
		 * @param Boolean True if the module has been completed, false otherwise.
		 */
Checks if the specified unit was the last unit in the module to complete.
@param Integer $unitID The ID of the unit that's being checked.
@param Boolean True if the module has been completed, false otherwise.
Checks if the specified unit was the last unit in the module to complete . @param Integer $unitID The ID of the unit that ' s being checked . @param Boolean True if the module has been completed false otherwise .
public function isModuleCompleted( $unitID ) {
			$this->loadFullUnitList();
			if ( ! $this->unitList ) {
				return false;
			}
			$thisUnitDetails = $this->unitList[ $unitID ];
			$parentModuleID  = $thisUnitDetails->parent_module_id;
			if ( $parentModuleID < 1 ) {
				return false;
			}
			$moduleList = array();
			foreach ( $this->unitList as $aUnitID => $aUnitObj ) {
				if ( $aUnitObj->parent_module_id == $parentModuleID ) {
					$moduleList[ $aUnitID ] = $aUnitObj;
				}
			}
			foreach ( $moduleList as $aUnitObj ) {
				if ( ! $this->isUnitCompleted( $aUnitObj->unit_id ) ) {
					return false;
				}
			}
			return true;
		}
public function isModuleCompleted ( $ unitID ) { $ this -> loadFullUnitList ( ) ; if ( ! $ this -> unitList ) { return false ; } $ thisUnitDetails = $ this -> unitList [ $ unitID ] ; $ parentModuleID = $ thisUnitDetails -> parent_module_id ; if ( $ parentModuleID < 1 ) { return false ; } $ moduleList = array ( ) ; foreach ( $ this -> unitList as $ aUnitID => $ aUnitObj ) { if ( $ aUnitObj -> parent_module_id == $ parentModuleID ) { $ moduleList [ $ aUnitID ] = $ aUnitObj ; } } foreach ( $ moduleList as $ aUnitObj ) { if ( ! $ this -> isUnitCompleted ( $ aUnitObj -> unit_id ) ) { return false ; } } return true ; }
Checks if the specified unit was the last unit in the module to complete.
Checks if the specified unit was the last unit in the module to complete .
// If no units to complete, then not complete. // Get details for this particular unit // Bad parent module. So not complete. Shouldn't be here, but // check anyway. // Get list of all units that are in same module // Same module, so copy it to list // Ensure all units in the module are complete // Got this far, so all units in module should be complete.