2007-07-24 08:51:45 +00:00
|
|
|
<?php //$Id$
|
2007-05-16 08:21:46 +00:00
|
|
|
|
2007-07-24 08:51:45 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// //
|
|
|
|
// NOTICE OF COPYRIGHT //
|
|
|
|
// //
|
|
|
|
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
|
|
|
// http://moodle.com //
|
|
|
|
// //
|
2007-07-31 17:02:43 +00:00
|
|
|
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
|
2007-07-24 08:51:45 +00:00
|
|
|
// //
|
|
|
|
// 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 //
|
|
|
|
// //
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
2007-07-18 19:56:07 +00:00
|
|
|
|
2007-07-24 08:51:45 +00:00
|
|
|
require_once '../../../config.php';
|
|
|
|
require_once $CFG->dirroot.'/grade/export/lib.php';
|
|
|
|
require_once 'grade_export_xls.php';
|
|
|
|
|
|
|
|
$id = required_param('id', PARAM_INT); // course id
|
2007-07-18 19:56:07 +00:00
|
|
|
$feedback = optional_param('feedback', '', PARAM_ALPHA);
|
2007-08-13 08:22:56 +00:00
|
|
|
$export_letters = optional_param('export_letters', '', PARAM_INT);
|
2007-07-24 08:51:45 +00:00
|
|
|
$itemids = explode(",", required_param('itemids', PARAM_RAW));
|
|
|
|
|
|
|
|
if (!$course = get_record('course', 'id', $id)) {
|
|
|
|
print_error('nocourseid');
|
|
|
|
}
|
|
|
|
|
|
|
|
require_login($course);
|
|
|
|
$context = get_context_instance(CONTEXT_COURSE, $id);
|
|
|
|
|
|
|
|
require_capability('moodle/grade:export', $context);
|
|
|
|
require_capability('gradeexport/xls:view', $context);
|
2007-07-18 19:56:07 +00:00
|
|
|
|
2007-05-16 08:21:46 +00:00
|
|
|
// print all the exported data here
|
2007-08-13 08:22:56 +00:00
|
|
|
$export = new grade_export_xls($id, $itemids, $export_letters);
|
2007-05-16 08:21:46 +00:00
|
|
|
$export->print_grades($feedback);
|
2007-07-18 19:56:07 +00:00
|
|
|
|
2007-07-31 17:02:43 +00:00
|
|
|
?>
|