mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
Merge branch 'm_MDL-30957_adding_assignment_completion_status_method_and_call' of git://github.com/gerrywastaken/moodle
This commit is contained in:
commit
52b2afa553
@ -400,7 +400,8 @@ class assignment_base {
|
||||
} else {
|
||||
if (isloggedin()) {
|
||||
if ($submission = $this->get_submission($USER->id)) {
|
||||
if ($submission->timemodified) {
|
||||
// If the submission has been completed
|
||||
if ($this->is_submitted_with_required_data($submission)) {
|
||||
if ($submission->timemodified <= $this->assignment->timedue || empty($this->assignment->timedue)) {
|
||||
$submitted = '<span class="early">'.userdate($submission->timemodified).'</span>';
|
||||
} else {
|
||||
@ -1823,6 +1824,18 @@ class assignment_base {
|
||||
return $DB->get_record('assignment_submissions', array('assignment'=>$this->assignment->id, 'userid'=>$userid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the given submission is complete. Preliminary rows are often created in the assignment_submissions
|
||||
* table before a submission actually takes place. This function checks to see if the given submission has actually
|
||||
* been submitted.
|
||||
*
|
||||
* @param stdClass $submission The submission we want to check for completion
|
||||
* @return bool Indicates if the submission was found to be complete
|
||||
*/
|
||||
public function is_submitted_with_required_data($submission) {
|
||||
return $submission->timemodified;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new submission object for a given user
|
||||
*
|
||||
|
@ -1152,6 +1152,18 @@ class assignment_upload extends assignment_base {
|
||||
send_temp_file($zipfile, $filename); //send file and delete after sending.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the given submission is complete. Preliminary rows are often created in the assignment_submissions
|
||||
* table before a submission actually takes place. This function checks to see if the given submission has actually
|
||||
* been submitted.
|
||||
*
|
||||
* @param stdClass $submission The submission we want to check for completion
|
||||
* @return bool Indicates if the submission was found to be complete
|
||||
*/
|
||||
public function is_submitted_with_required_data($submission) {
|
||||
return ($submission->timemodified AND $submission->data2);
|
||||
}
|
||||
}
|
||||
|
||||
class mod_assignment_upload_notes_form extends moodleform {
|
||||
|
@ -393,6 +393,18 @@ class assignment_uploadsingle extends assignment_base {
|
||||
send_temp_file($zipfile, $filename); //send file and delete after sending.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the given submission is complete. Preliminary rows are often created in the assignment_submissions
|
||||
* table before a submission actually takes place. This function checks to see if the given submission has actually
|
||||
* been submitted.
|
||||
*
|
||||
* @param stdClass $submission The submission we want to check for completion
|
||||
* @return bool Indicates if the submission was found to be complete
|
||||
*/
|
||||
public function is_submitted_with_required_data($submission) {
|
||||
return ($submission->timemodified AND $submission->numfiles > 0);
|
||||
}
|
||||
}
|
||||
|
||||
class mod_assignment_uploadsingle_response_form extends moodleform {
|
||||
|
Loading…
x
Reference in New Issue
Block a user