2009-07-07 02:26:36 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle 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 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle 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.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
2007-10-10 06:34:20 +00:00
|
|
|
|
2008-06-25 17:31:23 +00:00
|
|
|
define('NO_MOODLE_COOKIES', true); // session not used here
|
2009-03-17 10:52:27 +00:00
|
|
|
require_once '../../../config.php';
|
2007-09-26 09:42:28 +00:00
|
|
|
|
|
|
|
$id = required_param('id', PARAM_INT); // course id
|
2008-06-01 17:59:13 +00:00
|
|
|
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
2017-06-23 10:22:24 +08:00
|
|
|
print_error('invalidcourseid');
|
2007-09-27 06:51:54 +00:00
|
|
|
}
|
2007-09-26 09:42:28 +00:00
|
|
|
|
|
|
|
require_user_key_login('grade/import', $id); // we want different keys for each course
|
|
|
|
|
|
|
|
if (empty($CFG->gradepublishing)) {
|
2008-05-14 08:05:45 +00:00
|
|
|
print_error('gradepubdisable');
|
2007-09-26 09:42:28 +00:00
|
|
|
}
|
|
|
|
|
2012-07-24 14:04:40 +08:00
|
|
|
$context = context_course::instance($id);
|
2007-09-27 06:56:51 +00:00
|
|
|
require_capability('gradeimport/xml:publish', $context);
|
2007-09-27 06:51:54 +00:00
|
|
|
|
2007-09-26 09:42:28 +00:00
|
|
|
// use the same page parameters as import.php and append &key=sdhakjsahdksahdkjsahksadjksahdkjsadhksa
|
|
|
|
require 'import.php';
|
|
|
|
|
2009-11-01 12:11:29 +00:00
|
|
|
|