Skip to content
Permalink
Browse files

adding statistical charts in course reports - refs #2717

  • Loading branch information...
aragonc committed Oct 31, 2018
1 parent 75e0193 commit 0d0d48fd5cecf54565e6e7e9f9f484b38d7d6b55
@@ -8207,6 +8207,55 @@ ul#toolnavbox-two li a.btn {

/**** END LP COLLAPSE CATEGORY ****/

/**** TRACKING ****/
.tracking .panel-body{
padding: 5px;
}
.tracking .tracking-icon{
display: block;
float: left;
height: 70px;
width: 70px;
text-align: center;
line-height: 70px;
font-size: 45px;
}
.tracking .tracking-info{
padding: 5px 10px;
margin-left: 70px;
}
.tracking .tracking-info .tracking-text{
display: block;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tracking .tracking-info .tracking-number{
display: block;
font-weight: bold;
font-size: 2em;
}
.tracking-student{
background-color: #7460ee;
border-color: #7460ee;
color: #ffffff;
}
.tracking-lessons{
background-color: #26c6da;
border-color: #26c6da;
color: #ffffff;
}
.tracking-exercise{
background-color: #fc4b6c;
border-color: #fc4b6c;
color: #ffffff;
}
.tracking-certificate{
background-color: #ffb22b;
border-color: #ffb22b;
color: #ffffff;
}
/* CSS Responsive */
@media (min-width: 1025px) and (max-width: 1200px) {
.sidebar-scorm {
@@ -75,6 +75,7 @@
// thematic controller object
$thematic_controller = new ThematicController();
$thematic_data = [];
if (!empty($thematic_id)) {
// thematic data by id
@@ -180,6 +181,7 @@ function check_per_custom_date(obj) {
$thematicControl = Session::read('thematic_control');
if ($action == 'thematic_list') {
$interbreadcrumb[] = ['url' => '#', 'name' => get_lang('ThematicControl')];
}
@@ -0,0 +1,82 @@
<!-- tracking course log -->
<div class="tracking-course-summary">
<div class="row">
<div class="col-lg-3 col-sm-3">
<div class="panel panel-default tracking tracking-student">
<div class="panel-body">
<span class="tracking-icon">
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
</span>
<div class="tracking-info">
<div class="tracking-text"> Estudiantes inscritos</div>
<div class="tracking-number">
{{ number_students }}
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="panel panel-default tracking tracking-lessons">
<div class="panel-body">

<span class="tracking-icon">
<i class="fa fa-book" aria-hidden="true"></i>
</span>
<div class="tracking-info">
<div class="tracking-text"> Estudiantes que completaron las lecciones</div>
<div class="tracking-number">
{{ students_completed_lp }}/{{ number_students }}
</div>
</div>

</div>
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="panel panel-default tracking tracking-exercise">
<div class="panel-body">

<span class="tracking-icon">
<i class="fa fa-heartbeat" aria-hidden="true"></i>
</span>
<div class="tracking-info">
<div class="tracking-text"> Media de ejercicios del total de estudiantess</div>
<div class="tracking-number">
{{ students_test_score }}%
</div>
</div>

</div>
</div>
</div>
<div class="col-lg-3 col-sm-3">
<div class="panel panel-default tracking tracking-certificate">
<div class="panel-body">

<span class="tracking-icon">
<i class="fa fa-id-card-o" aria-hidden="true"></i>
</span>
<div class="tracking-info">
<div class="tracking-text"> Cantidad de certificados entregados</div>
<div class="tracking-number">
1/3
</div>
</div>

</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="tracking-chart">

</div>
</div>
<div class="col-md-6">
.
</div>
</div>
</div>

@@ -10,14 +10,16 @@
$current_course_tool = TOOL_TRACKING;
$courseInfo = api_get_course_info(api_get_course_id());
$courseCode = $courseInfo['code'];
$course_code = $courseCode = $courseInfo['code'];
$from_myspace = false;
$from = isset($_GET['from']) ? $_GET['from'] : null;
// Starting the output buffering when we are exporting the information.
$export_csv = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
$session_id = isset($_REQUEST['id_session']) ? (int) $_REQUEST['id_session'] : 0;
$this_section = SECTION_COURSES;
if ($from == 'myspace') {
$from_myspace = true;
@@ -157,12 +159,17 @@ function(index) {
$view = isset($_REQUEST['view']) ? $_REQUEST['view'] : '';
$nameTools = get_lang('Tracking');
//Template Tracking
$tpl = new Template($nameTools);
// getting all the students of the course
if (empty($session_id)) {
// Registered students in a course outside session.
$a_students = CourseManager::get_student_list_from_course_code(
api_get_course_id()
);
} else {
// Registered students in session.
$a_students = CourseManager::get_student_list_from_course_code(
@@ -173,6 +180,7 @@ function(index) {
}
$nbStudents = count($a_students);
$user_ids = array_keys($a_students);
$extra_info = [];
$userProfileInfo = [];
// Getting all the additional information of an additional profile field.
@@ -243,6 +251,8 @@ function(index) {
);
$course_name = get_lang('Course').' '.$courseInfo['name'];
if ($session_id) {
$titleSession = Display::return_icon(
'session.png',
@@ -330,6 +340,31 @@ function(index) {
}
}
$usersTracking = TrackingCourseLog::get_user_data(null, $nbStudents, null, 'DESC');
$numberStudentsCompletedLP = 0;
$averageStudentsTestScore = 0;
foreach ($usersTracking as $userTracking) {
if ($userTracking[5] == '100%') {
$numberStudentsCompletedLP++;
}
$averageStudentTestScore = substr($userTracking[7], 0, -1);
$averageStudentsTestScore += $averageStudentTestScore;
}
$averageStudentsTestScore = round(($averageStudentsTestScore / $nbStudents));
$tpl->assign('students_test_score',$averageStudentsTestScore);
$tpl->assign('students_completed_lp',$numberStudentsCompletedLP);
$tpl->assign('number_students',$nbStudents);
$trackingSummaryLayout = $tpl->get_template("tracking/tracking_course_log.tpl");
$content = $tpl->fetch($trackingSummaryLayout);
echo $content;
$html .= Display::page_subheader2(get_lang('StudentList'));
// PERSON_NAME_DATA_EXPORT is buggy
@@ -386,12 +421,13 @@ function(index) {
$all_datas = [];
$course_code = $_course['id'];
$user_ids = array_keys($a_students);
$table = new SortableTable(
'users_tracking',
['TrackingCourseLog', 'get_number_of_users'],
['TrackingCourseLog', 'get_user_data'],
function () use ($usersTracking) {

This comment has been minimized.

Copy link
@jmontoyaa

jmontoyaa Nov 16, 2018

Member

This change breaks the csv export:

https://task.beeznest.com/issues/15071

This comment has been minimized.

Copy link
@jmontoyaa

This comment has been minimized.

Copy link
@jmontoyaa

jmontoyaa Dec 6, 2018

Member

This breaks the column order buttons

https://task.beeznest.com/issues/15123

This comment has been minimized.

Copy link
@jmontoyaa

jmontoyaa Dec 6, 2018

Member

And actually pagination doesn't work at all ...

This comment has been minimized.

Copy link
@jmontoyaa

jmontoyaa Dec 6, 2018

Member

---I'm undo this changes, this have to be build in a different way.--

You need total user information, but you changed the table in order to show all users ... so pagination doesn't work.

This comment has been minimized.

Copy link
@jmontoyaa

jmontoyaa Dec 6, 2018

Member

Well is too bad to lose all this feature. I'm assigning you that task. I did not undo the changes.

This comment has been minimized.

Copy link
@aragonc

aragonc Dec 7, 2018

Author Member

Con Yannick realizamos esa forma de llamada solo una vez esta funcion para no hacer doble carga, pero vere que puedo hacer

This comment has been minimized.

Copy link
@ywarnier

ywarnier Dec 7, 2018

Member

Alex sent some changes in 87fc378

return $usersTracking;
},
1
);
@@ -400,6 +436,8 @@ function(index) {
$parameters['from'] = isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null;
$table->set_additional_parameters($parameters);
$headers = [];
// tab of header texts
$table->set_header(0, get_lang('OfficialCode'), true);

0 comments on commit 0d0d48f

Please sign in to comment.
You can’t perform that action at this time.