Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent 58ac319ad8
commit 53574b746a
  1. 15
      main/gradebook/lib/flatview_data_generator.class.php
  2. 25
      plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php

@ -607,6 +607,8 @@ class FlatViewDataGenerator
/**
* Get actual array data evaluation/link scores
* @param int $session_id
* @return array
*/
public function get_evaluation_sumary_results ($session_id = null)
{
@ -642,16 +644,21 @@ class FlatViewDataGenerator
}
}
// get evaluation sumary results (maximum, minimum and average of evaluations for all students)
/* Get evaluation summary results
(maximum, minimum and average of evaluations for all students)
*/
$result = array();
$maximum = $minimum = $average = 0;
foreach ($data_by_item as $k => $v) {
$average = round(array_sum($v)/count($v));
arsort($v);
$maximum = array_shift($v);
$minimum = array_pop($v);
$sumary_item = array('max'=>$maximum, 'min'=>$minimum, 'avg'=>$average);
$result[$k] = $sumary_item;
$summary= array(
'max' => $maximum,
'min' => $minimum,
'avg' => $average
);
$result[$k] = $summary;
}
return $result;

@ -1,16 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file is part of evaluation graph block plugin for dashboard,
* it should be required inside dashboard controller for showing it into dashboard interface from plattform
* @package chamilo.dashboard
* @author Christian Fasanando
*/
/**
* required files for getting data
*/
require_once api_get_path(LIBRARY_PATH).'pchart/pData.class.php';
require_once api_get_path(LIBRARY_PATH).'pchart/pChart.class.php';
require_once api_get_path(LIBRARY_PATH).'pchart/pCache.class.php';
@ -23,9 +13,18 @@ require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/category.class.php';
/**
* Class BlockEvaluationGraph
* This class is used like controller for this evaluations graph block plugin,
* the class name must be registered inside path.info file (e.g: controller = "BlockEvaluationGraph"), so dashboard controller will be instantiate it
* the class name must be registered inside path.info file
* (e.g: controller = "BlockEvaluationGraph"),
* so dashboard controller will be instantiate it
*
* This file is part of evaluation graph block plugin for dashboard,
* it should be required inside dashboard controller for showing it
* into dashboard interface from platform
*
* @package chamilo.dashboard
* @author Christian Fasanando
*/
class BlockEvaluationGraph extends Block
{
@ -75,7 +74,6 @@ class BlockEvaluationGraph extends Block
*/
public function get_block()
{
global $charset;
$column = 1;
$data = array();
@ -116,6 +114,7 @@ class BlockEvaluationGraph extends Block
$data['column'] = $column;
$data['content_html'] = $html;
return $data;
}
@ -144,7 +143,7 @@ class BlockEvaluationGraph extends Block
$max = $min = $avg = array();
foreach ($evaluation_sumary as $evaluation) {
$max[] = $evaluation['max'];
$min[] = !empty($evaluation['min'])?$evaluation['min']:0;
$min[] = !empty($evaluation['min']) ? $evaluation['min'] : 0;
$avg[] = $evaluation['avg'];
}
// Dataset definition

Loading…
Cancel
Save