[svn r19132] Fixing when the score rules are set see FS#3894

skala
Julio Montoya 17 years ago
parent 48038906be
commit d8b8c13c39
  1. 12
      main/gradebook/lib/fe/flatviewtable.class.php
  2. 2
      main/gradebook/lib/flatview_data_generator.class.php

@ -178,7 +178,7 @@ class FlatViewTable extends SortableTable
include_once(api_get_path(LIBRARY_PATH).'pchart/pData.class.php');
include_once(api_get_path(LIBRARY_PATH).'pchart/pChart.class.php');
include_once(api_get_path(LIBRARY_PATH).'pchart/pCache.class.php');
echo '<pre>';
$header_name = $this->datagen->get_header_names();
$total_users = $this->datagen->get_total_users_count();
$img_file = '';
@ -192,14 +192,14 @@ class FlatViewTable extends SortableTable
$customdisplays = $displayscore->get_custom_score_display_settings();
if (is_array($customdisplays) && count(($customdisplays))) {
$user_results = ($this->datagen->get_data_to_graph2());
$user_results = ($this->datagen->get_data_to_graph2());
$pre_result = $new_result = array();
//print_r($user_results);
$DataSet = new pData;
//filling the Dataset
foreach($user_results as $result) {
//print_r($result);
for($i=0; $i< count($header_name); $i++) {
for($i=0; $i< count($header_name); $i++) {
$pre_result[$i+3][]=$result[$i+1];
$pre_result_pie[$i+3][] = $result[$i+1][0];
}
@ -214,6 +214,7 @@ class FlatViewTable extends SortableTable
$show_draw = false;
$resource_list = array();
$pre_result2 = array();
//print_r($pre_result); exit;
foreach($pre_result as $key=>$res_array) {
rsort($res_array);
$pre_result2[] = $res_array;
@ -243,7 +244,8 @@ class FlatViewTable extends SortableTable
//print_r($resource_list); exit;
$i = 1;
$j = 0;
// here-----------------------------------
// here-----------------------------------
//print_r($resource_list);
foreach($resource_list as $key=>$resource) {
$new_resource_list = $new_resource_list_name = array();
$DataSet = new pData;
@ -251,7 +253,7 @@ class FlatViewTable extends SortableTable
//$new_resource_list[]=$cant;
//$new_resource_list_name[]=$name;
$DataSet->AddPoint($cant,"Serie".$j);
$DataSet->SetSerieName($name,"Serie".$j);
$DataSet->SetSerieName(strip_tags($name),"Serie".$j);
$j++;
}
//print_r($pre_result); print_r($header_name);

@ -234,7 +234,7 @@ class FlatViewDataGenerator
$item_total+=$item->get_weight();
$score_denom=($score[1]==0) ? 1 : $score[1];
$score_final = round(($score[0] / $score_denom) * 100,2);
$row[] = array ($score_final, $scoredisplay->display_score($score,SCORE_DIV_PERCENT, SCORE_ONLY_CUSTOM));
$row[] = array ($score_final, strip_tags($scoredisplay->display_score($score,SCORE_DIV_PERCENT, SCORE_ONLY_CUSTOM)));
}
$total_score=array($item_value,$item_total);
$score_final = round(($item_value / $item_total) * 100,2);

Loading…
Cancel
Save