@@ -1042,7 +1042,7 @@ public static function display_user_overview_export_options()
10421042 */
10431043 public static function display_tracking_course_overview ()
10441044 {
1045- $ t_head = '<table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed"> ' ;
1045+ /* $t_head = '<table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
10461046 $t_head .= '<tr>';
10471047 $t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
10481048 $t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
@@ -1052,21 +1052,32 @@ public static function display_tracking_course_overview()
10521052 $t_head .= '<th width="105px" style="border-bottom:0"><span>'.get_lang('TotalExercisesScoreObtained').'</span></th>';
10531053 $t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('TotalExercisesAnswered'), 6, true).'</span></th>';
10541054 $t_head .= '<th style="padding:0;border-bottom:0;border-right:0;"><span>'.get_lang('LatestLogin').'</span></th>';
1055- $ t_head .= '</tr></table> ' ;
1055+ $t_head .= '</tr></table>';*/
10561056 $ params = ['view ' => 'admin ' , 'display ' => 'courseoverview ' ];
10571057 $ table = new SortableTable (
10581058 'tracking_session_overview ' ,
10591059 ['MySpace ' , 'get_total_number_courses ' ],
10601060 ['MySpace ' , 'get_course_data_tracking_overview ' ],
1061- 1
1061+ 1 ,
1062+ 20 ,
1063+ 'ASC ' ,
1064+ null ,[
1065+ 'class ' => 'table table-transparent '
1066+ ]
10621067 );
10631068 $ table ->additional_parameters = $ params ;
10641069
1065- $ table ->set_header (0 , '' , false , null , ['style ' => 'display: none ' ]);
1066- $ table ->set_header (1 , get_lang ('Course ' ), true , ['style ' => 'font-size:8pt ' ], ['style ' => 'font-size:8pt ' ]);
1067- $ 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; ' ]);
1068- $ table ->set_column_filter (2 , ['MySpace ' , 'course_tracking_filter ' ]);
1069- $ table ->display ();
1070+ //$table->set_header(0, '', false, null, ['style' => 'display: none']);
1071+ //$table->set_header(1, get_lang('Course'), true, ['style' => 'font-size:8pt'], ['style' => 'font-size:8pt']);
1072+ //$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;']);
1073+ $ table ->set_column_filter (0 , ['MySpace ' , 'course_tracking_filter ' ]);
1074+
1075+ $ tableContent = $ table ->return_table ();
1076+
1077+ $ tpl = new Template ('' , false , false , false , false , false , false );
1078+ $ tpl ->assign ('table ' , $ tableContent );
1079+ $ templateName = $ tpl ->get_template ('my_space/course_summary.tpl ' );
1080+ $ tpl ->display ($ templateName );
10701081 }
10711082
10721083 /**
@@ -1109,9 +1120,7 @@ public static function get_course_data_tracking_overview(
11091120 foreach ($ courses as $ course ) {
11101121 $ list [] = [
11111122 '0 ' => $ course ['code ' ],
1112- 'col0 ' => $ course ['code ' ],
1113- '1 ' => $ course ['title ' ],
1114- 'col1 ' => $ course ['title ' ],
1123+ 'col0 ' => $ course ['code ' ]
11151124 ];
11161125 }
11171126
@@ -1133,8 +1142,8 @@ public static function course_tracking_filter($course_code, $url_params, $row)
11331142 $ courseInfo = api_get_course_info ($ course_code );
11341143 $ courseId = $ courseInfo ['real_id ' ];
11351144
1136- // the table header
1137- $ return = ' <table class="data_table" style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed"> ' ;
1145+ $ tpl = new Template ( '' , false , false , false , false , false , false );
1146+ $ data = null ;
11381147
11391148 // database table definition
11401149 $ tbl_course_rel_user = Database::get_main_table (TABLE_MAIN_COURSE_USER );
@@ -1245,26 +1254,31 @@ public static function course_tracking_filter($course_code, $url_params, $row)
12451254 } else {
12461255 $ total_score = '- ' ;
12471256 }
1248- $ return .= '<tr> ' ;
1249- // time spent in the course
1250- $ return .= ' <td style="width:164px;"> ' .api_time_to_hms ($ time_spent ).'</td> ' ;
1251- // student progress in course
1252- $ return .= ' <td> ' .$ avg_progress .'</td> ' ;
1253- // student score
1254- $ return .= ' <td> ' .$ avg_score .'</td> ' ;
1255- // student messages
1256- $ return .= ' <td> ' .$ nb_messages .'</td> ' ;
1257- // student assignments
1258- $ return .= ' <td> ' .$ nb_assignments .'</td> ' ;
1259- // student exercises results (obtained score, maximum score, number of exercises answered, score percentage)
1260- $ return .= '<td width="105px;"> ' .$ total_score .'</td> ' ;
1261- $ return .= '<td> ' .$ total_questions_answered .'</td> ' ;
1262- // last connection
1263- $ return .= ' <td> ' .$ last_login_date .'</td> ' ;
1264- $ return .= '</tr> ' ;
1265- $ return .= '</table> ' ;
12661257
1267- return $ return ;
1258+
1259+ $ data = [
1260+ 'course_code ' => $ course_code ,
1261+ 'id ' => $ courseId ,
1262+ 'image ' => $ courseInfo ['course_image_large ' ],
1263+ 'image_small ' => $ courseInfo ['course_image ' ],
1264+ 'title ' => $ courseInfo ['title ' ],
1265+ 'url ' => $ courseInfo ['course_public_url ' ],
1266+ 'category ' => $ courseInfo ['categoryName ' ],
1267+ 'time_spent ' => api_time_to_hms ($ time_spent ),
1268+ 'avg_progress ' => $ avg_progress ,
1269+ 'avg_score ' => $ avg_score ,
1270+ 'number_message ' => $ nb_messages ,
1271+ 'number_assignments ' => $ nb_assignments ,
1272+ 'total_score ' => $ total_score ,
1273+ 'questions_answered ' => $ total_questions_answered ,
1274+ 'last_login ' => $ last_login_date
1275+ ];
1276+
1277+ $ tpl ->assign ('data ' , $ data );
1278+ $ layout = $ tpl ->get_template ('my_space/partials/tracking_course_overview.tpl ' );
1279+ $ content = $ tpl ->fetch ($ layout );
1280+
1281+ return $ content ;
12681282 }
12691283
12701284 /**
0 commit comments