2007-07-24 08:51:45 +00:00
|
|
|
<?php //$Id$
|
|
|
|
|
2007-05-15 08:49:49 +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-05-15 08:49:49 +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 08:13:09 +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_xml.php';
|
2007-07-18 08:13:09 +00:00
|
|
|
|
2007-08-31 18:42:50 +00:00
|
|
|
$id = required_param('id', PARAM_INT); // course id
|
2007-07-18 19:56:07 +00:00
|
|
|
|
2008-06-01 17:59:13 +00:00
|
|
|
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
2007-07-24 08:51:45 +00:00
|
|
|
print_error('nocourseid');
|
|
|
|
}
|
|
|
|
|
|
|
|
require_login($course);
|
|
|
|
$context = get_context_instance(CONTEXT_COURSE, $id);
|
|
|
|
|
|
|
|
require_capability('moodle/grade:export', $context);
|
|
|
|
require_capability('gradeexport/xml:view', $context);
|
|
|
|
|
|
|
|
|
2007-07-17 03:32:10 +00:00
|
|
|
$strgrades = get_string('grades', 'grades');
|
2007-07-23 08:13:59 +00:00
|
|
|
$actionstr = get_string('modulename', 'gradeexport_xml');
|
2007-08-01 06:47:35 +00:00
|
|
|
$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
|
|
|
|
|
|
|
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
|
2007-07-30 06:28:41 +00:00
|
|
|
print_grade_plugin_selector($id, 'export', 'xml');
|
2007-08-27 12:23:50 +00:00
|
|
|
|
2007-09-27 06:51:54 +00:00
|
|
|
if (!empty($CFG->gradepublishing)) {
|
|
|
|
$CFG->gradepublishing = has_capability('gradeexport/xml:publish', $context);
|
|
|
|
}
|
|
|
|
|
2007-12-07 01:42:09 +00:00
|
|
|
$mform = new grade_export_form(null, array('idnumberrequired'=>true, 'publishing'=>true, 'updategradesonly'=>true));
|
2007-05-16 08:21:46 +00:00
|
|
|
|
2007-08-29 12:38:23 +00:00
|
|
|
// process post information
|
2008-06-03 16:10:57 +00:00
|
|
|
if ($data = $mform->get_data(false)) {
|
2007-10-10 06:43:23 +00:00
|
|
|
$export = new grade_export_xml($course, groups_get_course_group($course), '', false, $data->updatedgradesonly, $data->display, $data->decimals);
|
|
|
|
|
2007-05-15 08:49:49 +00:00
|
|
|
// print the grades on screen for feedbacks
|
2007-08-31 18:42:50 +00:00
|
|
|
$export->process_form($data);
|
|
|
|
$export->print_continue();
|
2007-09-18 03:36:47 +00:00
|
|
|
$export->display_preview();
|
|
|
|
print_footer($course);
|
|
|
|
exit;
|
2007-05-15 08:49:49 +00:00
|
|
|
}
|
2007-07-03 06:20:07 +00:00
|
|
|
|
2007-09-06 10:19:24 +00:00
|
|
|
groups_print_course_menu($course, 'index.php?id='.$id);
|
|
|
|
echo '<div class="clearer"></div>';
|
2007-08-31 18:42:50 +00:00
|
|
|
|
2007-08-29 12:38:23 +00:00
|
|
|
$mform->display();
|
|
|
|
|
2007-05-22 02:05:00 +00:00
|
|
|
print_footer();
|
2007-07-23 08:13:59 +00:00
|
|
|
?>
|