. /** * @package plagiarism_pchkorg * @category plagiarism * @copyright PlagiarismCheck.org, https://plagiarismcheck.org/ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); function xmldb_plagiarism_pchkorg_upgrade($oldversion) { global $DB; $dbman = $DB->get_manager(); if ($oldversion < 2021072801) { $table = new xmldb_table('plagiarism_pchkorg_files'); $field1 = new xmldb_field('signature', XMLDB_TYPE_CHAR, '40', null, null, null, null, null); $field1->setComment('Signature'); $field2 = new xmldb_field('attempt', XMLDB_TYPE_INTEGER, '5', null, null, null, 0, null); $field2->setComment('Sending attempts'); $field3 = new xmldb_field('itemid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, null); $field3->setComment('ID of file'); if (!$dbman->field_exists($table, $field1)) { $dbman->add_field($table, $field1); } if (!$dbman->field_exists($table, $field2)) { $dbman->add_field($table, $field2); } if (!$dbman->field_exists($table, $field3)) { $dbman->add_field($table, $field3); } upgrade_plugin_savepoint(true, 2021072801, 'plagiarism', 'pchkorg'); } if ($oldversion < 2023060713) { $table = new xmldb_table('plagiarism_pchkorg_files'); $field1 = new xmldb_field('scoreai', XMLDB_TYPE_NUMBER, '4,2', XMLDB_UNSIGNED, null, null, null, null); $field1->setComment('AI score'); if (!$dbman->field_exists($table, $field1)) { $dbman->add_field($table, $field1); } } return true; }