2007-07-24 08:51:45 +00:00
|
|
|
<?php //$Id$
|
|
|
|
|
2007-05-11 09:08:30 +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-11 09:08:30 +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_txt.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-24 08:51:45 +00:00
|
|
|
|
|
|
|
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/txt: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_txt');
|
2007-08-01 06:47:35 +00:00
|
|
|
$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
|
2007-07-24 08:51:45 +00:00
|
|
|
|
2007-08-01 06:47:35 +00:00
|
|
|
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
|
2007-07-30 06:28:41 +00:00
|
|
|
print_grade_plugin_selector($id, 'export', 'txt');
|
2007-05-16 08:21:46 +00:00
|
|
|
|
2007-08-31 18:42:50 +00:00
|
|
|
$mform = new grade_export_form(null, array('includeseparator'=>true, 'publishing' => true));
|
2007-08-29 12:38:23 +00:00
|
|
|
|
|
|
|
// process post information
|
|
|
|
if ($data = $mform->get_data()) {
|
2007-09-06 10:19:24 +00:00
|
|
|
$export = new grade_export_txt($course, groups_get_course_group($course));
|
2007-08-31 18:42:50 +00:00
|
|
|
|
2007-08-31 05:55:30 +00:00
|
|
|
// print the grades on screen for feedbacks
|
2007-08-31 18:42:50 +00:00
|
|
|
$export->process_form($data);
|
|
|
|
$export->display_preview();
|
|
|
|
$export->print_continue();
|
|
|
|
die;
|
2007-05-11 09:08:30 +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-05-24 08:57:36 +00:00
|
|
|
$mform->display();
|
2007-05-18 08:49:00 +00:00
|
|
|
|
|
|
|
print_footer();
|
2007-07-23 08:13:59 +00:00
|
|
|
?>
|