Glossary Popup Entry Order

Glossary Popup Entry Order

by William Emmons -
Number of replies: 8

Would like some help. I am using Moodle 1.9.4 and have put together a course that uses multiple glossaries within the course as teaching aids.

I have a general COURSE glossary, a TEACHER glossary, and a STUDENT glossary. Also there is a SITE global glossary defined outside the course itself.

If I have a entry "salvation" defined in each of these glossaries, they all show up in the popup, which is what I want. My questions is the order of the listed entries. Is there a way to sort them by glossary level.

I prefer the following order  SITE, COURSE, TEACHER, STUDENT

Can anyone point me in the right direction to sort them this way. I have started looking at the module(s) code and getting in pretty deep. I can make mods if necessary.

Could you point me to the correct modules, etc.

Thanks

Bill

Average of ratings: -
In reply to William Emmons

Re: Glossary Popup Entry Order

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

Bill,

The order that the glossaries are displayed follows the order of their creation. If you want the definitions to be displayed in the order SITE, COURSE, TEACHER, STUDENT, then you should create those 4 glossaries in that chronological order.

If you have already created the glossaries in a different order, then you could use the following scenario.

  1. Rename your SITE, COURSE, TEACHER, STUDENT glossaries to e.g. SITE_glo, COURSE_glo, TEACHER_glo, STUDENT_glo.
  2. Export entries of your SITE_glo, COURSE_glo, TEACHER_glo, STUDENT_glo glossaries (and save to your local machine).
  3. Create new SITE, COURSE, TEACHER, STUDENT glossaries in that exact order.
  4. Edit SITE, COURSE, TEACHER, STUDENT glossaries and import the definitions from SITE_glo, COURSE_glo, TEACHER_glo, STUDENT_glo glossaries.

Et voila!

Joseph

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Glossary Popup Entry Order

by William Emmons -

Joseph,

Deleted and reentered glossaries in order.  Added "salvation" entries to each glossary and tried it. Got the following.

Before Restore

The above is correct and the way I want it, even the multiple student entries.

But I restored some entries to the COURSE glossary, got the following report....

Import Report

After the restore, I now get the following order in the popup...

AFter Import

Notice that the order in now changed.  Any ideas?

In reply to William Emmons

Re: Glossary Popup Entry Order

by William Emmons -

Just thought of something. I checked the "Import categories: " on the import.

Does categories affect the sort?

Bill

In reply to William Emmons

Re: Glossary Popup Entry Order

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

I do not see a change in the order of displayed glossaries after importing questions to my Course glossary.

Joseph

In reply to Joseph Rézeau

Re: Glossary Popup Entry Order

by William Emmons -

Where is the module that does the actual data extract?  I will look at the code and also the actual db files.

In reply to William Emmons

Re: Glossary Popup Entry Order

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

I'm afraid I am no expert on the Glossary module architecture. You'll have to find out for yourself.

Still, as I said in my previous message, I do not see why importing definitions into your Course glossary would modify the order in which the glossaries are displayed.

Joseph

In reply to Joseph Rézeau

Re: Glossary Popup Entry Order

by William Emmons -

As I created each glossary, I added the "salvation" entry, so the order was create glossary --> add it's entry, create next glossary - add its entry, etc.

I delete the Site glossary enry for salvation, every thing displays fine.

I readded the entry to the SITE glossary then...

The SITE glossary now shows at the bottom of the popup list.

I wonder if the timestamp of the entries has something to do with it?

I will get  to the bottom of this as I dive into the code. I downloaded the entire glossary direction to my laptop so I have the exact code from the site.

Will keep you informed as to the results.

Attached is copy of the XML I imported back into the COURSE glossary.

Thanks for all you help Joseph.

In reply to William Emmons

Re: Glossary Popup Entry Order

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

William:

  1. As I created each glossary, I added the "salvation" entry, so the order was create glossary --> add it's entry, create next glossary - add its entry, etc.
  2. I delete the Site glossary enry for salvation, every thing displays fine.
  3. I readded the entry to the SITE glossary then...
  4. The SITE glossary now shows at the bottom of the popup list.
  1. OK
  2. When you say "everything displays fine", I suppose you mean all the glossaries show up their "salvation" definition except for the SITE glossary, of course?
    And I hope you did not delete the SITE glossary itself, only the "salvation" entry...
  3. OK
  4. Just did that, but for me the SITE glossary still shows in first position.

As I said in my previous posts, the only parameter that is used for the order of glossaries display is the order in which they were created, or, more specifically, their ID in table mdl_glossary (see attached). Can you check that table in your moodle DB, using phpMyAdmin?

Joseph

Attachment 14-12-2011 16-24-04.jpg