Show the progress from the last visited course - refs BT#10092 #TMI

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 76dca6eb4a
commit 954181e053
  1. 18
      main/gamification/my_progress.php

@ -26,6 +26,24 @@ $userManager = UserManager::getManager();
$entityManager = Database::getManager();
$user = $userManager->findUserBy(['id' => $userId]);
if (empty($sessionId)) {
$trackCourseAccessRepository = $entityManager->getRepository(
'ChamiloCoreBundle:TrackECourseAccess'
);
$lastCourseAccess = $trackCourseAccessRepository->getLastAccessByUser($user);
if (!empty($lastCourseAccess)) {
$urlWithSession = api_get_self() . '?' . http_build_query([
'session_id' => $lastCourseAccess->getSessionId()
]);
header("Location: $urlWithSession");
exit;
}
}
$sessionCourseSubscriptions = $user->getSessionCourseSubscriptions();
$currentSession = $entityManager->find('ChamiloCoreBundle:Session', $sessionId);

Loading…
Cancel
Save