Assignment 2.2 is in use Error

Assignment 2.2 is in use Error

Alexander Taft -
Atsakymų skaičius: 9
I am upgrading our Moodle Instance (3.9) via command line/git and have been presented with the following error after checking out 402 stable and running upgrade.php:

== Environment ==
!! Assignment 2.2 is in use !!
[System] this test must pass - Your site is still using the Assignment 2.2 plugin. Before upgrading you
must 1) backup any Assignment 2.2 activities that you want to keep and
restore them as Assignment activities, and 2) delete all Assignment 2.2
data from the database.

I can't find any directions on how to do this via the command line, and there is no tool in the web Server Check to do this either. Is this as simple as backing up the assignment table in the MySQL database and deleting all data there within? What about the assignment_submissions table?

Thanks!
Pažymių vidurkis: -
Atsakymas į Alexander Taft

Re: Assignment 2.2 is in use Error

Visvanath Ratnaweera -
Particularly helpful Moodlers paveikslėlis Translators paveikslėlis
Assignment 2.2 format has been abandoned. For many, many years there was a conversion tool in Moodle and has been removed in Moodle 3.6. See Assignment upgrade tool
Atsakymas į Visvanath Ratnaweera

Re: Assignment 2.2 is in use Error

Alexander Taft -
OK, that confirms to me that these must be ancient legacy assignments, so I've deleted them (after saving a backup) and the installation proceeded AOK.

Thanks!
Atsakymas į Alexander Taft

Odp: Re: Assignment 2.2 is in use Error

Kate James -
How could you help me, what should I do in such a situation? I don't understand what's going on and I have a similar error when updating 🤔
Atsakymas į Alexander Taft

Re: Assignment 2.2 is in use Error

Mariano Acciardi -
Hi Alex, same problem than Kate here. I don't know what I have to delete or to check which assigment ar those. Can you help us to know what you have deleted?


Thanks
Regards
Mariano
Atsakymas į Mariano Acciardi

Re: Assignment 2.2 is in use Error

Ken Task -
Particularly helpful Moodlers paveikslėlis
@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

Atsakymas į Ken Task

Re: Assignment 2.2 is in use Error

Mariano Acciardi -
Hi Ken, yeah you are right, I'm joining late to this thread. Thank for your quick response. I'm upgrading from Moodle 4.1.1+ (Build: 20230120) to version Moodle 4.3.2+ (Build: 20240112). I'm very surprising that this notification does not showed on my last upgrade to version 4.1.1. . Thanks a lot to tell me how to identify mdl_assignment tables.

I maintain a campus with a lot of years and with a lot of courses of Buenos Aires University, Psychology department, maybe this plugin assignment has been installed a lot of years ago. What is the exactly resource that this plugin is? How can I know if this plugin is being using from some course?

Thank a lot for your help.
Best Regards
Mariano
Atsakymas į Mariano Acciardi

Re: Assignment 2.2 is in use Error

Ken Task -
Particularly helpful Moodlers paveikslėlis
In the GUI admin of your site, go to:
Site Admin -> Plugins _> Manage Activities.
There you will see a listing of plugins and a count of usage for each.
If you see NO Assignment (2.2), it's hidden, and thus it's not being used.

To assure your self of that, use a similar query:
show tables like 'mdl_assignment%:
then
select * from mdl_assignment;

If the second query doesn't show anything - returns no rows ... not being used.

Thus safe to remove the 'assignment' directory in your code and update the DB.   If that does not clean up the DB,  you could drop all tables for 'mdl_assignment' ... carefully, one at a time.

Obviously, if one is going to work directly with the DB, *best* if you make a backup (sql dump) of the DB prior to dropping tables ... just to be safe!

'SoS', Ken

Atsakymas į Ken Task

Re: Assignment 2.2 is in use Error

Mariano Acciardi -
Thanks a lot Ken for your great support. I think is the first time we interact, but I've used your post many times in the last 5 years that I do this job.

Finally I've uninstalled the plugin assignment, and uninstallation delete both folders in OS and tables in db. With that I was able to upgrade to 4.3.2 (Build: 20231222)

I saw on "manage activities" that It showed 124 courses with instances of it, but I entered in some of them and I didn't found this instances, only instances of normal "Task" . However it was grayed, disabled, so I think than no one are using task 2.2 during the last years.

I'm currently testing for errors, I' ve had a lot of problems with the icons and resurces names in courses view, even I've upgraded the theme to last version available. We are using theme adaptable. I had to apply this workarounds to fix them: https://moodle.org/mod/forum/discuss.php?d=451421 but now mostly seems to works.

Thanks a lot again!!
Best Regards
Mariano Acciardi
Atsakymas į Mariano Acciardi

RESOLVED Re: Assignment 2.2 is in use Error

Ken Task -
Particularly helpful Moodlers paveikslėlis
Good to hear!    Suggestion ... next time you have an issue, don't piggy back a posting!   After all, your issue deserves individual attention!  By NOT piggy backing it is less confusing for any following a thread. besišypsantis

I've marked yours as solved now.

'SoS', Ken