Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent 178b2763ea
commit 9418d8da68
  1. 12
      main/gradebook/lib/fe/flatviewtable.class.php
  2. 15
      main/gradebook/lib/flatview_data_generator.class.php
  3. 2
      main/template/default/layout/footer.tpl

@ -43,6 +43,7 @@ class FlatViewTable extends SortableTable
$mainCourseCategory = null
) {
parent :: __construct('flatviewlist', null, null, (api_is_western_name_order() xor api_sort_by_first_name()) ? 1 : 0);
$this->selectcat = $selectcat;
$this->datagen = new FlatViewDataGenerator(
@ -558,16 +559,15 @@ class FlatViewTable extends SortableTable
$header_names = $this->datagen->get_header_names($this->offset, $selectlimit);
$column = 0;
if ($is_western_name_order) {
$this->set_header($column++, $header_names[1]);
$this->set_header($column++, $header_names[0]);
$this->set_header(0, $header_names[1]);
$this->set_header(1, $header_names[0]);
} else {
$this->set_header($column++, $header_names[0]);
$this->set_header($column++, $header_names[1]);
$this->set_header(0, $header_names[0]);
$this->set_header(1, $header_names[1]);
}
$column = 2;
while ($column < count($header_names)) {
$this->set_header($column, $header_names[$column], false);
$column++;

@ -157,9 +157,11 @@ class FlatViewDataGenerator
$session_id,
'ORDER BY id'
);
$evaluationsAdded = array();
if ($parent_id == 0 && !empty($allcat)) {
// Means there are any subcategory
foreach ($allcat as $sub_cat) {
$sub_cat_weight = round(100 * $sub_cat->get_weight() / $main_weight, 1);
$add_weight = " $sub_cat_weight %";
@ -216,6 +218,7 @@ class FlatViewDataGenerator
$max = $score[0];
}
}
return $max;
}
@ -389,7 +392,12 @@ class FlatViewDataGenerator
$course_code = api_get_course_id();
$session_id = api_get_session_id();
$allcat = $this->category->get_subcategories(null, $course_code, $session_id, 'ORDER BY id');
$allcat = $this->category->get_subcategories(
null,
$course_code,
$session_id,
'ORDER BY id'
);
$evaluationsAdded = array();
@ -400,7 +408,7 @@ class FlatViewDataGenerator
$real_score = $score;
$divide = ( ($score[1])==0 ) ? 1 : $score[1];
$divide = $score[1] == 0 ? 1 : $score[1];
$sub_cat_percentage = $sum_categories_weight_array[$sub_cat->get_id()];
$item_value = $score[0]/$divide*$main_weight;
@ -427,8 +435,7 @@ class FlatViewDataGenerator
}
if (!isset($this->params['only_total_category']) ||
(isset($this->params['only_total_category']) &&
$this->params['only_total_category'] == false)
(isset($this->params['only_total_category']) && $this->params['only_total_category'] == false)
) {
if (!$show_all) {
$row[] = $temp_score.' ';

@ -138,7 +138,7 @@ $(document).ready( function() {
//Tool tip (in exercises)
var tip_options = {
placement : 'right'
}
};
$('.boot-tooltip').tooltip(tip_options);
});
{% endraw %}

Loading…
Cancel
Save