Skip to content

Commit 5d93178

Browse files
committed
Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x
2 parents 528fa01 + 087b25c commit 5d93178

File tree

8 files changed

+249
-41
lines changed

8 files changed

+249
-41
lines changed

app/Resources/public/css/base.css

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10030,6 +10030,10 @@ ul.dropdown-menu.inner > li > a {
1003010030
background-color: #fb5f0442 !important;
1003110031
color: #FF5722;
1003210032
}
10033+
.details-title{
10034+
font-weight: bold;
10035+
font-size: 22px;
10036+
}
1003310037
.details{
1003410038
margin-top: 2rem;
1003510039
padding: 1rem;
@@ -10080,6 +10084,71 @@ ul.dropdown-menu.inner > li > a {
1008010084
width: 100%;
1008110085
}
1008210086

10087+
.summary-course .course .title{
10088+
font-weight: bold;
10089+
font-size: 14px;
10090+
}
10091+
.summary-course .course .image{
10092+
margin-bottom: 10px;
10093+
}
10094+
.summary-course .course .info{
10095+
font-size: 12px;
10096+
}
10097+
.summary-course .list-donut{
10098+
display: grid;
10099+
grid-gap: 1rem;
10100+
grid-row-gap: 16px;
10101+
grid-template-columns: repeat(2, 1fr);
10102+
}
10103+
.summary-course .list-donut .easypiechart{
10104+
margin: 5px auto 5px auto;
10105+
width: 100px;
10106+
height: 100px;
10107+
}
10108+
.summary-course .list-donut .easypiechart .percent{
10109+
font-size: 20px;
10110+
top: 40px;
10111+
width: 100px;
10112+
}
10113+
.summary-course .list-donut .easypiechart canvas{
10114+
width: 100px;
10115+
height: 100px;
10116+
}
10117+
.summary-course .list-donut .easy-donut{
10118+
text-align: center;
10119+
}
10120+
.summary-course .state{
10121+
margin-bottom: 10px;
10122+
margin-top: 10px;
10123+
}
10124+
.summary-course .state .stat-heading{
10125+
text-align: center;
10126+
font-size: 12px;
10127+
}
10128+
.summary-course .state .stat-text {
10129+
font-size: 22px;
10130+
text-align: center;
10131+
}
10132+
.summary-course .state .stat-icon{
10133+
font-size: 30px;
10134+
text-align: center;
10135+
}
10136+
.summary-course .easypiechart-legend {
10137+
font-size: 12px;
10138+
}
10139+
.summary-course .list-info{
10140+
margin-bottom: 0;
10141+
}
10142+
.summary-course .list-info dt,
10143+
.summary-course .list-info dd
10144+
{
10145+
padding-top: 7px;
10146+
padding-bottom: 7px;
10147+
}
10148+
.summary-course .list-info .text-color{
10149+
color: #0A649F;
10150+
}
10151+
1008310152
@media (min-width: 768px) {
1008410153
.clear-rows-6-4-3 .col-sm-6:nth-child(2n+1) {
1008510154
clear: left;

main/inc/lib/myspace.lib.php

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -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
/**

main/mySpace/admin_view.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
$display = isset($_GET['display']) ? Security::remove_XSS($_GET['display']) : null;
1212

1313
$htmlHeadXtra[] = api_get_jqgrid_js();
14+
$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_PUBLIC_PATH).'assets/jquery.easy-pie-chart/dist/jquery.easypiechart.js"></script>';
15+
1416
// the section (for the tabs)
1517
$this_section = SECTION_TRACKING;
1618

main/mySpace/myStudents.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,13 @@
963963
}
964964

965965
$details = true;
966+
$tpl = new Template('',
967+
false,
968+
false,
969+
false,
970+
false,
971+
false,
972+
false);
966973

967974
if (!empty($courseInfo)) {
968975
$nb_assignments = Tracking::count_student_assignments($student_id, $course_code, $sessionId);
@@ -971,6 +978,8 @@
971978
$chat_last_connection = Tracking::chat_last_connection($student_id, $courseInfo['real_id'], $sessionId);
972979
$documents = Tracking::count_student_downloaded_documents($student_id, $courseInfo['real_id'], $sessionId);
973980
$uploaded_documents = Tracking::count_student_uploaded_documents($student_id, $course_code, $sessionId);
981+
$courseTitle = $courseInfo['title'];
982+
$tpl->assign('title', $courseTitle);
974983

975984
$userInfo['tools'] = [
976985
'tasks' => $nb_assignments,
@@ -984,13 +993,6 @@
984993
$details = false;
985994
}
986995

987-
$tpl = new Template('',
988-
false,
989-
false,
990-
false,
991-
false,
992-
false,
993-
false);
994996
$tpl->assign('user', $userInfo);
995997
$tpl->assign('details', $details);
996998
$templateName = $tpl->get_template('my_space/user_details.tpl');

main/template/default/admin/user_information.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{{ display.card_widget('LatestLoginInPlatform'|get_lang ,user.last_connection ,'calendar') }}
3737

3838
{{ display.card_widget('LegalAccepted'|get_lang ,user.legal.datetime ,'gavel' , user.legal.icon) }}
39-
39+
4040
</div>
4141
{% if social_tool %}
4242
<div class="list-box-widget">
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
<div class="summary-legend">
22
{{ table }}
3-
</div>
3+
</div>
4+
<script type="text/javascript">
5+
$(function() {
6+
$('.easypiechart-blue').easyPieChart({
7+
scaleColor: false,
8+
barColor: '#30a5ff',
9+
lineWidth:8,
10+
trackColor: '#f2f2f2'
11+
});
12+
});
13+
$(function() {
14+
$('.easypiechart-red').easyPieChart({
15+
scaleColor: false,
16+
barColor: '#f9243f',
17+
lineWidth:8,
18+
trackColor: '#f2f2f2'
19+
});
20+
});
21+
</script>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{% import 'default/macro/macro.tpl' as display %}
2+
3+
{% set content %}
4+
<div class="summary-course" id="summary-{{ data.id }}">
5+
<div class="row">
6+
<div class="col-md-2">
7+
<div class="course">
8+
<h4 class="title">{{ data.title }}</h4>
9+
<div class="image">
10+
<img src="{{ data.image_small }}" class="img-responsive"/>
11+
</div>
12+
<div class="info">
13+
{% if data.course_code %}
14+
<p><strong>{{ 'WantedCourseCode'|get_lang }}</strong><br>{{ data.course_code }}</p>
15+
{% endif %}
16+
{% if data.category %}
17+
<p><strong>{{ 'CourseFaculty'|get_lang }}</strong><br>{{ data.category }}</p>
18+
{% endif %}
19+
</div>
20+
</div>
21+
</div>
22+
<div class="col-md-2">
23+
<div class="state">
24+
<div class="stat-text">
25+
<i class="fa fa-clock-o" aria-hidden="true"></i> {{ data.time_spent }}
26+
</div>
27+
<div class="stat-heading">
28+
{{ 'TimeSpentInTheCourse'|get_lang }}
29+
</div>
30+
</div>
31+
<div class="state">
32+
<div class="stat-text">
33+
{{ data.total_score }}
34+
</div>
35+
<div class="stat-heading">
36+
{{ 'TotalExercisesScoreObtained'|get_lang }}
37+
</div>
38+
</div>
39+
</div>
40+
<div class="col-md-4">
41+
<div class="list-donut">
42+
<div class="easy-donut">
43+
<div class="easypiechart-blue easypiechart" title="{{ 'Progress'|get_lang }}" data-percent="{{ data.avg_progress }}">
44+
<span class="percent">{{ data.avg_progress }}%</span>
45+
</div>
46+
<div class="easypiechart-legend">
47+
{{ 'AvgStudentsProgress'|get_lang }}
48+
</div>
49+
</div>
50+
<div class="easy-donut">
51+
<div class="easypiechart-blue easypiechart" title="{{ 'Progress'|get_lang }}" data-percent="{{ data.avg_score }}">
52+
<span class="percent">{{ data.avg_score }}%</span>
53+
</div>
54+
<div class="easypiechart-legend">
55+
{{ 'AvgCourseScore'|get_lang }}
56+
</div>
57+
</div>
58+
</div>
59+
</div>
60+
<div class="col-md-4">
61+
62+
<dl class="dl-horizontal list-info">
63+
<dt>
64+
<span title="{{ 'TotalNumberOfMessages'|get_lang }}">{{ 'TotalNumberOfMessages'|get_lang }}</span>
65+
</dt>
66+
<dd>
67+
<span class="text-color"><i class="fa fa-comments" aria-hidden="true"></i></span>
68+
<span class="text-color">{{ data.number_message }}</span>
69+
</dd>
70+
<dt>
71+
<span title="{{ 'TotalNumberOfAssignments'|get_lang }}">{{ 'TotalNumberOfAssignments'|get_lang }}</span>
72+
</dt>
73+
<dd>
74+
<span class="text-color"><i class="fa fa-pencil" aria-hidden="true"></i></span>
75+
<span class="text-color">{{ data.number_assignments }}</span>
76+
</dd>
77+
<dt>
78+
<span title="{{ 'TotalExercisesAnswered'|get_lang }}">{{ 'TotalExercisesAnswered'|get_lang }}</span>
79+
</dt>
80+
<dd>
81+
<span class="text-color"><i class="fa fa-file-text" aria-hidden="true"></i></span>
82+
<span class="text-color">{{ data.questions_answered }}</span>
83+
</dd>
84+
<dt>
85+
<span title="{{ 'LatestLogin'|get_lang }}">{{ 'LatestLogin'|get_lang }}</span>
86+
</dt>
87+
<dd>
88+
<span class="text-color"><i class="fa fa-clock-o" aria-hidden="true"></i></span>
89+
<span class="text-color">{{ data.last_login }}</span>
90+
</dd>
91+
92+
</dl>
93+
94+
</div>
95+
</div>
96+
</div>
97+
{% endset %}
98+
99+
{{ display.panel('',content ,'') }}

main/template/default/my_space/user_details.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
{% if title %}
2+
<h2 class="details-title"><img src="{{ 'course.png'|icon(32) }}"> {{ title }}</h2>
3+
{% endif %}
4+
15
<div class="page-header">
26
<h3>{{ user.complete_name }}</h3>
37
</div>

0 commit comments

Comments
 (0)