Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/workshop/editformpreview.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00027 require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
00028 require_once(dirname(__FILE__).'/locallib.php');
00029 
00030 $cmid     = required_param('cmid', PARAM_INT);
00031 $cm       = get_coursemodule_from_id('workshop', $cmid, 0, false, MUST_EXIST);
00032 $course   = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
00033 $workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST);
00034 
00035 require_login($course, false, $cm);
00036 if (isguestuser()) {
00037     print_error('guestsarenotallowed');
00038 }
00039 $workshop = new workshop($workshop, $cm, $course);
00040 
00041 require_capability('mod/workshop:editdimensions', $workshop->context);
00042 $PAGE->set_url($workshop->previewform_url());
00043 $PAGE->set_title($workshop->name);
00044 $PAGE->set_heading($course->fullname);
00045 $PAGE->navbar->add(get_string('editingassessmentform', 'workshop'), $workshop->editform_url(), navigation_node::TYPE_CUSTOM);
00046 $PAGE->navbar->add(get_string('previewassessmentform', 'workshop'));
00047 $currenttab = 'editform';
00048 
00049 // load the grading strategy logic
00050 $strategy = $workshop->grading_strategy_instance();
00051 
00052 // load the assessment form
00053 $mform = $strategy->get_assessment_form($workshop->editform_url(), 'preview');
00054 
00055 // output starts here
00056 echo $OUTPUT->header();
00057 echo $OUTPUT->heading(get_string('assessmentform', 'workshop'), 2);
00058 $mform->display();
00059 echo $OUTPUT->footer();
 All Data Structures Namespaces Files Functions Variables Enumerations