Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / grade / export / ods / export.php
blob3b163b78319cf2618b6aadec20d60071a6efe560
1 <?php //$Id$
3 ///////////////////////////////////////////////////////////////////////////
4 // //
5 // NOTICE OF COPYRIGHT //
6 // //
7 // Moodle - Modular Object-Oriented Dynamic Learning Environment //
8 // http://moodle.com //
9 // //
10 // Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
11 // //
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. //
16 // //
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: //
21 // //
22 // http://www.gnu.org/copyleft/gpl.html //
23 // //
24 ///////////////////////////////////////////////////////////////////////////
26 require_once '../../../config.php';
27 require_once $CFG->dirroot.'/grade/export/lib.php';
28 require_once 'grade_export_ods.php';
30 $id = required_param('id', PARAM_INT); // course id
31 $groupid = optional_param('groupid', 0, PARAM_INT);
32 $itemids = required_param('itemids', PARAM_RAW);
33 $export_feedback = optional_param('export_feedback', 0, PARAM_BOOL);
34 $updatedgradesonly = optional_param('updatedgradesonly', false, PARAM_BOOL);
35 $displaytype = optional_param('displaytype', $CFG->grade_export_displaytype, PARAM_INT);
36 $decimalpoints = optional_param('decimalpoints', $CFG->grade_export_decimalpoints, PARAM_INT);
38 if (!$course = get_record('course', 'id', $id)) {
39 print_error('nocourseid');
42 require_login($course);
43 $context = get_context_instance(CONTEXT_COURSE, $id);
45 require_capability('moodle/grade:export', $context);
46 require_capability('gradeexport/ods:view', $context);
49 // print all the exported data here
50 $export = new grade_export_ods($course, $groupid, $itemids, $export_feedback, $updatedgradesonly, $displaytype, $decimalpoints);
51 $export->print_grades();