Hi,
Is there any plugin code template that I could be able to use it as a skeleton to start plugin development for moodle3.x?
In addition, I tried to Google for a starter tutorial about Moodle development but I could not find.
Development is not my thing but I would say start here.
I remember someone posted in the developers forum about a skeleton plugin he had on github so might be worth having a look through that forum too.
That could depend on what kind of plugin you are thinking of developing - themes have a different structure to blocks for example.
What type of plugin are you thinking of developing?. A search of google on the terms "moodle plugin template code" returns several examples. Any template would be fairly plugin type specific. A template for a filter would not be very helpful if you were developing a block or question type. If you were considering developing a question type you might find Jamie Pratts template useful here
https://github.com/jamiepratt/moodle-qtype_TEMPLATE
and possibly my expansion of his work here
https://github.com/marcusgreen/moodle-qtype_TEMPLATE
This is my big problem as a beginner in Moodle. I could not able to determine which type of plugin should I follow to apply what I need to get. My scenario is simple as the following screen shot:
To get the number of enrolled students for each course in the courses list on the front page, I got lost between the types of Moodle. Should it to be Course type, Reports Type, Block type or Local type. In addition, basically, I could not able to know which plugin responsible for creating that "Available courses" list.
That is probably best achieved by customising your theme and having a renderer override for the available courses display - there are lots of examples of this in existing themes, although not of your particular requirement.
Thank you very much it was very helpful resource's link. I have duplicated More theme and renamed it with new name, then I added renderer.php to the new theme root with the following:
class theme_overridetest_core_renderer extends core_renderer { } include_once($CFG->dirroot . "/course/renderer.php"); class theme_abdellatif_core_course_renderer extends core_course_renderer { protected function coursecat_coursebox_content(coursecat_helper $chelper, $course) {
Then using enrollment api:
return $content.'Enrolled Students: ' .count_enrolled_users(context_COURSE::instance($course->id),'mod/assignment:submit'));
Of course it is not totally adjusted but It is good start for me at this point, so I could able to get the screen shot as real output.
As described in the previous post, I become able to solve the issue. However, there is a little issue. In order to make some management to the solution, i.e. making an option that allow/disallow showing the option of displaying the total count of a course enrolled students. I had to make this option from the theme settings:
What I need to get now, is to override " Dashboard / ► Site administration / ► Appearance / ► Courses " to be able add this option as a settings for courses? where is the renderer of this?
There are some templates for other plugins at https://github.com/search?q=user%3Adanielneis+new