mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
Merge branch 'MDL-69297-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE
This commit is contained in:
commit
f2fe8b1664
1 changed files with 15 additions and 0 deletions
|
@ -5129,17 +5129,32 @@ class assign {
|
||||||
require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php');
|
require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php');
|
||||||
|
|
||||||
// Check that all of the submission plugins are ready for this submission.
|
// Check that all of the submission plugins are ready for this submission.
|
||||||
|
// Also check whether there is something to be submitted as well against atleast one.
|
||||||
$notifications = array();
|
$notifications = array();
|
||||||
$submission = $this->get_user_submission($USER->id, false);
|
$submission = $this->get_user_submission($USER->id, false);
|
||||||
|
if ($this->get_instance()->teamsubmission) {
|
||||||
|
$submission = $this->get_group_submission($USER->id, 0, false);
|
||||||
|
}
|
||||||
|
|
||||||
$plugins = $this->get_submission_plugins();
|
$plugins = $this->get_submission_plugins();
|
||||||
|
$hassubmission = false;
|
||||||
foreach ($plugins as $plugin) {
|
foreach ($plugins as $plugin) {
|
||||||
if ($plugin->is_enabled() && $plugin->is_visible()) {
|
if ($plugin->is_enabled() && $plugin->is_visible()) {
|
||||||
$check = $plugin->precheck_submission($submission);
|
$check = $plugin->precheck_submission($submission);
|
||||||
if ($check !== true) {
|
if ($check !== true) {
|
||||||
$notifications[] = $check;
|
$notifications[] = $check;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_object($submission) && !$plugin->is_empty($submission)) {
|
||||||
|
$hassubmission = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there are no submissions and no existing notifications to be displayed the stop.
|
||||||
|
if (!$hassubmission && !$notifications) {
|
||||||
|
$notifications[] = get_string('addsubmission_help', 'assign');
|
||||||
|
}
|
||||||
|
|
||||||
$data = new stdClass();
|
$data = new stdClass();
|
||||||
$adminconfig = $this->get_admin_config();
|
$adminconfig = $this->get_admin_config();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue