From 13f36cc556728e671514ce847cc4fcbfc932d5c7 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 10 Apr 2017 09:09:04 +0200 Subject: [PATCH] Minor - format code, add comments --- main/mySpace/works_in_session_report.php | 29 ++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/main/mySpace/works_in_session_report.php b/main/mySpace/works_in_session_report.php index b2f52704be..e4c1859765 100644 --- a/main/mySpace/works_in_session_report.php +++ b/main/mySpace/works_in_session_report.php @@ -1,5 +1,10 @@ addSelect('session', get_lang('Session'), [0 => get_lang('None')]); $form->addButtonFilter(get_lang('Filter')); -foreach ($sessionsInfo as $sessionInfo) { +foreach ($sessionList as $sessionInfo) { $selectSession->addOption($sessionInfo['name'], $sessionInfo['id']); } if (isset($_GET['session']) && intval($_GET['session'])) { $form->setDefaults(['session' => intval($_GET['session'])]); - + /** @var Session $session */ $session = $em->find('ChamiloCoreBundle:Session', intval($_GET['session'])); } @@ -45,11 +49,13 @@ if ($session) { $sessionCourses = $session->getCourses(); foreach ($sessionCourses as $sessionCourse) { + /** @var Course $course */ $course = $sessionCourse->getCourse(); $coursesInfo[$course->getId()] = $course->getCode(); $userCourseSubscriptions = $session->getUserCourseSubscriptionsByStatus($course, Session::STUDENT); foreach ($userCourseSubscriptions as $userCourseSubscription) { + /** @var User $user */ $user = $userCourseSubscription->getUser(); if (!array_key_exists($user->getId(), $usersInfo)) { @@ -85,7 +91,12 @@ if ($session) { $session->getId() ); - $lastPublication = Tracking::getLastStudentPublication($user, 'work', $course, $session); + $lastPublication = Tracking::getLastStudentPublication( + $user, + 'work', + $course, + $session + ); if (!$lastPublication) { continue;