Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/grade/grading/form/rubric/preview.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00025 require_once(dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/config.php');
00026 require_once(dirname(__FILE__).'/lib.php');
00027 require_once(dirname(__FILE__).'/edit_form.php');
00028 require_once($CFG->dirroot.'/grade/grading/lib.php');
00029 
00030 $areaid = required_param('areaid', PARAM_INT);
00031 
00032 $manager = get_grading_manager($areaid);
00033 
00034 list($context, $course, $cm) = get_context_info_array($manager->get_context()->id);
00035 
00036 require_login($course, true, $cm);
00037 
00038 $controller = $manager->get_controller('rubric');
00039 $options = $controller->get_options();
00040 
00041 if (!$controller->is_form_defined() || empty($options['alwaysshowdefinition'])) {
00042     throw new moodle_exception('nopermissions', 'error', '', get_string('previewrubric', 'gradingform_rubric'));
00043 }
00044 
00045 $title = get_string('gradingof', 'gradingform_rubric', $manager->get_area_title());
00046 $PAGE->set_url(new moodle_url('/grade/grading/form/rubric/preview.php', array('areaid' => $areaid)));
00047 $PAGE->set_title($title);
00048 $PAGE->set_heading($title);
00049 
00050 echo $OUTPUT->header();
00051 echo $OUTPUT->heading($title);
00052 if (!empty($options['showdescriptionstudent'])) {
00053     echo $OUTPUT->box($controller->get_formatted_description(), 'gradingform_rubric-description');
00054 }
00055 echo $controller->render_preview($PAGE);
00056 echo $OUTPUT->footer();
 All Data Structures Namespaces Files Functions Variables Enumerations