Removed some unnecessary code
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user