| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Summary view] [Print] [Text view]
1 <?php // $Id: view.php,v 1.42 2007/08/17 12:15:33 skodak Exp $ 2 3 require_once("../../config.php"); 4 require_once ("lib.php"); 5 6 $id = optional_param('id', 0, PARAM_INT); // Course Module ID 7 $a = optional_param('a', 0, PARAM_INT); // Assignment ID 8 9 if ($id) { 10 if (! $cm = get_coursemodule_from_id('assignment', $id)) { 11 error("Course Module ID was incorrect"); 12 } 13 14 if (! $assignment = get_record("assignment", "id", $cm->instance)) { 15 error("assignment ID was incorrect"); 16 } 17 18 if (! $course = get_record("course", "id", $assignment->course)) { 19 error("Course is misconfigured"); 20 } 21 } else { 22 if (!$assignment = get_record("assignment", "id", $a)) { 23 error("Course module is incorrect"); 24 } 25 if (! $course = get_record("course", "id", $assignment->course)) { 26 error("Course is misconfigured"); 27 } 28 if (! $cm = get_coursemodule_from_instance("assignment", $assignment->id, $course->id)) { 29 error("Course Module ID was incorrect"); 30 } 31 } 32 33 require_login($course, true, $cm); 34 35 require ("$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php"); 36 $assignmentclass = "assignment_$assignment->assignmenttype"; 37 $assignmentinstance = new $assignmentclass($cm->id, $assignment, $cm, $course); 38 39 $assignmentinstance->view(); // Actually display the assignment! 40 41 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |