[moodle] / contrib / plugins / grade / report / visual / index.php Repository:

View of /contrib/plugins/grade/report/visual/index.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (download) (annotate)
Thu Jul 24 15:31:44 2008 WST (16 months ago) by dservos
Branch: MAIN
Changes since 1.2: +12 -3 lines
CONTRIB-497
*Added new visualization, Grade Distribution
*Fixed some minor bugs
*Made abstract visualization class for creating visualizations by making classes witch extend it.
*Made visual_settings.php witch takes a visualization class and truns it in to XML witch flex can read in.
*Made flex visualization application read in XML formated settings as well as tab formated data from moodle and combind them to make a custom visualization.
*Made flex visualization application read and use langue strings from moodle.
*Added printer firendly tab

TODO:
*Add more visualizations
*Refactor some of the flex/actionscript code
*More douctenation
*More UI functions for the flex application
<?php
///////////////////////////////////////////////////////////////////////////
//                                                                       //
// NOTICE OF COPYRIGHT                                                   //
//                                                                       //
// Moodle - Modular Object-Oriented Dynamic Learning Environment         //
//          http://moodle.org                                            //
//                                                                       //
// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //
//                                                                       //
// 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.                                   //
//                                                                       //
// This program is distributed in the hope that it will be useful,       //
// but WITHOUT ANY WARRANTY; without even the implied warranty of        //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //
// GNU General Public License for more details:                          //
//                                                                       //
//          http://www.gnu.org/copyleft/gpl.html                         //
//                                                                       //
///////////////////////////////////////////////////////////////////////////

/**
* Index page for the visual grade book report.
*/

require_once '../../../config.php';
require_once $CFG->libdir.'/gradelib.php';
require_once $CFG->dirroot.'/grade/lib.php';
require_once $CFG->dirroot.'/grade/report/visual/lib.php';

$courseid = required_param('id');
$visid = optional_param('visid');

/// basic access checks
if(isset($DB) && !is_null($DB)) {
    $course = $DB->get_record('course', array('id' => $courseid));
} else {
    $course = get_record('course', 'id', $courseid);
}
if (!$course) {
        print_error('nocourseid');
}
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('gradereport/visual:view', $context);

/// get tracking object
$gpr = new grade_plugin_return(array('type'=>'report', 'plugin'=>'visual', 'courseid'=>$courseid));

$report = new grade_report_visual($courseid, $gpr, $context, $visid);

/// last selected report session tracking
if (!isset($USER->grade_last_report)) {
    $USER->grade_last_report = array();
}
$USER->grade_last_report[$course->id] = 'visual';

/// Build navigation
$strgrades  = get_string('grades');
$reportname = get_string('modulename', 'gradereport_visual');
$navigation = grade_build_nav(__FILE__, $reportname, $courseid);

//grade_regrade_final_grades($courseid);

/// Print header
print_header_simple($strgrades.': '.$reportname, ': '.$strgrades, $navigation, '', '', true, null, navmenu($course), false, null);

/// Print the plugin selector at the top
print_grade_plugin_selector($courseid, 'report', 'stats');

// /Add tabs
$currenttab = 'visualreport';
require('tabs.php');

$report->visualization_selector();
$report->adapt_html();

//echo session_id() . '<br/>';
//echo $SESSION->session_test;

/// Print footer
print_footer($course);
?>

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7