1
<?php //$Id: index.php,v 1.35.2.2 2007/12/07 01:40:45 toyomoyo Exp $
3
///////////////////////////////////////////////////////////////////////////
5
// NOTICE OF COPYRIGHT //
7
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
8
// http://moodle.com //
10
// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
12
// This program is free software; you can redistribute it and/or modify //
13
// it under the terms of the GNU General Public License as published by //
14
// the Free Software Foundation; either version 2 of the License, or //
15
// (at your option) any later version. //
17
// This program is distributed in the hope that it will be useful, //
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20
// GNU General Public License for more details: //
22
// http://www.gnu.org/copyleft/gpl.html //
24
///////////////////////////////////////////////////////////////////////////
3
// This file is part of Moodle - http://moodle.org/
5
// Moodle is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
10
// Moodle is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
26
18
require_once '../../../config.php';
27
19
require_once $CFG->dirroot.'/grade/export/lib.php';
39
31
require_capability('moodle/grade:export', $context);
40
32
require_capability('gradeexport/xml:view', $context);
43
$strgrades = get_string('grades', 'grades');
44
$actionstr = get_string('modulename', 'gradeexport_xml');
45
$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
47
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
48
print_grade_plugin_selector($id, 'export', 'xml');
34
print_grade_page_head($COURSE->id, 'export', 'xml', get_string('exportto', 'grades') . ' ' . get_string('modulename', 'gradeexport_xml'));
50
36
if (!empty($CFG->gradepublishing)) {
51
37
$CFG->gradepublishing = has_capability('gradeexport/xml:publish', $context);
54
40
$mform = new grade_export_form(null, array('idnumberrequired'=>true, 'publishing'=>true, 'updategradesonly'=>true));
42
$groupmode = groups_get_course_groupmode($course); // Groups are being used
43
$currentgroup = groups_get_course_group($course, true);
44
if ($groupmode == SEPARATEGROUPS and !$currentgroup and !has_capability('moodle/site:accessallgroups', $context)) {
45
print_heading(get_string("notingroup"));
46
print_footer($course);
56
50
// process post information
57
51
if ($data = $mform->get_data()) {
58
$export = new grade_export_xml($course, groups_get_course_group($course), '', false, $data->updatedgradesonly, $data->display, $data->decimals);
52
$export = new grade_export_xml($course, $currentgroup, '', false, $data->updatedgradesonly, $data->display, $data->decimals);
60
54
// print the grades on screen for feedbacks
61
55
$export->process_form($data);
62
56
$export->print_continue();
63
$export->display_preview();
57
$export->display_preview(true);
64
58
print_footer($course);