| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -12,7 +12,7 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 */ | 
					 | 
					 | 
					 | 
					 */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					class learnpathItem | 
					 | 
					 | 
					 | 
					class learnpathItem | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const DEBUG = 0; // Logging parameter. | 
					 | 
					 | 
					 | 
					    public const DEBUG = 0; // Logging parameter. | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public $iId; | 
					 | 
					 | 
					 | 
					    public $iId; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public $attempt_id; // Also called "objectives" SCORM-wise. | 
					 | 
					 | 
					 | 
					    public $attempt_id; // Also called "objectives" SCORM-wise. | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public $audio; // The path to an audio file (stored in document/audio/). | 
					 | 
					 | 
					 | 
					    public $audio; // The path to an audio file (stored in document/audio/). | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -250,17 +250,17 @@ class learnpathItem | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    /** | 
					 | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * Closes/stops the item viewing. Finalises runtime values. | 
					 | 
					 | 
					 | 
					     * Closes/stops the item viewing. Finalises runtime values. | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * If required, save to DB. | 
					 | 
					 | 
					 | 
					     * If required, save to DB. | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					     * @param bool $prerequisitesCheck Needed to check if asset can be set as completed or not | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @return bool True on success, false otherwise | 
					 | 
					 | 
					 | 
					     * @return bool True on success, false otherwise | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */ | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public function close() | 
					 | 
					 | 
					 | 
					    public function close() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { | 
					 | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (self::DEBUG) { | 
					 | 
					 | 
					 | 
					        $debug = self::DEBUG; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            error_log('Start - learnpathItem:close'); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $this->current_stop_time = time(); | 
					 | 
					 | 
					 | 
					        $this->current_stop_time = time(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        $type = $this->get_type(); | 
					 | 
					 | 
					 | 
					        $type = $this->get_type(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (self::DEBUG) { | 
					 | 
					 | 
					 | 
					        if ($debug) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            error_log('Start - learnpathItem:close'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            error_log("Type: ".$type); | 
					 | 
					 | 
					 | 
					            error_log("Type: ".$type); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            error_log("get_id: ".$this->get_id()); | 
					 | 
					 | 
					 | 
					            error_log("get_id: ".$this->get_id()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -271,8 +271,6 @@ class learnpathItem | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    true | 
					 | 
					 | 
					 | 
					                    true | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                ); | 
					 | 
					 | 
					 | 
					                ); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } else { | 
					 | 
					 | 
					 | 
					            } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                /*if ($this->prerequisites_match()) { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                }*/ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                $this->status = $this->possible_status[2]; | 
					 | 
					 | 
					 | 
					                $this->status = $this->possible_status[2]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (self::DEBUG) { | 
					 | 
					 | 
					 | 
					                if (self::DEBUG) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -281,13 +279,13 @@ class learnpathItem | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if ($this->save_on_close) { | 
					 | 
					 | 
					 | 
					        if ($this->save_on_close) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (self::DEBUG) { | 
					 | 
					 | 
					 | 
					            if ($debug) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                error_log("save_on_close: "); | 
					 | 
					 | 
					 | 
					                error_log("save_on_close: "); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $this->save(); | 
					 | 
					 | 
					 | 
					            $this->save(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (self::DEBUG) { | 
					 | 
					 | 
					 | 
					        if ($debug) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            error_log('End - learnpathItem:close'); | 
					 | 
					 | 
					 | 
					            error_log('End - learnpathItem:close'); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |