diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index 06ddc7245a..ac65dc46d0 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -10106,17 +10106,37 @@ ul.dropdown-menu.inner > li > a { .summary-course .list-donut .easy-donut{ text-align: center; } -.summary-course .state-time .stat-heading{ +.summary-course .state{ + margin-bottom: 10px; + margin-top: 10px; +} +.summary-course .state .stat-heading{ text-align: center; + font-size: 12px; } -.summary-course .state-time .stat-text { - font-size: 24px; +.summary-course .state .stat-text { + font-size: 22px; text-align: center; } -.summary-course .state-time .stat-icon{ +.summary-course .state .stat-icon{ font-size: 30px; text-align: center; } +.summary-course .easypiechart-legend { + font-size: 12px; +} +.summary-course .list-info{ + margin-bottom: 0; +} +.summary-course .list-info dt, +.summary-course .list-info dd +{ + padding-top: 7px; + padding-bottom: 7px; +} +.summary-course .list-info .text-color{ + color: #0A649F; +} @media (min-width: 768px) { .clear-rows-6-4-3 .col-sm-6:nth-child(2n+1) { clear: left; diff --git a/main/inc/lib/myspace.lib.php b/main/inc/lib/myspace.lib.php index c2461e0ec3..74cbe6b355 100644 --- a/main/inc/lib/myspace.lib.php +++ b/main/inc/lib/myspace.lib.php @@ -1042,7 +1042,7 @@ class MySpace */ public static function display_tracking_course_overview() { - $t_head = ''; + /*$t_head = '
'; $t_head .= ''; $t_head .= ''; $t_head .= ''; @@ -1052,21 +1052,32 @@ class MySpace $t_head .= ''; $t_head .= ''; $t_head .= ''; - $t_head .= '
'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).''.cut(get_lang('AvgStudentsProgress'), 6, true).''.get_lang('TotalExercisesScoreObtained').''.cut(get_lang('TotalExercisesAnswered'), 6, true).''.get_lang('LatestLogin').'
'; + $t_head .= '';*/ $params = ['view' => 'admin', 'display' => 'courseoverview']; $table = new SortableTable( 'tracking_session_overview', ['MySpace', 'get_total_number_courses'], ['MySpace', 'get_course_data_tracking_overview'], - 1 + 1, + 20, + 'ASC', + null,[ + 'class' => 'table table-transparent' + ] ); $table->additional_parameters = $params; - $table->set_header(0, '', false, null, ['style' => 'display: none']); - $table->set_header(1, get_lang('Course'), true, ['style' => 'font-size:8pt'], ['style' => 'font-size:8pt']); - $table->set_header(2, $t_head, false, ['style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'], ['style' => 'width:90%;padding:0;font-size:7.5pt;']); - $table->set_column_filter(2, ['MySpace', 'course_tracking_filter']); - $table->display(); + //$table->set_header(0, '', false, null, ['style' => 'display: none']); + //$table->set_header(1, get_lang('Course'), true, ['style' => 'font-size:8pt'], ['style' => 'font-size:8pt']); + //$table->set_header(2, $t_head, false, ['style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'], ['style' => 'width:90%;padding:0;font-size:7.5pt;']); + $table->set_column_filter(0, ['MySpace', 'course_tracking_filter']); + + $tableContent = $table->return_table(); + + $tpl = new Template('', false, false, false, false, false, false); + $tpl->assign('table', $tableContent); + $templateName = $tpl->get_template('my_space/course_summary.tpl'); + $tpl->display($templateName); } /** @@ -1109,9 +1120,7 @@ class MySpace foreach ($courses as $course) { $list[] = [ '0' => $course['code'], - 'col0' => $course['code'], - '1' => $course['title'], - 'col1' => $course['title'], + 'col0' => $course['code'] ]; } @@ -1133,8 +1142,8 @@ class MySpace $courseInfo = api_get_course_info($course_code); $courseId = $courseInfo['real_id']; - // the table header - $return = ''; + $tpl = new Template('', false, false, false, false, false, false); + $data = null; // database table definition $tbl_course_rel_user = Database::get_main_table(TABLE_MAIN_COURSE_USER); @@ -1245,26 +1254,31 @@ class MySpace } else { $total_score = '-'; } - $return .= ''; - // time spent in the course - $return .= ' '; - // student progress in course - $return .= ' '; - // student score - $return .= ' '; - // student messages - $return .= ' '; - // student assignments - $return .= ' '; - // student exercises results (obtained score, maximum score, number of exercises answered, score percentage) - $return .= ''; - $return .= ''; - // last connection - $return .= ' '; - $return .= ''; - $return .= '
'.api_time_to_hms($time_spent).''.$avg_progress.''.$avg_score.''.$nb_messages.''.$nb_assignments.''.$total_score.''.$total_questions_answered.''.$last_login_date.'
'; - return $return; + + $data = [ + 'course_code' => $course_code, + 'id' => $courseId, + 'image' => $courseInfo['course_image_large'], + 'image_small' => $courseInfo['course_image'], + 'title' => $courseInfo['title'], + 'url' => $courseInfo['course_public_url'], + 'category' => $courseInfo['categoryName'], + 'time_spent' => api_time_to_hms($time_spent), + 'avg_progress' => $avg_progress, + 'avg_score' => $avg_score, + 'number_message' => $nb_messages, + 'number_assignments' => $nb_assignments, + 'total_score' => $total_score, + 'questions_answered' => $total_questions_answered, + 'last_login' => $last_login_date + ]; + + $tpl->assign('data', $data); + $layout = $tpl->get_template('my_space/partials/tracking_course_overview.tpl'); + $content = $tpl->fetch($layout); + + return $content; } /** diff --git a/main/mySpace/admin_view.php b/main/mySpace/admin_view.php index 25c4825c63..6cbd2472c3 100644 --- a/main/mySpace/admin_view.php +++ b/main/mySpace/admin_view.php @@ -11,6 +11,8 @@ $exportCSV = isset($_GET['export']) && $_GET['export'] === 'csv' ? true : false; $display = isset($_GET['display']) ? Security::remove_XSS($_GET['display']) : null; $htmlHeadXtra[] = api_get_jqgrid_js(); +$htmlHeadXtra[] = ''; + // the section (for the tabs) $this_section = SECTION_TRACKING; diff --git a/main/template/default/admin/user_information.tpl b/main/template/default/admin/user_information.tpl index ca71698979..8e032059c5 100644 --- a/main/template/default/admin/user_information.tpl +++ b/main/template/default/admin/user_information.tpl @@ -36,7 +36,7 @@ {{ display.card_widget('LatestLoginInPlatform'|get_lang ,user.last_connection ,'calendar') }} {{ display.card_widget('LegalAccepted'|get_lang ,user.legal.datetime ,'gavel' , user.legal.icon) }} - + {% if social_tool %}
diff --git a/main/template/default/my_space/course_summary.tpl b/main/template/default/my_space/course_summary.tpl index 6f33f16908..2b9bbd7d7d 100644 --- a/main/template/default/my_space/course_summary.tpl +++ b/main/template/default/my_space/course_summary.tpl @@ -1,3 +1,21 @@
{{ table }} -
\ No newline at end of file +
+ \ No newline at end of file diff --git a/main/template/default/my_space/partials/tracking_course_overview.tpl b/main/template/default/my_space/partials/tracking_course_overview.tpl new file mode 100644 index 0000000000..923a98bef7 --- /dev/null +++ b/main/template/default/my_space/partials/tracking_course_overview.tpl @@ -0,0 +1,99 @@ +{% import 'default/macro/macro.tpl' as display %} + +{% set content %} +
+
+
+
+

{{ data.title }}

+
+ +
+
+ {% if data.course_code %} +

{{ 'WantedCourseCode'|get_lang }}
{{ data.course_code }}

+ {% endif %} + {% if data.category %} +

{{ 'CourseFaculty'|get_lang }}
{{ data.category }}

+ {% endif %} +
+
+
+
+
+
+ {{ data.time_spent }} +
+
+ {{ 'TimeSpentInTheCourse'|get_lang }} +
+
+
+
+ {{ data.total_score }} +
+
+ {{ 'TotalExercisesScoreObtained'|get_lang }} +
+
+
+
+
+
+
+ {{ data.avg_progress }}% +
+
+ {{ 'AvgStudentsProgress'|get_lang }} +
+
+
+
+ {{ data.avg_score }}% +
+
+ {{ 'AvgCourseScore'|get_lang }} +
+
+
+
+
+ +
+
+ {{ 'TotalNumberOfMessages'|get_lang }} +
+
+ + {{ data.number_message }} +
+
+ {{ 'TotalNumberOfAssignments'|get_lang }} +
+
+ + {{ data.number_assignments }} +
+
+ {{ 'TotalExercisesAnswered'|get_lang }} +
+
+ + {{ data.questions_answered }} +
+
+ {{ 'LatestLogin'|get_lang }} +
+
+ + {{ data.last_login }} +
+ +
+ +
+
+
+{% endset %} + +{{ display.panel('',content ,'') }} \ No newline at end of file