MDL-68913 mod_assign: fix behat failure & version number

This commit is contained in:
Sara Arjona 2021-11-11 12:15:50 +01:00
parent 3da8ea4699
commit f94f9f875d
3 changed files with 5 additions and 4 deletions

View File

@ -1375,7 +1375,8 @@ class renderer extends \plugin_renderer_base {
protected function get_time_remaining(\mod_assign\output\assign_submission_status $status): array {
$time = time();
$submission = $status->teamsubmission ? $status->teamsubmission : $status->submission;
$timelimitenabled = get_config('assign', 'enabletimelimit') && $status->timelimit > 0 && $submission->timestarted;
$submissionstarted = $submission && property_exists($submission, 'timestarted') && $submission->timestarted;
$timelimitenabled = get_config('assign', 'enabletimelimit') && $status->timelimit > 0 && $submissionstarted;
$duedatereached = $status->duedate > 0 && $status->duedate - $time <= 0;
$timelimitenabledbeforeduedate = $timelimitenabled && !$duedatereached;

View File

@ -59,7 +59,7 @@ function xmldb_assign_upgrade($oldversion) {
// Automatically generated Moodle v3.9.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2021093000) {
if ($oldversion < 2021110901) {
// Define field activity to be added to assign.
$table = new xmldb_table('assign');
$field = new xmldb_field('activity', XMLDB_TYPE_TEXT, null, null, null, null, null, 'alwaysshowdescription');
@ -109,7 +109,7 @@ function xmldb_assign_upgrade($oldversion) {
}
// Assign savepoint reached.
upgrade_mod_savepoint(true, 2021093000, 'assign');
upgrade_mod_savepoint(true, 2021110901, 'assign');
}
return true;

View File

@ -25,5 +25,5 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'mod_assign'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2021110900; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2021110901; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2021052500; // Requires this Moodle version.