General developer forum

How to install an edited moodle activity as a new plugin?

 
Picture of v k
How to install an edited moodle activity as a new plugin?
 

Hi friends!

In Moodle v.3.1, I've edited the /mod/quiz activty so that it works the way I want. 

Now I have another pure Moodle installation with /mod/quiz unchanged.

Ho can I move 'edited quiz' from Moodle 1 to Moodle 2, so that Moodle 2 recognizes it as a new plugin/activity to be installed, so that there will be standard quiz and 'edited quiz' alongside?

Hope somebody gives answer smile

 
Average of ratings: -
Picture of v k
Re: How to install an edited moodle activity as a new plugin?
 

Ok, what's done up to now:

I copied the /mod/quiz folder to the /local folder

Then I renamed all occurences of the 'quiz' to 'quiz_edited' for both files' names and its content.

I failed to rename some files in /yui/build.., so I've just deleted the 'build' folder hoping that is not a big thing in core functionality...

After that, I increased the version index in /local/quiz_edited/version.php

I hoped after all that done, the site would recognize a new module to be installed, but nothing happened. I tried to purge all caches, and visited Administration/Notofocation page - no mentionings of 'quiz_edited'.

Also I went to Administration/Plugins/Local, but is said 'Nothing to display'.

If I type in address manually (like siteurl/mod/quiz/view.php?id=777 I changed to siteurl/local/quiz_edited/view.php?id=777) and go to it, the site says that I do not have permissions for '/mod/quiz_edited:..."

So could somebody give a tip please, what should I change in php files, or maybe delete something, so that the site recognizes a new module? Also, the similar question for adding capabilities...


 
Average of ratings: -
Picture of Richard Oelmann
Re: How to install an edited moodle activity as a new plugin?
Core developersParticularly helpful MoodlersPlugin developersTesters

Well, the first thing you'll have to do is put it back in the mod folder alongside /quiz. 

 
Average of ratings: -
Picture of v k
Re: How to install an edited moodle activity as a new plugin?
 
Hi, Richard,

Thank you for your help.

I've put the 'quiz_edited' folder back in the /mod folder alongside 'quiz'.

Also I added 'quiz_edited' to the 'modules' table. But when I go to Administration / Plugins / Activity modules / Mange activity modules, it shows error like the is no $string['modulename'] in /lang/en/quiz_edited.php.. But I checked - such a string exists.. Why Moodle doesn't recognize it?

Also now, when trying to go to /mod/quiz_edited/view.php?id=777, I get this:

 Invalid component used in plugin_supports():mod_quiz_edited

I know it looks like I am doing it the wrong way, but how to do the basics:
What should be done step-by-step to make Moodle system recognize my 'quiz_edited' folder, which is at 90% similar to the original 'quiz' folder?


Thanks all helpers!


 
Average of ratings: -