Minor - fix format

pull/3388/head
Julio Montoya 6 years ago
parent bba8022c79
commit 3e49140b70
  1. 6
      main/gradebook/index.php
  2. 4
      main/gradebook/lib/be/category.class.php
  3. 21
      main/gradebook/lib/be/exerciselink.class.php
  4. 26
      main/gradebook/lib/fe/gradebooktable.class.php

@ -1,9 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Gradebook controller.
*/
/* For licensing terms, see /license.txt */
// $cidReset : This is the main difference with gradebook.php, here we say,
// basically, that we are inside a course, and many things depend from that
@ -852,7 +849,6 @@ if (!api_is_allowed_to_edit(null, true)) {
if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null, true)) {
echo '<meta http-equiv="refresh" content="0;url='.api_get_self().'?'.api_get_cidreq().'" />';
} else {
// Tool introduction
Display::display_introduction_section(
TOOL_GRADEBOOK,
['ToolbarSet' => 'AssessmentsIntroduction']

@ -796,9 +796,9 @@ class Category implements GradebookItem
$option = Database::fetch_array($res, 'ASSOC');
if ($option['num'] >= 1) {
return '&nbsp;&nbsp;<span class="resource-deleted">(&nbsp;'.get_lang('ResourceDeleted').'&nbsp;)</span>';
} else {
return false;
}
return false;
}
/**

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
@ -442,7 +443,7 @@ class ExerciseLink extends AbstractLink
$exerciseId = $data['id'];
$path = isset($data['path']) ? $data['path'] : '';
$url = api_get_path(WEB_CODE_PATH).'gradebook/exercise_jump.php?'
return api_get_path(WEB_CODE_PATH).'gradebook/exercise_jump.php?'
.http_build_query(
[
'path' => $path,
@ -453,8 +454,6 @@ class ExerciseLink extends AbstractLink
'type' => $this->get_type(),
]
);
return $url;
}
/**
@ -477,9 +476,7 @@ class ExerciseLink extends AbstractLink
}
}
$title = strip_tags(Exercise::get_formated_title_variable($data['title']));
return $title;
return strip_tags(Exercise::get_formated_title_variable($data['title']));
}
/**
@ -595,9 +592,9 @@ class ExerciseLink extends AbstractLink
} else {
// Try with iid
$sql = 'SELECT * FROM '.$table.'
WHERE
c_id = '.$this->course_id.' AND
iid = '.$exerciseId;
WHERE
c_id = '.$this->course_id.' AND
iid = '.$exerciseId;
$result = Database::query($sql);
$rows = Database::num_rows($result);
@ -606,9 +603,9 @@ class ExerciseLink extends AbstractLink
} else {
// Try wit id
$sql = 'SELECT * FROM '.$table.'
WHERE
c_id = '.$this->course_id.' AND
id = '.$exerciseId;
WHERE
c_id = '.$this->course_id.' AND
id = '.$exerciseId;
$result = Database::query($sql);
$this->exercise_data = Database::fetch_array($result);
}

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see license.txt */
use ChamiloSession as Session;
@ -321,7 +322,7 @@ class GradebookTable extends SortableTable
break;
}
if ('DESC' == $this->direction) {
if ('DESC' === $this->direction) {
$sorting |= GradebookDataGenerator::GDG_SORT_DESC;
} else {
$sorting |= GradebookDataGenerator::GDG_SORT_ASC;
@ -1164,24 +1165,24 @@ class GradebookTable extends SortableTable
$view = isset($_GET['view']) ? Security::remove_XSS($_GET['view']) : null;
$categoryId = $item->getCategory()->get_id();
$cat = new Category();
switch ($item->get_item_type()) {
// category
case 'C':
// Category
$prms_uri = '?selectcat='.$item->get_id().'&view='.$view;
$isStudentView = api_is_student_view_active();
if (isset($is_student) || $isStudentView) {
$prms_uri = $prms_uri.'&amp;isStudentView=studentview';
}
$cat = new Category();
$show_message = $cat->show_message_resource_delete($item->get_course_code());
return '&nbsp;<a href="'.Category::getUrl().$prms_uri.'">'
.$item->get_name()
.'</a>'
.($item->is_course() ? ' &nbsp;['.$item->get_course_code().']'.$show_message : '');
// evaluation
case 'E':
$cat = new Category();
// Evaluation
$course_id = CourseManager::get_course_by_category($categoryId);
$show_message = $cat->show_message_resource_delete($course_id);
@ -1194,7 +1195,7 @@ class GradebookTable extends SortableTable
.'</a>';
} else {
$extra = Display::label(get_lang('Evaluation'));
if ($type == 'simple') {
if ($type === 'simple') {
$extra = '';
}
@ -1219,13 +1220,11 @@ class GradebookTable extends SortableTable
}
// no break because of return
case 'L':
// link
$cat = new Category();
// Link
$course_id = CourseManager::get_course_by_category($categoryId);
$show_message = $cat->show_message_resource_delete($course_id);
$url = $item->get_link();
$text = $item->get_name();
if (isset($url) && false === $show_message) {
$text = '&nbsp;<a href="'.$item->get_link().'">'
@ -1234,11 +1233,10 @@ class GradebookTable extends SortableTable
}
$extra = Display::label($item->get_type_name(), 'info');
if ('simple' == $type) {
if ('simple' === $type) {
$extra = '';
}
$extra .= $item->getSkillsFromItem();
$text .= "&nbsp;".$extra.$show_message;
$cc = $this->currentcat->get_course_code();
if (empty($cc)) {
@ -1257,14 +1255,14 @@ class GradebookTable extends SortableTable
private function build_edit_column($item)
{
switch ($item->get_item_type()) {
// category
case 'C':
// Category
return GradebookUtils::build_edit_icons_cat($item, $this->currentcat);
// evaluation
case 'E':
// Evaluation
return GradebookUtils::build_edit_icons_eval($item, $this->currentcat->get_id());
// link
case 'L':
// Link
return GradebookUtils::build_edit_icons_link($item, $this->currentcat->get_id());
}
}

Loading…
Cancel
Save