From 540a588fe905ee73575138ab2e78988da490a8d4 Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Mon, 27 Apr 2009 19:29:01 +0200 Subject: [PATCH] [svn r20127] logic changes - when displaying the graph of total score - (partial FS#3909) --- main/gradebook/lib/fe/flatviewtable.class.php | 16 +++++++--------- .../lib/flatview_data_generator.class.php | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/main/gradebook/lib/fe/flatviewtable.class.php b/main/gradebook/lib/fe/flatviewtable.class.php index 8d501057d5..6338c7e85f 100644 --- a/main/gradebook/lib/fe/flatviewtable.class.php +++ b/main/gradebook/lib/fe/flatviewtable.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))) { diff --git a/main/gradebook/lib/flatview_data_generator.class.php b/main/gradebook/lib/flatview_data_generator.class.php index f301f70e39..968d40075f 100644 --- a/main/gradebook/lib/flatview_data_generator.class.php +++ b/main/gradebook/lib/flatview_data_generator.class.php @@ -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;