|
|
|
@ -1058,7 +1058,7 @@ class IndexManager |
|
|
|
|
$loadHistory = false |
|
|
|
|
) { |
|
|
|
|
$gameModeIsActive = api_get_setting('gamification_mode'); |
|
|
|
|
$viewGridCourses = api_get_configuration_value('view_grid_courses') === true; |
|
|
|
|
//$viewGridCourses = api_get_configuration_value('view_grid_courses') === true; |
|
|
|
|
$showSimpleSessionInfo = api_get_configuration_value('show_simple_session_info'); |
|
|
|
|
$coursesWithoutCategoryTemplate = '/user_portal/classic_courses.html.twig'; |
|
|
|
|
$showAllSessions = api_get_configuration_value('show_all_sessions_on_my_course_page') === true; |
|
|
|
@ -1154,69 +1154,6 @@ class IndexManager |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*if (isset($courses['in_category'])) { |
|
|
|
|
foreach ($courses['in_category'] as $key1 => $value) { |
|
|
|
|
if (isset($courses['in_category'][$key1]['courses'])) { |
|
|
|
|
foreach ($courses['in_category'][$key1]['courses'] as $key2 => $courseInCatInfo) { |
|
|
|
|
if ($studentInfoProgress) { |
|
|
|
|
$progress = Tracking::get_avg_student_progress( |
|
|
|
|
$user_id, |
|
|
|
|
$courseInCatInfo['course_code'] |
|
|
|
|
); |
|
|
|
|
$courses['in_category'][$key1]['courses'][$key2]['student_info']['progress'] = $progress === false ? null : $progress; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($studentInfoScore) { |
|
|
|
|
$percentage_score = Tracking::get_avg_student_score( |
|
|
|
|
$user_id, |
|
|
|
|
$specialCourseInfo['course_code'], |
|
|
|
|
[] |
|
|
|
|
); |
|
|
|
|
$courses['in_category'][$key1]['courses'][$key2]['student_info']['score'] = $percentage_score; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($studentInfoCertificate) { |
|
|
|
|
$category = Category::load( |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
$courseInCatInfo['course_code'], |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
null |
|
|
|
|
); |
|
|
|
|
$courses['in_category'][$key1]['student_info']['certificate'] = null; |
|
|
|
|
$isCertificateAvailable = $category[0]->is_certificate_available($user_id); |
|
|
|
|
if (isset($category[0])) { |
|
|
|
|
if ($viewGrid) { |
|
|
|
|
if ($isCertificateAvailable) { |
|
|
|
|
$courses['in_category'][$key1]['student_info']['certificate'] = get_lang( |
|
|
|
|
'Yes' |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
$courses['in_category'][$key1]['student_info']['certificate'] = get_lang( |
|
|
|
|
'No' |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if ($isCertificateAvailable) { |
|
|
|
|
$courses['in_category'][$key1]['student_info']['certificate'] = Display::label( |
|
|
|
|
get_lang('Yes'), |
|
|
|
|
'success' |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
$courses['in_category'][$key1]['student_info']['certificate'] = Display::label( |
|
|
|
|
get_lang('No'), |
|
|
|
|
'danger' |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
if (isset($courses['not_category'])) { |
|
|
|
|
foreach ($courses['not_category'] as $key => $courseNotInCatInfo) { |
|
|
|
|
if ($studentInfoProgress) { |
|
|
|
@ -1274,9 +1211,6 @@ class IndexManager |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($viewGridCourses) { |
|
|
|
|
$coursesWithoutCategoryTemplate = '/user_portal/grid_courses.html.twig'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($specialCourses) { |
|
|
|
|
if ($categoryCodeFilter) { |
|
|
|
|