Displaying initialbars in more than one alphabet

Displaying initialbars in more than one alphabet

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

Further to this discussion, I have implemented a hack to display initialbars in more than one alphabet. This may be useful on moodle sites which have users enroled in different alphabets (i.e. latin, cyrillic, hebrew, etc.). Here is the rationale and how the hack works.

There are 2 initialbars (First Name and Surname) in Moodle. Those initialbars are used in the following standard Moodle activities & blocks:

  • Assignment (View submissions)
  • Quiz (report overview, if more than 20 students attempts)
  • Block "People / Participants list"

Initialbars are probably used in other 3rd-party plugins (e.g. in Quizport).

The alphabet used in those 2 initialbars is determined by the current language (this may be the site's default language, or the course's forced language or the user's language. In order to display more than one set of initialbars in the various places where initialbars can be displayed, the only file which has to be hacked is moodle/lib/tablelib.php.

Case #1

More than one set of initialbars needs to be displayed for a whole Moodle site.

In file moodle/lib/tablelib.php, hard-code the list of the alphabets needed, around line 595 (moodle 1.9.8). Use the short name for language. Regional variants are normally not needed (i.e. fr_ca has the same alphabet list as fr).

$alphabets = 'en,ru,he';

Case #2

If there is a need to display different sets of initialbars in different courses on the same moodle site, then a new field will have to be added to the Course settings form, similar to the Settings I have proposed for my Glossary hack.

Demo

I have finished the hack for Case #1, with hard-coded $alphabets = 'en,ru,he'; and it can be viewed in action as usual on my Moodle test site, log in as teacher. Please report your remarks in this forum thread. If there is an interest, I will make the patch available in the Moodle Tracker.

Please go to my moodle test site (currently running moodle 1.9) http://rezeau.info/moodle and log in as teacher1, password Teacher1! Go to course "Demo" and in the People block click on Participants. In the list of participants you will find a few names in non-latin alpabets to try out the initialbars filtering.

Hope that helps,

Joseph

Attachment image00.jpg
Average of ratings: -
In reply to Joseph Rézeau

Re: Displaying initialbars in more than one alphabet

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

BUMP!

Anyone tried this new feature on my test site and would like to report? thoughtful

Joseph

In reply to Joseph Rézeau

Re: Displaying initialbars in more than one alphabet

by Jeff Forssell -
I was in and tried it. (After finally noticing that I had missed the "!" in the password!)

It could be useful even in Swedish which has ÅÄÖ at the end of the alphabet.

It seemed like it worked, but I didn't find any content (names) under the exotic characters that I tried.

I don't know enough to be sure that this isn't "just the way it is" but it seems like some of the characters are "put together with what looks like 3 characters".

It would be nice if the "empty" chars weren't linked at all, but that is probably true even for the "usual system".

Don't suppose this is much help, but I felt sorry for your "unreplied" situation.
In reply to Jeff Forssell

Re: Displaying initialbars in more than one alphabet

by Jeff Forssell -
Hmm... I tried again. Looked at ALL to try to see what should be "findable". There was someone that began with "B" (well not a real B) and I tried clicking on th exotic Bs. Sometimes I got the name and sometimes not, it didn't seem stable.