+<?php // $Id$
+$gradeexport_csv_capabilities = array(
+ 'gradeexport/csv:view' => array(
+ 'riskbitmask' => RISK_PERSONAL,
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_COURSE,
+ 'legacy' => array(
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ 'admin' => CAP_ALLOW
+ )
+ )
+);
+?>
--- /dev/null
+<?PHP // $Id$
+
+$plugin->version = 2007072404;
+$plugin->requires = 2007072402;
+
+?>
// //
///////////////////////////////////////////////////////////////////////////
-include_once($CFG->dirroot.'/lib/gradelib.php');
-include_once($CFG->dirroot.'/grade/lib.php');
+require_once($CFG->dirroot.'/lib/gradelib.php');
+require_once($CFG->dirroot.'/grade/lib.php');
/**
* Prints all grade items for selection
* @input int id - course id
--- /dev/null
+<?php // $Id$
+
+$gradeexport_ods_capabilities = array(
+
+ 'gradeexport/ods:view' => array(
+ 'riskbitmask' => RISK_PERSONAL,
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_COURSE,
+ 'legacy' => array(
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ 'admin' => CAP_ALLOW
+ )
+ )
+);
+
+?>
-<?php
+<?php //$Id$
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_ods.php');
+///////////////////////////////////////////////////////////////////////////
+// //
+// NOTICE OF COPYRIGHT //
+// //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment //
+// http://moodle.com //
+// //
+// Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com //
+// //
+// 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 //
+// //
+///////////////////////////////////////////////////////////////////////////
-$id = required_param('id', PARAM_INT); // course id
-$itemids = explode(",", required_param('itemids', PARAM_RAW));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_ods.php';
+
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
+$itemids = explode(",", required_param('itemids', PARAM_RAW));
+
+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/ods:view', $context);
+
// print all the exported data here
$export = new grade_export_ods($id, $itemids);
-<?php
+<?php //$Id$
+
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_ods.php');
-
-$id = required_param('id', PARAM_INT); // course id
-require_login($id);
-require_capability('moodle/grade:export', get_context_instance(CONTEXT_COURSE, $id));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_ods.php';
-$course = get_record('course', 'id', $id);
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
+
+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/ods:view', $context);
+
+
$strgrades = get_string('grades', 'grades');
$actionstr = get_string('modulename', 'gradeexport_ods');
+
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
$gradenav .= " -> $actionstr";
+
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
// process post information
if (($data = data_submitted()) && confirm_sesskey()) {
--- /dev/null
+<?PHP // $Id$
+
+$plugin->version = 2007072409;
+$plugin->requires = 2007072402;
+
+?>
--- /dev/null
+<?php // $Id$
+
+$gradeexport_txt_capabilities = array(
+
+ 'gradeexport/txt:view' => array(
+ 'riskbitmask' => RISK_PERSONAL,
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_COURSE,
+ 'legacy' => array(
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ 'admin' => CAP_ALLOW
+ )
+ )
+);
+
+?>
-<?php
+<?php //$Id$
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_txt.php');
+///////////////////////////////////////////////////////////////////////////
+// //
+// NOTICE OF COPYRIGHT //
+// //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment //
+// http://moodle.com //
+// //
+// Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com //
+// //
+// 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 //
+// //
+///////////////////////////////////////////////////////////////////////////
-$id = required_param('id', PARAM_INT); // course id
-$itemids = explode(",", required_param('itemids', PARAM_RAW));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_txt.php';
+
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
+$itemids = explode(",", required_param('itemids', PARAM_RAW));
+
+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);
// print all the exported data here
$export = new grade_export_txt($id, $itemids);
-<?php
+<?php //$Id$
+
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_txt.php');
-
-$id = required_param('id', PARAM_INT); // course id
-require_login($id);
-require_capability('moodle/grade:export', get_context_instance(CONTEXT_COURSE, $id));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_txt.php';
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
-$course = get_record('course', 'id', $id);
+
+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);
+
+
$strgrades = get_string('grades', 'grades');
$actionstr = get_string('modulename', 'gradeexport_txt');
+
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
$gradenav .= " -> $actionstr";
+
print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
// process post information
-<?php
+<?PHP // $Id$
-$plugin->version = 2007052201;
-$plugin->requires = 2007051801;
+$plugin->version = 2007072403;
+$plugin->requires = 2007072402;
?>
--- /dev/null
+<?php // $Id$
+
+$gradeexport_xls_capabilities = array(
+
+ 'gradeexport/xls:view' => array(
+ 'riskbitmask' => RISK_PERSONAL,
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_COURSE,
+ 'legacy' => array(
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ 'admin' => CAP_ALLOW
+ )
+ )
+);
+
+?>
-<?php
+<?php //$Id$
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_xls.php');
+///////////////////////////////////////////////////////////////////////////
+// //
+// NOTICE OF COPYRIGHT //
+// //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment //
+// http://moodle.com //
+// //
+// Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com //
+// //
+// 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 //
+// //
+///////////////////////////////////////////////////////////////////////////
-$id = required_param('id', PARAM_INT); // course id
-$itemids = explode(",", required_param('itemids', PARAM_RAW));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_xls.php';
+
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
+$itemids = explode(",", required_param('itemids', PARAM_RAW));
+
+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/xls:view', $context);
// print all the exported data here
$export = new grade_export_xls($id, $itemids);
-<?php
+<?php //$Id$
+
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_xls.php');
-
-$id = required_param('id', PARAM_INT); // course id
-require_login($id);
-require_capability('moodle/grade:export', get_context_instance(CONTEXT_COURSE, $id));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_xls.php';
-$course = get_record('course', 'id', $id);
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
+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/xls:view', $context);
+
+
$strgrades = get_string('grades', 'grades');
$actionstr = get_string('modulename', 'gradeexport_xls');
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
--- /dev/null
+<?PHP // $Id$
+
+$plugin->version = 2007072403;
+$plugin->requires = 2007072402;
+
+?>
--- /dev/null
+<?php // $Id$
+
+$gradeexport_xml_capabilities = array(
+
+ 'gradeexport/xml:view' => array(
+ 'riskbitmask' => RISK_PERSONAL,
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_COURSE,
+ 'legacy' => array(
+ 'teacher' => CAP_ALLOW,
+ 'editingteacher' => CAP_ALLOW,
+ 'admin' => CAP_ALLOW
+ )
+ )
+);
+
+?>
-<?php
+<?php //$Id$
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_xml.php');
+///////////////////////////////////////////////////////////////////////////
+// //
+// NOTICE OF COPYRIGHT //
+// //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment //
+// http://moodle.com //
+// //
+// Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com //
+// //
+// 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 //
+// //
+///////////////////////////////////////////////////////////////////////////
-$id = required_param('id', PARAM_INT); // course id
-$itemids = explode(",", required_param('itemids', PARAM_RAW));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_xml.php';
+
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
+$itemids = explode(",", required_param('itemids', PARAM_RAW));
+
+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/xml:view', $context);
// print all the exported data here
$export = new grade_export_xml($id, $itemids);
-<?php
+<?php //$Id$
+
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
-require_once("../../../config.php");
-require_once($CFG->dirroot.'/grade/export/lib.php');
-require_once('grade_export_xml.php');
-
-$id = required_param('id', PARAM_INT); // course id
-require_login($id);
-require_capability('moodle/grade:export', get_context_instance(CONTEXT_COURSE, $id));
+require_once '../../../config.php';
+require_once $CFG->dirroot.'/grade/export/lib.php';
+require_once 'grade_export_xml.php';
-$course = get_record('course', 'id', $id);
+$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', '', PARAM_ALPHA);
+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/xml:view', $context);
+
+
$strgrades = get_string('grades', 'grades');
$actionstr = get_string('modulename', 'gradeexport_xml');
$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
--- /dev/null
+<?PHP // $Id$
+
+$plugin->version = 2007072403;
+$plugin->requires = 2007072402;
+
+?>
$defpath = $CFG->dirroot.'/'.$compparts[0].
's/'.$compparts[1].'/db/access.php';
$varprefix = $compparts[0].'_'.$compparts[1];
+
} else if ($compparts[0] == 'format') {
// Similar to the above, course formats are 'format' while they
// are stored in 'course/format'.
$defpath = $CFG->dirroot.'/course/'.$component.'/db/access.php';
$varprefix = $compparts[0].'_'.$compparts[1];
+
} else if ($compparts[0] == 'gradeimport') {
- $defpath = $CFG->dirroot.'/grade/import/'.$component.'/db/access.php';
- $varprefix = $component;
+ $defpath = $CFG->dirroot.'/grade/import/'.$compparts[1].'/db/access.php';
+ $varprefix = $compparts[0].'_'.$compparts[1];
+
} else if ($compparts[0] == 'gradeexport') {
- $defpath = $CFG->dirroot.'/grade/export/'.$component.'/db/access.php';
- $varprefix = $component;
+ $defpath = $CFG->dirroot.'/grade/export/'.$compparts[1].'/db/access.php';
+ $varprefix = $compparts[0].'_'.$compparts[1];
+
} else if ($compparts[0] == 'gradereport') {
- $defpath = $CFG->dirroot.'/grade/report/'.$component.'/db/access.php';
- $varprefix = $component;
+ $defpath = $CFG->dirroot.'/grade/report/'.$compparts[1].'/db/access.php';
+ $varprefix = $compparts[0].'_'.$compparts[1];
+
} else {
$defpath = $CFG->dirroot.'/'.$component.'/db/access.php';
$varprefix = str_replace('/', '_', $component);
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2007072400; // YYYYMMDD = date
+ $version = 2007072402; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.9 dev'; // Human-friendly version name