Index: temp_moodle_dev/moodle/mod/assignment/view.php =================================================================== RCS file: /usr/local/cvsroot/temp_moodle_dev/moodle/mod/assignment/view.php,v diff -u -r1.2 -r1.3 --- temp_moodle_dev/moodle/mod/assignment/view.php 10 Dec 2008 23:22:13 -0000 1.2 +++ temp_moodle_dev/moodle/mod/assignment/view.php 28 Oct 2009 07:32:03 -0000 1.3 @@ -5,16 +5,14 @@ $id = optional_param('id', 0, PARAM_INT); // Course Module ID $a = optional_param('a', 0, PARAM_INT); // Assignment ID - $editing = optional_param('editing', 0, PARAM_INT); // 1 if editing in Lams - $saved = optional_param('saved', 0, PARAM_INT); - - + $editing = optional_param('editing', 0, PARAM_INT); // 1 if editing in Lams + $saved = optional_param('saved', 0, PARAM_INT); + if ($id) { - if (! $cm = get_coursemodule_from_id('assignment', $id)) { error("Course Module ID was incorrect"); } - + if (! $assignment = get_record("assignment", "id", $cm->instance)) { error("assignment ID was incorrect"); } @@ -32,25 +30,25 @@ if (! $cm = get_coursemodule_from_instance("assignment", $assignment->id, $course->id)) { error("Course Module ID was incorrect"); } - } + //if is lams display navigation buttons so you can finish uploading or go to next activity - if($cm->is_lams==1){ - if($editing==1){ - include('showlamsfinish.php'); - }else{ - $isteacher = has_capability('mod/assignment:preview', get_context_instance(CONTEXT_MODULE, $cm->id)); // indicates if is a teacher, useful in lams - if($isteacher||$saved==1||$assignment->assignmenttype=="offline"){ - include('showlamsnext.php'); - } - } + if($cm->is_lams==1){ + if($editing==1){ + include('showlamsfinish.php'); + }else{ + $isteacher = has_capability('mod/assignment:preview', get_context_instance(CONTEXT_MODULE, $cm->id)); // indicates if is a teacher, useful in lams + if($isteacher||$saved==1||$assignment->assignmenttype=="offline"){ + include('showlamsnext.php'); + } } + } require_login($course, true, $cm); - require ("$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php"); $assignmentclass = "assignment_$assignment->assignmenttype"; $assignmentinstance = new $assignmentclass($cm->id, $assignment, $cm, $course); - $assignmentinstance->view(); // Actually display the assignment! + $assignmentinstance->view(); // Actually display the assignment! + ?>