Plugin, module, block - what's the difference?

Plugin, module, block - what's the difference?

by Frank Ralf -
Number of replies: 12
After reading Development:Developer_documentation#Make_a_new_plugin and these recent posts

"Finding the right Plugin type"
http://moodle.org/mod/forum/discuss.php?d=116773

"Proposed Pages Block - Plugin, patch, or package?"
http://moodle.org/mod/forum/discuss.php?d=118793

I still can't figure out what exactly is the difference between a plugin, a module, and a block. Are they mere synonyms?

But why does the one live in /mod and the other in /blocks?

I hope someone can enlighten me.

Thanks in advance!
Frank
Average of ratings: Useful (1)
In reply to Frank Ralf

Re: Plugin, module, block - what's the difference?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There are many different types of plugin in Moodle. Plugin is the generic term for all of them. Module, Block, Question type, ... are different specific types of plugin.

(This is different from, say Drupal, where there is only one type of plugin, and a plugin can choose to implement any number of hooks.)
In reply to Tim Hunt

Re: Plugin, module, block - what's the difference?

by Frank Ralf -
Thanks for the quick reply, Tim!

I'm still struggling to get this straight. When I look at the Site Administration block there are three categories under Modules:

* Activities
* Blocks
* Filters

Activities is the stuff from the /mod folder, Blocks the stuff from /blocks, and Filters the stuff from /filter.
(BTW why is the folder name plural for blocks and singular for filters?).

Those three are collectively called "plug-ins" or "modules", but besides residing in different folders and therefore appearing in different places in the administration menu there is no difference (for example in scope), right?

Regards,
Frank




Attachment Administration_Modules.png
Average of ratings: Useful (1)
In reply to Frank Ralf

Re: Plugin, module, block - what's the difference?

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Ralf,

I only can agree with you 100%. IMO it should be:

  • Plugins:
    • Modules
    • Blocks
    • Filters


It's one tiny thing I have thought about in the past, perhaps it's time to change it?

Ciao smile

P.S.: In fact, due there are also other plugins (auth, enrol...) perhaps it wouldn't be wrong to add some "aliases" to the corresponding pages in that menu item, in order to have all the "pluggable" components together.
In reply to Eloy Lafuente (stronk7)

Re: Plugin, module, block - what's the difference?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Have you guys looked at that menu in Moodle 2.0?
In reply to Frank Ralf

Re: Plugin, module, block - what's the difference?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
As Tim said, this has been improved in 2.0.

Plugins
- Activity modules
- Blocks
- Filters
- Repositories
- Portfolios
- Question types

The reason for the plural directory "blocks" is that it was a mistake by PJ (who developed blocks) and unfortunately by the time I noticed the error it was in CVS and too late to fix. Folders and file names are generally always singular in Moodle.
Average of ratings: Useful (2)
In reply to Martin Dougiamas

Re: Plugin, module, block - what's the difference?

by Cesario Siringoringo -
I'm new in developing Moodle, sorry I still don't understand about the differences Would you give me explanation, what is the Online Judge? Module or Plugin? Thanks
In reply to Cesario Siringoringo

Re: Plugin, module, block - what's the difference?

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

To repeat what has already been written above.

plugin = any type of code that can be 'plugged-in' to extend Moodle

activity module = a particular type of plugin for adding a new activity to a course (e.g. forum, quiz, assignment), instead of, for example, adding a new course enrolment type (enrol) or quiz question type (qtype) or block to the edge of the page (block).

 

Average of ratings: Useful (1)
In reply to Davo Smith

Re: Plugin, module, block - what's the difference?

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

For the list of plugin types, see http://docs.moodle.org/dev/Plugins

Also note, in certain situations (such as in the administration interface), it is useful to distinguish "standard plugins" (that come with Moodle) from "add-ons" (plugins added to clean Moodle installation). However, from development point of view, they all are equal (some of them are just more equal than the others wink).

In reply to Cesario Siringoringo

Re: Plugin, module, block - what's the difference?

by james mergenthaler -

mod = in course activities

blocks = literal blocks that you turn on and off that appear usually to the left and right of the center content.  Block display is determined a lot by the theme or the person with rights to turn them on or off and move them

report = custom reports that you may develop or others, that appear in the Site Admin | Report list.  I have created several of these over the years for things like enrollment numbers, tardy course access, account in the advisor role, messaging between accounts

report/grade = custom grade report that you can develop.

The code to build report here is located in webroot/report

 

And this is my custom grade report whose code is placed in webroot/grade/report.  Access to the report is located via the gradebook.

 

Code for blocks is placed in webroot/blocks.

Code for course activities is placed in webroot/mod

Each plugin type follows the same moodle development guidelines, but *plugs in and appears in different places.

 

Cheers

In reply to Tim Hunt

Re: Plugin, module, block - what's the difference?

by Dwight Ian -
Hi, Im new to moodle so please forgive my innocence.

So I now understand from the above that there are many types of Plugins. Can someone enlighten me on what is the difference between each type and if I'll develop, what would be the criteria to call it a module or to call it a block?

Thank you very much.
In reply to Dwight Ian

Re: Plugin, module, block - what's the difference?

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Different types of plugins:

Activity - a separate activity that can be added to a course via the 'Add Activity' menu (e.g. a quiz, an assignment, a glossary)
Block - one of the blocks that sits on the right or left of the main course list (e.g. 'recent items', 'calendar', 'blog tags')
Theme - changes the look & feel of moodle site/course, using custom colours & graphics
Question - a new type of question for the quizzes (e.g multiple-choice, short answer, essay)
Assignment Type - a type of assignment for a student to attempt (e.g. 'upload single file', 'upload multiple files', 'offline activity')
Filter - something that parses blocks of text and changes it in some way (e.g. hyperlink known words to a glossary, remove naughty words)

Hope that helps to get you started - there is more detail here: http://docs.moodle.org/en/Development#Make_a_new_plugin

Average of ratings: Useful (1)
In reply to Davo Smith

Re: Plugin, module, block - what's the difference?

by Pedro Parreira -
What about Resources? Where do they fit in? I suppose they're modules too, so should they be in the mod directory as well?