-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uninstall? #134
Comments
You first need to delete all the CodeRunner questions from your server. Namely, all the so-called prototype questions in the context System/CR_PROTOTYPES plus any that you or others have added. Once all those questions are deleted there will be an Uninstall link beside the plugin in the Plugins overview page. Click that to delete CodeRunner. You will also probably wish to delete the adaptive_adapted_for_coderunner question behaviour. |
Thank you. In a backup I tried to: drop table question_coderunner_tests; Still no uninstall option on the CodeRunner plugin.. What did I miss? |
I'm pleased you did that in a backup, not the live server. Dropping tables is a bad idea. In fact, you shouldn't need to use SQL at all unless you've written a lot of CodeRunner questions and don't have the patience to hunt them all down and delete them. Question-type plugins use a function 'is_uninstall_allowed()' to check if the Uninstall option can be displayed. The critical line of code in that function is
where for coderunner the value of $this->name is 'coderunner'. So I suggest you create another backup, delete any CodeRunner questions that you know about in your question bank including the built-in prototypes (using the usual web UI not SQL) and then see if the Uninstall option is available. If not, the SQL query
should let you find all the undeleted ones. Note that when you delete a question through the web UI, there's a check to see if it's in use in a quiz. If so, it doesn't actually get deleted but gets put into a special category of old questions. So you should first delete coderunner questions from any quizzes. This does not apply to question prototypes. If you have a lot of coderunner questions you may be able to just delete all the coderunner questions from mdl_question with SQL but I'd be very reluctant to do that myself as it will break the database integrity and I'm not sure that the subsequent plugin deletion will clean up the mess. Certainly any quizzes referring to deleted questions will break. If you do have a lot of CodeRunner questions, then I'm wondering why you want to delete CodeRunner. What went wrong for you? |
I do not have a lot of CodeRunner questions.. I only had one. I can not understand that this is called a "Plug-in" - It certainly is not straight forward to plug out. Anyway, it is sorted now. Thank you. |
Hi! We are going to use it in production. In my tests, I tried to unistall it, and it was really hard to do so. It is not documented (only found this issue by chance). I propose to male it explicit in the documentation “How to uninstall?” Also, I’ll propose to enable unistall it all-in-one, without manual actions. If deleting questions and prototypes are necessary, you could provide the db/unistall.php that would do that for the admin. If you run it as admin you know what are you doing. Maybe you can ask the admin a double check (i.e., “are you sure?”) begore deleting the plugin. Hoping this helps. Thank you a lot for your time. Jordi |
Hi Jordi
Thanks for raising the issue.
I agree 100% that uninstall instructions should be in the documentation. It just isn't something that has even been a priority for me. CodeRunner is free open source software and I've never wanted to uninstall CodeRunner, myself 🙂
However, I've added that to my TODO list when I next have free developer time - probably over the Christmas period when I'm not teaching. If you wish to do it earlier I'd certainly consider a pull request.
However, I'm not sure I can be bothered to write much in the way of specific uninstall software to further simplify the process myself.
As far as I know, all Moodle question type plugins (and probably others) require that any plugin-specific database tables are empty before the Uninstall option is enabled. I agree that CodeRunner is a bit different in that it preloads all the prototypes into the database which is very confusing. So a custom uninstall that simply informed the administrator that all CodeRunner questions including the prototypes need to be deleted before the standard uninstall can proceed would be helpful and bring CodeRunner into line with all other question type plugins. I wouldn't want to go beyond that and just delete all CodeRunner questions, even with a warning. I don't have quite that level of faith in system administrators.
It's not clear from your posting whether you're offering to write the uninstall code or are inviting me to do so. If the former and you write something that simply advises the administrator of what needs to be deleted, that would be great. Beyond that, I'm not keen.
Thanks again
Richard
…________________________________
From: Jordi Pujol-Ahulló ***@***.***>
Sent: Monday, August 8, 2022 8:23 PM
To: trampgeek/moodle-qtype_coderunner ***@***.***>
Cc: Richard Lobb ***@***.***>; State change ***@***.***>
Subject: Re: [trampgeek/moodle-qtype_coderunner] Uninstall? (Issue #134)
Hi!
We are going to use it in production.
In my tests, I tried to unistall it, and it was really hard to do so. It is not documented (only found this issue by chance).
I propose to male it explicit in the documentation “How to uninstall?”
Also, I’ll propose to enable unistall it all-in-one, without manual actions.
If deleting questions and prototypes are necessary, you could provide the db/unistall.php that would do that for the admin. If you run it as admin you know what are you doing. Maybe you can ask the admin a double check (i.e., “are you sure?”) begore deleting the plugin.
Hoping this helps.
Thank you a lot for your time.
Jordi
—
Reply to this email directly, view it on GitHub<#134 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAIM2VQTIS3TKGBCPNXLBX3VYC7Y7ANCNFSM5JKBC5HA>.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
How to uninstall the plugin?
The text was updated successfully, but these errors were encountered: