What should I learn to develop a moodle activity ?
how can i begin plugin development?
There are lots of different Plugin Types with documentation on how to develop them. It's usually recommended that you start with the Block plugin type as it has a detailed tutorial.
Hi Amin
Moodle having many blocks like activities block, html block, login block.........
you can start create your own block also, you can customize, and create form and create own table also..
Hi Amin,
For developers just getting started in Moodle development, testing and fixing 3rd party Moodle plugins which are not currently supported in Moodle 3.1, 3.2 and 3.3 is a great way to get started on your way to learning how Moodle works. These plugins often just need simple fixes, updates to API calls and stuff like that. I recommend that you touch base with the author before you start just to make sure he/she isn't in the middle of a major re-write (that happened to me once or twice).
Start by browsing through the list of 3rd party plugins and choose a plugin that is of interest to you. If you think it would be useful for you, chances are there are others who would think so too.
A few other things you could check as long as you are testing the plugins:
In my experience, these tend to make up 90% of the issues I come across when implementing a 3rd party plugin. The rest are functionality bugs and display issues on mobile devices. For example, I once uncovered an issue with the "Browse Users" page where the table is wrapped in a "no-overflow" class. Unfortunately, the edit/delete links are at the end of the rows which means that they were being cut off and not-accessible on smaller screens. I guess the author simply never tested his code on a narrow screen.
A lot of developers never even consider multiple language and accessibility issues however, these are some of the unique strengths that Moodle has over other LMS'. Tackle what you feel you can. If all you feel that you can do is the HTML validation or uncovering bugs in Developer DEBUG mode right now, then just do that. Don't be afraid to ask questions in the General Developer Forum. The only bad questions are those that are never asked in my opinion but do take a moment to perform a quick search to see if anyone else might have asked the same question in the past.
Don't forget to submit your changes back to the authors. Most authors prefer to get submissions through GitHub but, for small changes or if you are not familiar with Git, you could even just post an issue with a fix on GitHub or Moodle Tracker, both of which you should learn how to use. Check the plugin's page to see the authors "Bug Tracker" link. If you post in the wrong place, the author may never receive your change request. Try not to report bugs on the plugin's page as it clutters the page and becomes irrelevant as soon as the bug has been addressed.
In some cases, especially with older plugins that were last released for Moodle before 3.1, you may discover that the author is no longer be interested in maintaining the plugin. You can then request to become responsible for the future maintenance of the plugin even if it is just to bring it up to date this one time.
By the way, just because you found a bug doesn't necessarily mean you need to be the one to fix it. If the bug is in a plugin, follow the Bug Tracking link on the plugin's page to post your bug report in the right place (see link below on how to do that). If you believe the bug is in Moodle itself, you will need to post your report in Moodle Tracker.
I noticed is that Moodle Activity Modules (mod) tend to need more changes for each new version of Moodle than most other types of plugins. You will see this because the author tends to have different downloads for different versions of Moodle. If you want to get through more plugins with easier issues, start with some of the other types of plugins.
Moodle API documentation - It's available and will sometimes even be helpful however you may actually find it more useful to read the source code. If you are developing on Windows, take a look at an application called Agent Ransack or FileLocator Pro. You will be amazed at how helpful this tool is to find inline documentation and sample source code in Moodle. With an SSD, it takes about 10 seconds to search through all of the Moodle source code. Tip: Tell it to only search *.php files if you are looking for PHP code.
Moodle maintains a very strict Coding Style. Make sure you read the whole guide or you will find yourself frustrated when your fixes will be rejected for the smallest technicality (like a space at the end of a line). Here are some other Moodle development resources that I highly recommend you also read:
Here are a few more links to online tools you will find useful:
Some useful development tools you will also want to install include:
Minimum Required Skillset for Moodle Development - In order to develop in Moodle, you will need the following skills at a minimum. If you don't have them, you'll need to brush up on them first:
Let us know whether you are developing on Windows, OS X or Linux if you want pointers on setting up your development environment.
Hope you find this useful. Looking forward to seeing your contributions!
Best regards,
Michael Milette
For those who are interested, I recently posted a follow-up to this called:
Getting Started with Moodle Development - Your first Moodle block
https://moodle.org/mod/forum/discuss.php?d=355789
It covers a bit on how to setup a basic Moodle development environment and suggests that a good place to start with Moodle development is by cloning a simple plugin.
Best regards,
Michael
I am really appreciate it Mr Milette
Hey Michael,
Not sure if you can help me, but I'm trying to use the Moodle Development Kit with Ubuntu 16.04.3 through VMWare and I keep running into an error when trying to create a new instance:
mdk create -i iv 33 -e pgsql -r dev users
Creating instance stable_33...
Cloning stable repository into cache...
This is going to take a while...
Cloning repository...
Checking out branch...
Error creating stable_33:
This is not a Git repository
Traceback (most recent call last):
File "/usr/local/lib/phython2.7/dist-packages/mdk/commands/create.py", line 173, in do
M = self.Wp.create(**kwargs)
File "/usr/local/lib/phython2.7/dist-packages/mdk/commands/workplace.py", line 176, in create
repo.delRemote('origin')
File "/usr/local/lib/phython2.7/dist-packages/mdk/commands/git.py", line 116, in delRemote
result=self.execute(cmd)
File "/usr/local/lib/phython2.7/dist-packages/mdk/commands/git.py", line 124, in execute
raise Exception (This is not a Git repository;)
Exception: This is not a Git repository
I haven't changed anything in the config: is that the problem?
Let me know if you need any more info. Hope you, or someone else, can help!
Hi Rebecca,
I had the exact same problem on Ubuntu 16.04. From what I can tell, something failed to create the initial stable_master cache which is why it is naturally complaining that this is not a Git repository.
After ensuring that there were sufficient directory and file permissions everywhere, here is what I did to fix the problem:
# Upgrade pip to version 9.0.1:
sudo pip install --upgrade pip
# Upgade moodle-sdk:
sudo pip install --upgrade moodle-sdk
# Run mdk doctor (I did not fix the dependency issues it reported):
sudo mdk doctor --all
# Delete the empty stable_master directory. Note: Modify the path to reflect where you placed your files:
rm -rf /var/www/stable_master
# Run mdk create without any extra parameters.
mdk create
When it is finished, you may get a message asking you to create a symbolic link. Be sure to do this.
That's it. Once the cache is setup, you can use your command to create an instance of Moodle 3.3 except that "iv" should actually be "-v". I am assuming that this was just a typo in your message.
Hope you found this information useful.
Best regards,
Michael
Mr Milette, you are rather awesome.
Thank you Marcus!