Feature #272 - The Gradebook: Preparing a file for changes, formatting.

skala
Ivan Tcholakov 16 years ago
parent 75a7fe5d8f
commit b29a8fcab6
  1. 68
      main/gradebook/gradebook_flatview.php

@ -1,40 +1,21 @@
<?php // $Id: $
/*
==============================================================================
Dokeos - elearning and course management software
/* For licensing terms, see /license.txt */
Copyright (c) 2009 Dokeos Latinoamerica SAC
Copyright (c) 2006 Dokeos SPRL
Copyright (c) 2006 Ghent University (UGent)
Copyright (c) various contributors
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
Mail: info@dokeos.com
==============================================================================
*/
$language_file = 'gradebook';
//$cidReset= true;
require_once ('../inc/global.inc.php');
require_once ('lib/be.inc.php');
require_once ('lib/gradebook_functions.inc.php');
require_once ('lib/fe/dataform.class.php');
require_once ('lib/fe/userform.class.php');
require_once ('lib/flatview_data_generator.class.php');
require_once ('lib/fe/flatviewtable.class.php');
require_once ('lib/fe/displaygradebook.php');
require_once ('lib/fe/exportgradebook.php');
require_once (api_get_path(LIBRARY_PATH).'ezpdf/class.ezpdf.php');
require_once ('lib/scoredisplay.class.php');
require_once '../inc/global.inc.php';
require_once 'lib/be.inc.php';
require_once 'lib/gradebook_functions.inc.php';
require_once 'lib/fe/dataform.class.php';
require_once 'lib/fe/userform.class.php';
require_once 'lib/flatview_data_generator.class.php';
require_once 'lib/fe/flatviewtable.class.php';
require_once 'lib/fe/displaygradebook.php';
require_once 'lib/fe/exportgradebook.php';
require_once api_get_path(LIBRARY_PATH).'ezpdf/class.ezpdf.php';
require_once 'lib/scoredisplay.class.php';
api_block_anonymous_users();
block_students();
@ -48,15 +29,16 @@ $htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/java
$interbreadcrumb[] = array (
'url' => $_SESSION['gradebook_dest'],
'name' => get_lang('Gradebook'
));
'name' => get_lang('Gradebook')
);
$showeval= (isset ($_POST['showeval']) ? '1' : '0');
$showlink= (isset ($_POST['showlink']) ? '1' : '0');
$showeval = isset($_POST['showeval']) ? '1' : '0';
$showlink = isset($_POST['showlink']) ? '1' : '0';
if (($showlink == '0') && ($showeval == '0')) {
$showlink = '1';
$showeval = '1';
}
$cat = Category::load($_REQUEST['selectcat']);
if (isset($_GET['userid'])) {
@ -77,11 +59,10 @@ if ($showlink) {
$alllinks = null;
}
if (isset($export_flatview_form) && (!$file_type == 'pdf')) {
Display :: display_normal_message($export_flatview_form->toHtml(), false);
}
if (isset($_GET['selectcat'])) {
$category_id = Security::remove_XSS($_GET['selectcat']);
} else {
@ -90,6 +71,7 @@ if (isset($_GET['selectcat'])) {
$simple_search_form = new UserForm(UserForm :: TYPE_SIMPLE_SEARCH, null, 'simple_search_form', null, api_get_self() . '?selectcat=' . $category_id);
$values = $simple_search_form->exportValues();
$keyword = '';
if (isset($_GET['search']) && !empty($_GET['search'])) {
$keyword = Security::remove_XSS($_GET['search']);
@ -98,7 +80,6 @@ if ($simple_search_form->validate() && (empty($keyword))) {
$keyword = $values['keyword'];
}
if (!empty($keyword)) {
$users = find_students($keyword);
} else {
@ -108,6 +89,7 @@ if (!empty($keyword)) {
$users = null;
}
}
if (isset ($_GET['exportpdf'])) {
$interbreadcrumb[] = array (
'url' => api_get_self().'?selectcat=' . Security::remove_XSS($_GET['selectcat']),
@ -157,7 +139,7 @@ if(!empty($_POST['export_report']) && $_POST['export_report'] == 'export_report'
$user_id = api_get_user_id();
}
require_once('gradebook_result.class.php');
require_once 'gradebook_result.class.php';
$printable_data = get_printable_data($users, $alleval, $alllinks);
switch($_POST['export_format']) {
@ -182,8 +164,8 @@ $addparams= array ('selectcat' => $cat[0]->get_id());
if (isset($_GET['search'])) {
$addparams['search'] = $keyword;
}
$offset = (isset($_GET['offset'])?$_GET['offset']:'0');
$offset = isset($_GET['offset']) ? $_GET['offset'] : '0';
$flatviewtable = new FlatViewTable($cat[0], $users, $alleval, $alllinks, true, $offset, $addparams);
if (isset($_GET['exportpdf'])) {
@ -193,6 +175,7 @@ if (isset($_GET['exportpdf'])) {
} else {
Display :: display_header(get_lang('FlatView'));
}
if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {
DisplayGradebook :: display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form);
$flatviewtable->display();
@ -215,6 +198,7 @@ if (isset($_GET['isStudentView']) && $_GET['isStudentView']=='false') {
$flatviewtable->display_graph_by_resource();
echo '</div>';
}
Display :: display_footer();
function get_printable_data($users,$alleval, $alllinks) {

Loading…
Cancel
Save