|
@@ -13,9 +13,13 @@
|
|
|
* will tell you what you need to do.
|
|
|
* The commands in here will all be database-neutral,
|
|
|
* using the functions defined in lib/ddllib.php
|
|
|
- *
|
|
|
+ *
|
|
|
+ * - v 1.5.3 2021/10/10
|
|
|
+ * + Fixed several string concatenation from '+' to '.'
|
|
|
+ * + Since now is allowed null file associated to "test" activity,
|
|
|
+ * fixed UPDATE do "filesid=file" with try/catch and 'WHERE file IS NOT NULL"'
|
|
|
* - v 1.5.2 2020/08/03
|
|
|
- * + Fixed 'ALTER TABLE' of 'iassign_submission.grade' from BIGINT(11) to REAL
|
|
|
+ * + Fixed 'ALTER TABLE' of 'iassign_submission.grade' from BIGINT(11) to REAL
|
|
|
* + New version of iHanoi 1.0.20200803
|
|
|
* - v 1.5.1 2020/05/28-30
|
|
|
* + Avoid to update one iLM causing colision with other instance of the same iLM
|
|
@@ -104,7 +108,7 @@ function xmldb_iassign_upgrade ($oldversion) {
|
|
|
if ($iassign->name == $record['name'] && strtolower($iassign->type) == $record_type) {
|
|
|
if ($iassign->version == $record['version']) {
|
|
|
$exists = 1;
|
|
|
- $strNot_installed += "\n" + ' <li>' + $record['name'] + ';' + $record['type'] + ';' + $record['version'] + ' </li>' + "\n";
|
|
|
+ $strNot_installed .= "\n" . ' <li>' . $record['name'] . ';' . $record['type'] . ';' . $record['version'] . ' </li>' . "\n";
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -117,12 +121,12 @@ function xmldb_iassign_upgrade ($oldversion) {
|
|
|
}
|
|
|
}
|
|
|
if ($strNot_installed != '') {
|
|
|
- print '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >' + "\n";
|
|
|
+ print '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >' . "\n";
|
|
|
print get_string('upgrade_alert_exists', 'iassign');
|
|
|
- print ' <ul style="margin-top: 1rem;">' + "\n";
|
|
|
+ print ' <ul style="margin-top: 1rem;">' . "\n";
|
|
|
print $strNot_installed;
|
|
|
- print ' </ul>' + "\n";
|
|
|
- print '</div>' + "\n";
|
|
|
+ print ' </ul>' . "\n";
|
|
|
+ print '</div>' . "\n";
|
|
|
}
|
|
|
|
|
|
|
|
@@ -148,14 +152,14 @@ function xmldb_iassign_upgrade ($oldversion) {
|
|
|
}
|
|
|
|
|
|
if ($strNot_found != '') {
|
|
|
- print '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >' + "\n";
|
|
|
+ print '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >' . "\n";
|
|
|
print get_string('upgrade_alert_iMA_msg', 'iassign');
|
|
|
- print '<ul style="margin-top: 1rem;">' + "\n";
|
|
|
+ print '<ul style="margin-top: 1rem;">' . "\n";
|
|
|
print $strNot_found;
|
|
|
- print '</ul>' + "\n";
|
|
|
+ print '</ul>' . "\n";
|
|
|
print get_string('upgrade_alert_iMA_solution_pt1', 'iassign');
|
|
|
print '<a href="'.new moodle_url('/admin/settings.php?section=modsettingiassign').'">' . get_string('upgrade_alert_iMA_solution_pt2', 'iassign') . '</a>.' . "\n";
|
|
|
- print '</div>' + "\n";
|
|
|
+ print '</div>' . "\n";
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -243,7 +247,7 @@ function xmldb_iassign_upgrade ($oldversion) {
|
|
|
$last_id = $iassign->id;
|
|
|
if ($iassign->version == $record['version']) {
|
|
|
$exists = 1;
|
|
|
- $strNot_installed += "\n" + ' <li>' + $record['name'] + ';' + $record['type'] + ';' + $record['version'] + ' </li>' + "\n";
|
|
|
+ $strNot_installed .= "\n" . ' <li>' . $record['name'] . ';' . $record['type'] . ';' . $record['version'] . ' </li>' . "\n";
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -256,12 +260,12 @@ function xmldb_iassign_upgrade ($oldversion) {
|
|
|
}
|
|
|
|
|
|
if ($strNot_installed != '') {
|
|
|
- print '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >' + "\n";
|
|
|
+ print '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >' . "\n";
|
|
|
print get_string('upgrade_alert_exists', 'iassign');
|
|
|
- print ' <ul style="margin-top: 1rem;">' + "\n";
|
|
|
+ print ' <ul style="margin-top: 1rem;">' . "\n";
|
|
|
print $strNot_installed;
|
|
|
- print ' </ul>' + "\n";
|
|
|
- print '</div>' + "\n";
|
|
|
+ print ' </ul>' . "\n";
|
|
|
+ print '</div>' . "\n";
|
|
|
}
|
|
|
|
|
|
|
|
@@ -291,13 +295,17 @@ function xmldb_iassign_upgrade ($oldversion) {
|
|
|
$table = new xmldb_table('iassign_statement');
|
|
|
|
|
|
$field_filesid = new xmldb_field('filesid', XMLDB_TYPE_CHAR, '255', null, null, null, null, null);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
if (!$dbman->field_exists($table, $field_filesid))
|
|
|
$dbman->add_field($table, $field_filesid);
|
|
|
|
|
|
|
|
|
- $DB->execute("UPDATE {iassign_statement} SET filesid = file");
|
|
|
-
|
|
|
+ try {
|
|
|
+
|
|
|
+ $DB->execute("UPDATE {iassign_statement} SET filesid = file WHERE file IS NOT NULL");
|
|
|
+ } catch (Exception $ex) { }
|
|
|
|
|
|
|
|
|
$iassign_contexts_list = $DB->get_records_sql("SELECT DISTINCT contextid FROM {files} f WHERE component='mod_iassign'");
|
|
@@ -346,6 +354,7 @@ function xmldb_iassign_upgrade ($oldversion) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|