Modifying glossary filter so tooltips display definition instead of concept name.

Modifying glossary filter so tooltips display definition instead of concept name.

by Tim Redman -
Number of replies: 14
Is there anyway to tweak the auto-linking glossary tooltips to display glossary definitions as opposed to just the category and concept name? So that users don't have to click to see what a words definition is but simply mouseover instead?

I think it may be possible to tweak the file glossary/filter.php but I wanted to check if anyone had any easier thoughts or suggestions before I attempt this!
Average of ratings: -
In reply to Tim Redman

Tárgy: Modifying glossary filter so tooltips display definition instead of concept name.

by Deni Nagy -
Hello Tim,

This is the problem I can't solve either. Do you get to know the answer by now? I would really appreciate if you shared your experience with me on this field!

Thanks in advance!
Deni
In reply to Deni Nagy

Re: Tárgy: Modifying glossary filter so tooltips display definition instead of concept name.

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
This is not a trivial problem. Displaying longer texts, which may have images, hyperlinks in them, in a balloon tooltip involves a lot of programming (usually Javascript) and is rarely satisfactory. Maybe some moodle users want this because for them a glossary definition consists of just a few words which can easily be displayed within the confines of a tooltip. But for many other users (including myself), Glossary definitions are complex pages which could certainly not be displayed within the limited confines of a tooltip.
Joseph
Average of ratings:Useful (1)
In reply to Joseph Rézeau

Tárgy: Re: Tárgy: Modifying glossary filter so tooltips display definition instead of concept name.

by Deni Nagy -
Sure. I'm not saying the recent popup makes no sense, only for me - for the reason you mentioned, that I have only a few words in the glossary - the definition would be more useful. Do you know the solution, what to change in the code?

Thanks! Deni
In reply to Deni Nagy

Re: Tárgy: Re: Tárgy: Modifying glossary filter so tooltips display definition instead of concept name.

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Sorry I do not know the solution. As I said it would be a massive change to the way autolinking to Glossary works in Moodle at the moment.
Joseph
In reply to Joseph Rézeau

Tárgy: Re: Tárgy: Re: Tárgy: Modifying glossary filter so tooltips display definition instead of concept name.

by Deni Nagy -
I am very happy that you react so fast! smile
I see. OK, thanks. Maybe we will add some mp3s to the Glossaries so as they gave more info in the big window. Oh, one more thing. Do you know how can I specify a size parametre for glossary window? It is too big and I can not get it to open smaller automatically in a smaller window. It is resizeable manually but it would be much better to specify a size.

Thanks! Deni
In reply to Deni Nagy

Re: Modifying glossary filter so tooltips display definition instead of concept name.

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Deni,

If you are willing to hack your moodle core files this is where you will find the glossary popup window size parameters (for Moodle 1.8). In file mod/glossary/filter.php line 137 etc.

$href_tag_begin = '<a class="glossary autolink glossaryid'.$concept->glossaryid.'" title="'.$title.'" '. 'href="'.$CFG->wwwroot.'/mod/glossary/showentry.php?courseid='.$courseid.
 '&amp;concept='.$encodedconcept.'" '.
 'onclick="return openpopup(\'/mod/glossary/showentry.php?courseid='.$courseid.
 '\&amp;concept='.$encodedconcept.'\', \'entry\', '.
 '\'menubar=0,location=0,scrollbars,resizable,width=600,height=450\', 0);">';

replace width and height with your preferred values.

Joseph

In reply to Joseph Rézeau

Tárgy: Re: Modifying glossary filter so tooltips display definition instead of concept name.

by Deni Nagy -
Fantastic! I'll do it tomorrow! Sure, I can do such simple hacks...
(I use 1.9.)

Thank you!

(BTW. I have written some notes to Adriane's Drag & Drop ordering and matching questions. I need help in installation. Can you help me?) Sorry for mentioning here but writing here seems to worth a lot! ;)


Thanks!
Deni
In reply to Deni Nagy

Re: Tárgy: Re: Modifying glossary filter so tooltips display definition instead of concept name.

by Leticia Maimann-Roland -

Does it work, guys?

It looks like a smart and useful changing...

Showing the definition instead of the concept would save students time, so they have it over there.

I have a dictionary glossary, where this functionality would fits so perfectly.

Hugs, Leticia.

In reply to Leticia Maimann-Roland

Re: Tárgy: Re: Modifying glossary filter so tooltips display definition instead of concept name.

by Frank Ralf -
JFTR

"Suggested hack to display glossary definitions as tooltip in resources" MDL-18213
In reply to Tim Redman

Ang: Modifying glossary filter so tooltips display definition instead of concept name.

by Bente Olsen -
Finally I managed to test your hack, Joseph, it is superb! It fits our correction key as if that were the original purpose. In the meanwhile filter.php has been slightly modified, I am no hacker, but I managed to deal with the change too, so currently it works perfect on my testserver. Now I am really tempted to use it at our production site, I know you do not recommend that, but... will it be that risky?
In reply to Bente Olsen

Re: Ang: Modifying glossary filter so tooltips display definition instead of concept name.

by Lezlie Harris -
I believe the glossary will already do this. We use Moodle 1.9. My linked glossary definitions used to appear with a mouse-over without the need to open in a new window. I recently must have changed a setting because now I just get the entry word. sad Does anyone know what setting I changed?
In reply to Lezlie Harris

Re: Ang: Modifying glossary filter so tooltips display definition instead of concept name.

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Lezlie: "I believe the glossary will already do this. We use Moodle 1.9. My linked glossary definitions used to appear with a mouse-over without the need to open in a new window."

As fas as I can remember this is not true. The standard behavior of glossary auto-links is for the user to click the hyperlinked word, which opens up the relevant glossary definition in a popup window. There is not setting to show the definition on mouse hover, this is why I proposed a hack in MDL-18213.

Joseph

In reply to Joseph Rézeau

Re: Ang: Modifying glossary filter so tooltips display definition instead of concept name.

by Lezlie Harris -
Thank you for your reply.
In reply to Tim Redman

Optional display

by Mark Penny -

This is a bit like the Great Blog Debate that smouldered for years. The problem is often that the developer sees the module being used one way while other users would like to use it another. Michael Dougiamas used to insist that blogs in Moodle should on no account allow comments, because blogging would distract students from activities and there were other modules, such as forums, which kept blog-style interaction in the learning context. That may have been true for many installations, but for many others, Moodle blogs would have held benefits. Now I see comments can be enabled if desired. From the user end, that's a simple solution to the problem of whether blogging should be allowed or not.

I suggest the question of whether definitions display in pop-ups or tooltips is a similar issue. When the developers have time to put in the code, users should have the option of displaying definitions in pop-ups or tooltips.