mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-31341 mod_assign: fixup minor coding style issues
This commit is contained in:
parent
94fb9f9fae
commit
3a66d4255d
@ -64,13 +64,14 @@ function xmldb_assign_upgrade($oldversion) {
|
|||||||
// Assign savepoint reached.
|
// Assign savepoint reached.
|
||||||
upgrade_mod_savepoint(true, 2012071800, 'assign');
|
upgrade_mod_savepoint(true, 2012071800, 'assign');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($oldversion < 2012081600) {
|
if ($oldversion < 2012081600) {
|
||||||
|
|
||||||
// Define field sendlatenotifications to be added to assign
|
// Define field sendlatenotifications to be added to assign.
|
||||||
$table = new xmldb_table('assign');
|
$table = new xmldb_table('assign');
|
||||||
$field = new xmldb_field('completionsubmit', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'timemodified');
|
$field = new xmldb_field('completionsubmit', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'timemodified');
|
||||||
|
|
||||||
// Conditionally launch add field sendlatenotifications
|
// Conditionally launch add field sendlatenotifications.
|
||||||
if (!$dbman->field_exists($table, $field)) {
|
if (!$dbman->field_exists($table, $field)) {
|
||||||
$dbman->add_field($table, $field);
|
$dbman->add_field($table, $field);
|
||||||
}
|
}
|
||||||
|
@ -955,12 +955,12 @@ function assign_get_completion_state($course,$cm,$userid,$type) {
|
|||||||
|
|
||||||
$assign = new assign(null, $cm, $course);
|
$assign = new assign(null, $cm, $course);
|
||||||
|
|
||||||
// If completion option is enabled, evaluate it and return true/false
|
// If completion option is enabled, evaluate it and return true/false.
|
||||||
if ($assign->get_instance()->completionsubmit) {
|
if ($assign->get_instance()->completionsubmit) {
|
||||||
$submission = $DB->get_record('assign_submission', array('assignment'=>$assign->get_instance()->id, 'userid'=>$userid), '*', IGNORE_MISSING);
|
$submission = $DB->get_record('assign_submission', array('assignment'=>$assign->get_instance()->id, 'userid'=>$userid), '*', IGNORE_MISSING);
|
||||||
return $submission && $submission->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
return $submission && $submission->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED;
|
||||||
} else {
|
} else {
|
||||||
// Completion option is not enabled so just return $type
|
// Completion option is not enabled so just return $type.
|
||||||
return $type;
|
return $type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user