Minor - format code

webservicelpcreate
Julio Montoya 5 years ago committed by admin beeznest
parent 9701c3bf61
commit fab709d301
  1. 13
      main/gradebook/gradebook_display_summary.php
  2. 7
      main/gradebook/lib/be/category.class.php
  3. 13
      main/gradebook/lib/be/exerciselink.class.php
  4. 2
      main/gradebook/user_stats.php
  5. 2
      main/mySpace/session.php

@ -3,9 +3,6 @@
use ChamiloSession as Session;
/**
* @package chamilo.gradebook
*/
require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_GRADEBOOK;
@ -177,7 +174,8 @@ $allowSkillRelItem = api_get_configuration_value('allow_skill_rel_items');
if (count($userList) == 0) {
echo Display::return_message(get_lang('NoResultsAvailable'), 'warning');
} else {
echo '<br /><br /><table class="data_table">';
echo '<br /><br /><div class="table-responsive">
<table class="table table-hover table-striped table-bordered data_table">';
echo '<tr><th>';
echo get_lang('Student');
echo '</th>';
@ -185,13 +183,14 @@ if (count($userList) == 0) {
echo get_lang('Action');
echo '</th></tr>';
foreach ($userList as $index => $value) {
$userData = api_get_person_name($value['firstname'], $value['lastname']).' ('.$value['username'].')';
echo '<tr>
<td width="70%">'
.api_get_person_name($value['firstname'], $value['lastname']).' ('.$value['username'].') </td>';
<td width="70%">'.$userData.'</td>';
echo '<td>';
$link = '';
if ($allowSkillRelItem) {
$url = api_get_path(WEB_CODE_PATH).'gradebook/skill_rel_user.php?'.api_get_cidreq().'&user_id='.$value['user_id'].'&selectcat='.$cat_id;
$url = api_get_path(WEB_CODE_PATH).
'gradebook/skill_rel_user.php?'.api_get_cidreq().'&user_id='.$value['user_id'].'&selectcat='.$cat_id;
$link = Display::url(
get_lang('Skills'),
$url,

@ -910,7 +910,6 @@ class Category implements GradebookItem
$count = 0;
$ressum = 0;
$weightsum = 0;
if (!empty($cats)) {
/** @var Category $cat */
foreach ($cats as $cat) {
@ -1079,8 +1078,10 @@ class Category implements GradebookItem
foreach ($links as $link) {
$linkres = $link->calc_score($studentId, null);
$linkweight = $link->get_weight();
$link_res_denom = 0 == $linkres[1] ? 1 : $linkres[1];
$ressum = $linkres[0] / $link_res_denom * $linkweight;
if ($linkres) {
$link_res_denom = 0 == $linkres[1] ? 1 : $linkres[1];
$ressum = $linkres[0] / $link_res_denom * $linkweight;
}
if (!isset($totalScorePerStudent[$studentId])) {
$totalScorePerStudent[$studentId] = 0;

@ -197,7 +197,6 @@ class ExerciseLink extends AbstractLink
public function calc_score($stud_id = null, $type = null)
{
$allowStats = api_get_configuration_value('allow_gradebook_stats');
if ($allowStats) {
$link = $this->entity;
if (!empty($link)) {
@ -206,21 +205,19 @@ class ExerciseLink extends AbstractLink
switch ($type) {
case 'best':
$bestResult = $link->getBestScore();
$result = [$bestResult, $weight];
return $result;
return [$bestResult, $weight];
break;
case 'average':
$count = count($this->getStudentList());
if (empty($count)) {
$result = [0, $weight];
return $result;
return [0, $weight];
}
$sumResult = array_sum($link->getUserScoreList());
$result = [$sumResult / $count, $weight];
return $result;
return [$sumResult / $count, $weight];
break;
case 'ranking':
return [null, null];

@ -54,7 +54,7 @@ if (isset($_GET['exportpdf'])) {
$newarray[] = array_slice($data, 1);
}
$userInfo = api_get_user_info($userId);
$html .= get_lang('Results').' : '.$userInfo['complete_name_with_username'].' ('.api_get_local_time().')';
$html = get_lang('Results').' : '.$userInfo['complete_name_with_username'].' ('.api_get_local_time().')';
if ($displayscore->is_custom()) {
$header_names = [

@ -292,7 +292,7 @@ switch ($action) {
);
}
$name = $sessionInfo['name'].'_'.api_get_utc_datetime().'.zip';
$result = DocumentManager::file_send_for_download($tempZipFile, true, $name);
DocumentManager::file_send_for_download($tempZipFile, true, $name);
exit;
break;
}

Loading…
Cancel
Save