From: gustav_delius Date: Wed, 5 Apr 2006 18:52:37 +0000 (+0000) Subject: Removed some unnecessary code X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e8a4049ddd549b4e05ea8043d3abbcae2ee77eae;p=moodle.git Removed some unnecessary code --- diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php index bae32e1421..1afca647bc 100644 --- a/mod/assignment/type/online/assignment.class.php +++ b/mod/assignment/type/online/assignment.class.php @@ -176,51 +176,6 @@ class assignment_online extends assignment_base { } - /* - * Display and process the submissions - */ - function process_feedback() { - - global $USER; - - if (!$feedback = data_submitted()) { // No incoming data? - return false; - } - - ///For save and next, we need to know the userid to save, and the userid to go... - ///We use a new hidden field in the form, and set it to -1. If it's set, we use this - ///as the userid to store... - if ((int)$feedback->saveuserid !== -1){ - $feedback->userid = $feedback->saveuserid; - } - - if (!empty($feedback->cancel)) { // User hit cancel button - return false; - } - - $newsubmission = $this->get_submission($feedback->userid, true); // Get or make one - - $newsubmission->grade = $feedback->grade; - $newsubmission->comment = $feedback->comment; - $newsubmission->format = $feedback->format; - $newsubmission->teacher = $USER->id; - $newsubmission->mailed = 0; // Make sure mail goes out (again, even) - $newsubmission->timemarked = time(); - - unset($newsubmission->data1); // Don't need to update this. - unset($newsubmission->data2); // Don't need to update this. - - if (! update_record('assignment_submissions', $newsubmission)) { - return false; - } - - add_to_log($this->course->id, 'assignment', 'update grades', - 'submissions.php?id='.$this->assignment->id.'&user='.$feedback->userid, $feedback->userid, $this->cm->id); - - return $newsubmission; - - } - function print_student_answer($userid, $return=false){ global $CFG; if (!$submission = $this->get_submission($userid)) { diff --git a/mod/assignment/type/uploadsingle/assignment.class.php b/mod/assignment/type/uploadsingle/assignment.class.php index 791db7966f..50484b4b58 100644 --- a/mod/assignment/type/uploadsingle/assignment.class.php +++ b/mod/assignment/type/uploadsingle/assignment.class.php @@ -152,50 +152,6 @@ class assignment_uploadsingle extends assignment_base { } - /* - * Display and process the submissions - */ - function process_feedback() { - - global $USER; - - if (!$feedback = data_submitted()) { // No incoming data? - return false; - } - - ///For save and next, we need to know the userid to save, and the userid to go... - ///We use a new hidden field in the form, and set it to -1. If it's set, we use this - ///as the userid to store... - if ((int)$feedback->saveuserid !== -1){ - $feedback->userid = $feedback->saveuserid; - } - - if (!empty($feedback->cancel)) { // User hit cancel button - return false; - } - - $newsubmission = $this->get_submission($feedback->userid, true); // Get or make one - - $newsubmission->grade = $feedback->grade; - $newsubmission->comment = $feedback->comment; - $newsubmission->format = $feedback->format; - $newsubmission->teacher = $USER->id; - $newsubmission->mailed = 0; // Make sure mail goes out (again, even) - $newsubmission->timemarked = time(); - - unset($newsubmission->data1); // Don't need to update this. - unset($newsubmission->data2); // Don't need to update this. - - if (! update_record('assignment_submissions', $newsubmission)) { - return false; - } - - add_to_log($this->course->id, 'assignment', 'update grades', - 'submissions.php?id='.$this->assignment->id.'&user='.$feedback->userid, $feedback->userid, $this->cm->id); - - return $newsubmission; - - } }