General developer forum

Page Annotations/ToolTips

 
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Mark Ward
Page Annotations/ToolTips
 

Hello all

For the last couple of weeks I have been working on a new type of Local plugin which I'm currently calling "local_annotations". The plugin makes it possible to set up highly customisable annotations which are targeted at specific pages on a Moodle site. These annotations can then draw a user's attention to a specific area of the page they are visiting and give them information about a function or feature. I've uploaded a short demonstration video at

The features I have completed so far are:

  • Annotations instances are stored in the database; highly customisable
  • User "views" are tracked either by the page load or by their session
  • Annotations can be displayed on specific pages using the following filters:
    • Part of a page ID:- eg like '%course-view%'
    • Part of a page class:- eg like '%pagelayout-frontpage%'
    • The page theme:- eg 'afterburner'
    • The user's language:- eg 'en-us'
    • Whether a user has editing capability
    • Whether a user has editing turned on
    • Whether the user needs to be logged in
  • Annotations can be positioned and sized on a per-instance basis
  • Annotations are given a "display from" and a "display until" value to dictate which page views they appear on
  • Annotations can be given a sequence allowing a user to be guided around a page (currently JS only)
  • Support for mainstream browsers including IE8

There is still a lot of work to do on the back end as I am currently adding annotation instances through phpmyadmin, I'm coming up with ideas for a simple user interface for quickly adding and editing notes. I also need to alter my database queries to make use of the $DB helper functions.

I hope you like the concept and would be glad to hear your thoughts on what I have so far.

 
Average of ratings: Useful (3)
Picture of Allegre Guillaume
Re: Page Annotations/ToolTips
 

This seems a really interesting feature.

I would be glad to see and test the code by myself, so please don't forget :
 release early, release often!

 
Average of ratings: -
Davo
Re: Page Annotations/ToolTips
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Looks like a nice idea - I'd be interested in knowing if you'd managed to insert the messages without making any core modifications (and on that front, I'd also be interested to see the code).

 
Average of ratings: -
Picture of Mark Ward
Re: Page Annotations/ToolTips
 

This doesn't modify any core code, it works by adding HTML to $CFG->additionalhtmltopofbody as Moodle loads a the local plugin's lib.php file.

 
Average of ratings: -
Picture of Andrew Nicols
Re: Page Annotations/ToolTips
Group Core developersGroup Moodle HQGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers
Hi Mark,

This looks like a great feature - I hope that you release it soon and I'm sure that others would be willing to make suggestions for an admin UI.

For the annotation positioning, is this done based solely on absolute/fixed positioning, or is it possible to specify a CSS id and have it automagically located nearby that element?

Would love to see the backend JS behind this too.

Andrew
 
Average of ratings: -
Picture of Mark Ward
Re: Page Annotations/ToolTips
 

Annotation positioning is basically CSS absolute, each instance has an anchor point (like 'top' and 'left'), a measurement for positioning on X and Y and another for width and height. Measurements can be in any units you want (px, % or em).

The backend JS is all YUI based and is based around a show() and a hide() function. Those functions are then called in order either when a user clicks on the annotation or after the timer expires

I want to do a bit more testing on this and also clean up the code a bit and then I can release a rough version for you all to take a look at.

 
Average of ratings: -
Picture of Mark Johnson
Re: Page Annotations/ToolTips
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

This sounds fantastic, I can't wait to see it.

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Page Annotations/ToolTips
Group Particularly helpful MoodlersGroup Plugin developers
Hi Mark Any progress in the plugin? Frankie Kam
 
Average of ratings: -