Source for file gradebooktable.class.php
Documentation is available at gradebooktable.class.php
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2008 Dokeos SPRL
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
==============================================================================
include_once (dirname(__FILE__ ). '/../../../inc/global.inc.php');
include_once (dirname(__FILE__ ). '/../be.inc.php');
* Table to display categories, evaluations and links
* @author Bert Stepp� (refactored, optimised)
function GradebookTable ($currentcat, $cats = array(), $evals = array(), $links = array(), $addparams = null)
$this->set_additional_parameters($addparams);
$this->set_header($column++ , '', false);
$this->set_header($column++ , get_lang('Type'));
$this->set_header($column++ , get_lang('Name'));
$this->set_header($column++ , get_lang('Description'));
$this->set_header($column++ , get_lang('Weight'));
$this->set_header($column++ , get_lang('Date'),true, 'width="100"');
//admins get an edit column
$this->set_header($column++ , get_lang('Modify'), false, 'width="80"');
//actions on multiple selected documents
$this->set_form_actions(array (
'setinvisible' => get_lang('SetInvisible')));
//students get a result column
$this->set_header($column++ , get_lang('Results'), false);
$this->set_header($column++ , get_lang('Certificates'), false);
* Function used by SortableTable to get total number of items in the table
return $this->datagen->get_total_items_count();
* Function used by SortableTable to generate the data to display
// determine sorting type
if ($this->direction == 'DESC')
$data_array = $this->datagen->get_data($sorting, $from, $this->per_page);
// generate the data to display
$sortable_data = array();
foreach ($data_array as $data)
//if the item is invisible, wrap it in a span with class invisible
$row[] = $invisibility_span_open . $this->build_name_link ($item) . $invisibility_span_close;
$row[] = $invisibility_span_open . $data[2] . $invisibility_span_close;
$row[] = $invisibility_span_open . $data[3] . $invisibility_span_close;
$row[] = $invisibility_span_open . $data[4] . $invisibility_span_close;
//admins get an edit column
//students get the results and certificates columns
switch ($item->get_item_type())
return 'CATE' . $item->get_id();
return 'EVAL' . $item->get_id();
return 'LINK' . $item->get_id();
switch ($item->get_item_type())
return ' <a href="gradebook.php?selectcat=' . $item->get_id() . '">'
. ($item->is_course() ? ' [' . $item->get_course_code() . ']' : '');
// course/platform admin can go to the view_results page
. '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">'
// students can go to the statistics page (if custom display enabled)
. '<a href="gradebook_statistics.php?selecteval=' . $item->get_id() . '">'
return $item->get_name();
$url = $item->get_link();
$text = ' <a href="' . $item->get_link() . '">'
$text = $item->get_name();
$text .= ' [' . $item->get_type_name() . ']';
switch ($item->get_item_type())
|