Minor - flint fixes

pull/2729/head
Julio Montoya 8 years ago
parent 6d09bf9ed8
commit a12bdcd5ea
  1. 1
      main/course_progress/index.php
  2. 2
      main/inc/lib/usermanager.lib.php
  3. 29
      main/tracking/courseLog.php
  4. 3
      plugin/card_game/resources/ajax.card.php
  5. 12
      src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php

@ -181,7 +181,6 @@ function check_per_custom_date(obj) {
$thematicControl = Session::read('thematic_control');
if ($action == 'thematic_list') {
$interbreadcrumb[] = ['url' => '#', 'name' => get_lang('ThematicControl')];
}

@ -1292,6 +1292,7 @@ class UserManager
$emailBody = $tplContent->fetch($layoutContent);
$mailTemplateManager = new MailTemplateManager();
if (!empty($emailTemplate) &&
isset($emailTemplate['user_edit_content.tpl']) &&
!empty($emailTemplate['user_edit_content.tpl'])
@ -1299,7 +1300,6 @@ class UserManager
$userInfo = api_get_user_info($user_id);
$emailBody = $mailTemplateManager->parseTemplate($emailTemplate['user_edit_content.tpl'], $userInfo);
}
api_mail_html(
$recipient_name,
$email,

@ -1,8 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use ChamiloSession as Session;
/**
* @package chamilo.tracking
@ -171,7 +171,6 @@ if (empty($session_id)) {
$a_students = CourseManager::get_student_list_from_course_code(
$courseId
);
} else {
// Registered students in session.
$a_students = CourseManager::get_student_list_from_course_code(
@ -347,7 +346,7 @@ if ($nbStudents > 0) {
$numberStudentsCompletedLP = 0;
$averageStudentsTestScore = 0;
$scoresDistribution = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
$userScoreList = [];
$listStudentIds = [];
$timeStudent = [];
@ -368,7 +367,7 @@ if ($nbStudents > 0) {
}
$averageStudentTestScore = substr($userTracking[7], 0, -1);
$averageStudentsTestScore += $averageStudentTestScore;
if ($averageStudentTestScore === '100') {
$reducedAverage = 9;
} else {
@ -380,30 +379,30 @@ if ($nbStudents > 0) {
$scoreStudent = substr($userTracking[5], 0, -1) + substr($userTracking[7], 0, -1);
list($hours, $minutes, $seconds) = preg_split('/:/', $userTracking[4]);
$minutes = round((3600 * $hours + 60 * $minutes + $seconds) / 60);
$certificate = false;
if (isset($category[0]) && $category[0]->is_certificate_available($userId)) {
$certificate = true;
$certificateCount++;
}
$listStudent = [
'id' => $userId,
'fullname' => $userTracking[2] . ', ' . $userTracking[1],
'fullname' => $userTracking[2].', '.$userTracking[1],
'score' => floor($scoreStudent / 2),
'total_time' => $minutes,
'avatar' => UserManager::getUserPicture($userId),
'certicate' => $certificate
'certicate' => $certificate,
];
$listStudentIds[] = $userId;
$userScoreList[] = $listStudent;
}
uasort($userScoreList, 'sort_by_order');
$averageStudentsTestScore = round($averageStudentsTestScore / $nbStudents);
$colors = ChamiloApi::getColorPalette(true, true, 10);
$tpl->assign('chart_colors', json_encode($colors));
$tpl->assign('certificate_count', $certificateCount);
$tpl->assign('score_distribution', json_encode($scoresDistribution));
@ -412,11 +411,10 @@ if ($nbStudents > 0) {
$tpl->assign('students_completed_lp', $numberStudentsCompletedLP);
$tpl->assign('number_students', $nbStudents);
$tpl->assign('top_students', $userScoreList);
$trackingSummaryLayout = $tpl->get_template("tracking/tracking_course_log.tpl");
$content = $tpl->fetch($trackingSummaryLayout);
echo $content;
}
@ -492,7 +490,6 @@ if (count($a_students) > 0) {
$table->set_additional_parameters($parameters);
$headers = [];
// tab of header texts
$table->set_header(0, get_lang('OfficialCode'), true);
@ -653,9 +650,7 @@ if ($export_csv) {
}
Display::display_footer();
function sort_by_order($a, $b)
{
return $a['score'] <= $b['score'];
}

@ -16,7 +16,6 @@ require_once __DIR__.'/../../../main/inc/global.inc.php';
$cardGameSession = Session::read('cardgame');
if (!empty($cardGameSession)) {
if ($cardGameSession == 'havedeck') {
$part = '1';
if (isset($_GET['part'])) {
@ -24,7 +23,6 @@ if (!empty($cardGameSession)) {
$userId = api_get_user_id();
if (isset($userId)) {
$sql = "UPDATE plugin_card_game
SET access_date = CURDATE(), parts = CONCAT(parts,'!!$part;!')
WHERE user_id = $userId";
@ -47,7 +45,6 @@ if (!empty($cardGameSession)) {
Database::query($sql);
Session::write('cardgame', 'done');
}
}
}
}

@ -289,12 +289,15 @@ class ChamiloApi
return api_get_path(WEB_CSS_PATH).'editor_content.css';
}
/**
* Get a list of colors from the palette at main/palette/pchart/default.color
* and return it as an array of strings
* and return it as an array of strings.
*
* @param bool $decimalOpacity Whether to return the opacity as 0..100 or 0..1
* @param bool $wrapInRGBA Whether to return it as 1,1,1,100 or rgba(1,1,1,100)
* @param int $fillUpTo If the number of colors is smaller than this number, generate more colors
* @param bool $wrapInRGBA Whether to return it as 1,1,1,100 or rgba(1,1,1,100)
* @param int $fillUpTo If the number of colors is smaller than this number, generate more colors
*
* @return array An array of string colors
*/
public static function getColorPalette(
@ -324,9 +327,10 @@ class ChamiloApi
$count = count($palette);
if (isset($fillUpTo) && $fillUpTo > $count) {
for ($i = $count; $i < $fillUpTo; $i++) {
$palette[$i] = $palette[$i%$count];
$palette[$i] = $palette[$i % $count];
}
}
return $palette;
}
}

Loading…
Cancel
Save