MDL-29795 assign: Apply overrides to get_assignments
This commit also fix a problem in the previous commit
This commit is contained in:
@@ -200,7 +200,7 @@ function xmldb_assign_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2016070402) {
|
||||
if ($oldversion < 2016100301) {
|
||||
|
||||
// Define table assign_overrides to be created.
|
||||
$table = new xmldb_table('assign_overrides');
|
||||
@@ -227,7 +227,7 @@ function xmldb_assign_upgrade($oldversion) {
|
||||
}
|
||||
|
||||
// Assign savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2016070402, 'assign');
|
||||
upgrade_mod_savepoint(true, 2016100301, 'assign');
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -403,6 +403,8 @@ class mod_assign_external extends external_api {
|
||||
}
|
||||
|
||||
$assign = new assign($context, null, null);
|
||||
// Update assign with override information.
|
||||
$assign->update_effective_access($USER->id);
|
||||
|
||||
// Get configurations for only enabled plugins.
|
||||
$plugins = $assign->get_submission_plugins();
|
||||
@@ -433,12 +435,12 @@ class mod_assign_external extends external_api {
|
||||
'sendnotifications' => $module->sendnotifications,
|
||||
'sendlatenotifications' => $module->sendlatenotifications,
|
||||
'sendstudentnotifications' => $module->sendstudentnotifications,
|
||||
'duedate' => $module->duedate,
|
||||
'allowsubmissionsfromdate' => $module->allowsubmissionsfromdate,
|
||||
'duedate' => $assign->get_instance()->duedate,
|
||||
'allowsubmissionsfromdate' => $assign->get_instance()->allowsubmissionsfromdate,
|
||||
'grade' => $module->grade,
|
||||
'timemodified' => $module->timemodified,
|
||||
'completionsubmit' => $module->completionsubmit,
|
||||
'cutoffdate' => $module->cutoffdate,
|
||||
'cutoffdate' => $assign->get_instance()->cutoffdate,
|
||||
'teamsubmission' => $module->teamsubmission,
|
||||
'requireallteammemberssubmit' => $module->requireallteammemberssubmit,
|
||||
'teamsubmissiongroupingid' => $module->teamsubmissiongroupingid,
|
||||
@@ -1788,7 +1790,7 @@ class mod_assign_external extends external_api {
|
||||
|
||||
$notices = array();
|
||||
|
||||
$assign->update_effective_access($USER->id);
|
||||
$assignment->update_effective_access($USER->id);
|
||||
if (!$assignment->submissions_open($USER->id)) {
|
||||
$notices[] = get_string('duedatereached', 'assign');
|
||||
} else {
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->component = 'mod_assign'; // Full name of the plugin (used for diagnostics).
|
||||
$plugin->version = 2016100300; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2016100301; // The current module version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016051900; // Requires this Moodle version.
|
||||
$plugin->cron = 60;
|
||||
|
||||
Reference in New Issue
Block a user