|
|
|
|
@ -1769,13 +1769,19 @@ class Event |
|
|
|
|
* end at the same second as the user connected to the course. |
|
|
|
|
* @param int $courseId The course in which to add the time |
|
|
|
|
* @param int $userId The user for whom to add the time |
|
|
|
|
* @param $sessionId The session in which to add the time (if any) |
|
|
|
|
* @param int $sessionId The session in which to add the time (if any) |
|
|
|
|
* @param string $virtualTime The amount of time to be added, in a hh:mm:ss format. If int, we consider it is expressed in hours. |
|
|
|
|
* @param string $ip IP address to go on record for this time record |
|
|
|
|
* |
|
|
|
|
* @return True on successful insertion, false otherwise |
|
|
|
|
*/ |
|
|
|
|
public static function eventAddVirtualCourseTime($courseId, $userId, $sessionId, $virtualTime = '', $ip = '') |
|
|
|
|
{ |
|
|
|
|
public static function eventAddVirtualCourseTime( |
|
|
|
|
$courseId, |
|
|
|
|
$userId, |
|
|
|
|
$sessionId, |
|
|
|
|
$virtualTime = '', |
|
|
|
|
$ip = '' |
|
|
|
|
) { |
|
|
|
|
$courseTrackingTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); |
|
|
|
|
$time = $loginDate = $logoutDate = api_get_utc_datetime(); |
|
|
|
|
|
|
|
|
|
@ -1840,9 +1846,9 @@ class Event |
|
|
|
|
WHERE |
|
|
|
|
course_access_id = ".intval($courseAccessId)." AND |
|
|
|
|
session_id = ".$sessionId; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
Database::query($sql); |
|
|
|
|
|
|
|
|
|
return $result; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|