[svn r20127] logic changes - when displaying the graph of total score - (partial FS#3909)

skala
Isaac Flores 17 years ago
parent 4ade5c51bf
commit 540a588fe9
  1. 16
      main/gradebook/lib/fe/flatviewtable.class.php
  2. 4
      main/gradebook/lib/flatview_data_generator.class.php

@ -74,7 +74,6 @@ class FlatViewTable extends SortableTable
array_pop($header_name);
$user_results = ($this->datagen->get_data_to_graph());
$pre_result = $new_result = array();
$DataSet = new pData;
//filling the Dataset
foreach($user_results as $result) {
@ -91,16 +90,15 @@ class FlatViewTable extends SortableTable
if ($total != 0)
$show_draw = true;
$DataSet->AddPoint($total,"Serie".$i);
$DataSet->SetSerieName($header_name[$i-1],"Serie".$i);
$DataSet->SetSerieName($header_name[$i-1],"Serie".$i);
// Dataset definition
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$i++;
}
}
//print_r($pre_result); print_r($header_name);
// Dataset definition
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
// Cache definition
$Cache = new pCache();
// the graph id
@ -182,11 +180,11 @@ class FlatViewTable extends SortableTable
$header_name = $this->datagen->get_header_names();
$total_users = $this->datagen->get_total_users_count();
$img_file = '';
if ($this->datagen->get_total_items_count()>0 && $total_users > 0 ) {
array_shift($header_name);
array_shift($header_name);
$displayscore= ScoreDisplay :: instance();
$customdisplays = $displayscore->get_custom_score_display_settings();
if (is_array($customdisplays) && count(($customdisplays))) {

@ -233,13 +233,13 @@ class FlatViewDataGenerator
$item_value+=round($score[0]/$divide*$item->get_weight(),2);
$item_total+=$item->get_weight();
$score_denom=($score[1]==0) ? 1 : $score[1];
$score_final = round(($score[0] / $score_denom) * 100,2);
$score_final = round(($score[0] / $score_denom) * 100,2);
$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);
$row[] =array ($score_final, strip_tags($scoredisplay->display_score($score,SCORE_DIV_PERCENT, SCORE_ONLY_CUSTOM)));
$row[] =array ($score_final, strip_tags($scoredisplay->display_score($total_score,SCORE_DIV_PERCENT, SCORE_ONLY_CUSTOM)));
//$total_score=array($item_value,$item_total);
//$score_final = round(($item_value / $item_total) * 100,2);
//$row[] = $score_final;

Loading…
Cancel
Save