123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
- require_once(dirname(__FILE__).'/lib.php');
- global $DB;
- $id = optional_param('id', 0, PARAM_INT); // course_module ID, or
- $g = optional_param('g', 0, PARAM_INT); // gradeimporter instance ID, should be named as the first character of the module
- if ($id) {
- if (! $cm = get_coursemodule_from_id('gradeimporter', $id)) {
- error('Course Module ID was incorrect');
- }
- if (! $course = $DB->get_record('course', array('id'=> $cm->course))) {
- error('Course is misconfigured');
- }
- if (! $gradeimporter = $DB->get_record('gradeimporter', array('id'=> $cm->instance) ) ) {
- error('Course module is incorrect');
- }
- } else if ($g) {
- if (! $gradeimporter = $DB->get_record('gradeimporter', array('id'=> $g)) ){
- error('Course module is incorrect');
- }
- if (! $course = $DB->get_record('course', array('id'=> $gradeimporter->course)) ) {
- error('Course is misconfigured');
- }
- if (! $cm = get_coursemodule_from_instance('gradeimporter', $gradeimporter->id, $course->id)) {
- error('Course Module ID was incorrect');
- }
- } else {
- error('You must specify a course_module ID or an instance ID');
- }
- require_login($course, true, $cm);
- $context = context_module::instance($cm->id);
- /// Print the page header
- $PAGE->set_url('/mod/gradeimporter/view.php', array('id' => $cm->id));
- $PAGE->set_title(format_string($gradeimporter->name));
- $PAGE->set_heading(format_string($course->fullname));
- $PAGE->set_context($context);
- /// Print the main part of the page
- $output = $PAGE->get_renderer('mod_folder');
- echo $output->header();
- $heading = get_string('displayingview', 'gradeimporter', $gradeimporter->name);
- echo $output->heading($heading);
- //tabela com as notas vem aqui
- echo 'parte principal do importador de notas';
- /// Finish the page
- echo $output->footer();
|