minor - fixed dynamic height for students' faults inside student graph block

skala
Cristian Fasanando 15 years ago
parent a8a84ee42f
commit f52f3f9d03
  1. 13
      plugin/dashboard/block_course/block_course.class.php
  2. 18
      plugin/dashboard/block_student_graph/block_student_graph.class.php

@ -107,9 +107,15 @@ class BlockCourse extends Block {
</tr>';
$i = 1;
foreach ($course_data as $course) {
if ($i%2 == 0) $class_tr = 'row_odd';
else $class_tr = 'row_even';
if ($i%2 == 0) {
$class_tr = 'row_odd';
} else {
$class_tr = 'row_even';
}
$data_table .= '<tr class="'.$class_tr.'">';
if (!isset($course[2])) {
$course[2] = '0:00:00';
}
foreach ($course as $cell) {
$data_table .= '<td align="right">'.$cell.'</td>';
}
@ -174,7 +180,7 @@ class BlockCourse extends Block {
$tematic_advance = $thematic->get_total_average_of_thematic_advances($course_code, 0);
if (!empty($tematic_advance)) {
$tematic_advance_progress = '<a title="'.get_lang('GoToThematicAdvance').'" href="'.api_get_path(WEB_CODE_PATH).'attendance/index.php?cidReq='.$course_code.'&action=thematic_details">'.$tematic_advance.'%</a>';
$tematic_advance_progress = '<a title="'.get_lang('GoToThematicAdvance').'" href="'.api_get_path(WEB_CODE_PATH).'course_progress/index.php?cidReq='.$course_code.'&action=thematic_details">'.$tematic_advance.'%</a>';
} else {
$tematic_advance_progress = '0%';
}
@ -190,6 +196,5 @@ class BlockCourse extends Block {
return $course_data;
}
}
?>

@ -107,7 +107,7 @@ class BlockStudentGraph extends Block {
$students = $this->students;
$attendance = new Attendance();
// get data
$attendances_faults_avg = array();
@ -153,13 +153,19 @@ class BlockStudentGraph extends Block {
//if we already created the img
$img_file = $cache->GetHash($graph_id, $data_set->GetData()); // image file with hash
} else {
if (count($usernames) < 5) {
$height = 200;
} else {
$height = (count($usernames)*40);
}
// Initialise the graph
$test = new MyHorBar(400,330);
$test = new MyHorBar(400,($height+30));
$test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf', 8);
$test->setGraphArea(65,30,350,250);
$test->drawFilledRoundedRectangle(7,7,393,303,5,240,240,240);
$test->drawRoundedRectangle(5,5,395,305,5,230,230,230);
$test->setGraphArea(65,30,350,$height);
$test->drawFilledRoundedRectangle(7,7,393,$height,5,240,240,240);
$test->drawRoundedRectangle(5,5,395,$height,5,230,230,230);
$test->drawGraphArea(255,255,255,TRUE);
$test->setFixedScale(0,100,5);
$test->drawHorScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);

Loading…
Cancel
Save