@Mariano
You are joining this thread very late. Original posting was in June of 2023.
So let's check something about your situation first.
1. You are attempting upgrading from what version of Moodle core code?
2. to what moodle version?
The error 'in use' might be misleading ... the old assignment (a mod) might just be still present rather than in use.
Docs on upgrading to 4.0 suggested to uninstall assignment (2.2) from the system prior to attempting to upgrade to 4.0 or for that matter any 4.x. Mr. V is semi correct in that assignment 2.2 was not supposed to be used ... was actually hidden and not really removed all this time. (the name itself 2.2 shows when that change happended. All assignments in moodle should have been of the new 'assign' ... NOT of the old hidden assignment 2.2.
Depending upon your answers for 1 and 2 above, the fix might be simply to manually erase the mod/assignment directory and try upgrading again.
That's mod/assignment ... NOT mod/assign ... mod/assign STAYS!
In your DB, using phpmyadmin would be fine ... execute the following query - assumes the prefix to the DB is mdl_ ... that can be found in config.php file at root of your moodle code:
show tables like 'mdl_assign%';
That should show
Tables_in_moodle311 (mdl_assign%) |
+-----------------------------------+
| mdl_assign |
| mdl_assign_grades |
| mdl_assign_overrides |
| mdl_assign_plugin_config |
| mdl_assign_submission |
| mdl_assign_user_flags |
| mdl_assign_user_mapping |
| mdl_assignfeedback_comments |
| mdl_assignfeedback_editpdf_annot |
| mdl_assignfeedback_editpdf_cmnt |
| mdl_assignfeedback_editpdf_queue |
| mdl_assignfeedback_editpdf_quick |
| mdl_assignfeedback_editpdf_rot |
| mdl_assignfeedback_file |
| mdl_assignsubmission_file |
| mdl_assignsubmission_onlinetext |
There should be no tables with mdl_assignment.
If there are no tables for 'prefix'_assignment_blah', then you only need to manually delete the 'assignment' directory in yourmoodlecode/mod/ and try the upgrade again.
'SoS', Ken