Development of an announcements plugin

Development of an announcements plugin

by George George -
Number of replies: 6
Dear All, I am working on developing an announcements module for Moodle like the one BlackBoard has (basically, when you login you get a pop-up with the text of the announcements for all modules you are registered on). I had a look at the documentation for developing plug-ins, and I think I need a resource plug-in (so that each course can have a form for creating the announcement) and, probably, some modification in the page rendering files for adding the code before the other contents of the page start loading. Could someone let me know if I am on the right track - do I need to look at any other type of plugin? Regards, George
Average of ratings: -
In reply to George George

Re: Development of an announcements plugin

by Darko Miletić -

You need to be a bit more specific. What constitues an announcement? There is also terminology issue. I assume bb module would be a course ( or not ).

In reply to George George

Re: Development of an announcements plugin

by Darko Miletić -

Let us assume following:

  • Every moodle course should be able to provide it's own announcements.
  • Announcement would be a text message defined by course administrator/teacher.
  • Whenever user log's in a popup window will appear listing all available announcements from courses in which user is enrolled.

If above assumptions are correct than most reasonable approach would be to implement this as a block. You would place a block in every course that is to provide announcements and on the site front page.

Instance of block in course would offer interface for admins to manage announcements.

Instance of block on the front page would provide handling for displaying popup.



In reply to Darko Miletić

Re: Development of an announcements plugin

by George George -

Dear Darko,

Many thanks for your prompt reply; your assumptions are all correct. The ideal behavior for me would be that:

i) for every course the link to Add an Activity or a Resource would give the option to the user to add a new announcement (maybe later with advanced features, e.g. the announcement is available between this date and that date and so on);

ii) when the user logs in a pop-up window opens up with all the announcements attached to the modules the user is enrolled in and are valid.

Now i) would point towards a module plugin but ii) maybe refers to minor edits in the theme code?

Can anyone throw some light into this?

Regards,

George

In reply to George George

Re: Development of an announcements plugin

by Darko Miletić -

Afaik there is no such plugin. The only way to accomplish that exact behavior is to modify core. The only reasonable approach is the custom block that needs to be developed.

In reply to Darko Miletić

Re: Development of an announcements plugin

by George George -

Hi Darko,

Sure; if I understood you correctly when the user logs in he will get a block containing all announcements.

There are a couple of things I am not clear with this approach:

i) A block will have a very limited amount of space presence and usually announcements would be a few sentences long; and

ii) A user should be able to create announcements for different modules so would something at a course level not be required?

(I am aware that the News Forum can solve some of the issues, but I would like to still investigate the possibility of going for the announcements functionality).

How would you comment on my other approach - have a form at the course level so that announcements can be created and add some code in the theme when the page loads up along the lines of: check if $USER is set and if yes fetch all announcements for them and pop up a window populated with these announcements?

Regards,

George

In reply to George George

Re: Development of an announcements plugin

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I'd add MyHome/Dashboard as well as the front page for the pop-up version of the block to Darko's suggestion.

Personally though i'm not sure about the form+theme approach - I would say it either has to be entirely separate from the theme, or it has to be entirely within the theme. If you get to the situation of block+theme then you are making it much harder for anyone to integrate your plugin as they would not necessarily want to make use of the theme provided and would then have to add the customisations to their own theme manually.

The problem with doing it from within the theme entirely is that the theme settings are an admin area rather than a teacher area.


One thing to look at may be the existing MyCourses/MyHome page where it already looks at forum/noticeboard posts and tells users if they have any unread messages. Possibly what you could look at is a block that extends that, pulling them all into one area for display - still uses the News and Notices to create the announcements (familiar for staff posting the notices) but displays as a pop-up over the frontpage/myHome page.