Hi Tim,
I have examined your get_numbering_styles and number_in_style methods. They work fine for standard, ascii characters, but do not allow the use of Japanese, roman, etc. methods of numbering.
1- Based on your work I am therefore proposing a new method, which entirely relies on the CSS2 list-style-type types. As show on attached screen shot, this allows for the entire range of CSS2 list-style-type types available, except for the bullets, which we are agreed are useless in this context. And of course it includes Japanese styles, etc.
Another advantage of my method is that numbering styles only have to be declared upon installation, in the answernumbering column/field of the question_multichoice table. They are then retrieved from that table for use in this function
function get_numbering_styles() {
$result=mysql_query("SHOW COLUMNS FROM mdl_question_multichoice LIKE 'answernumbering'");
$row=mysql_fetch_row($result);
preg_match_all("/'(.*?)'/", $row[1], $matches);
$arryEnum= $matches[1];
return $arryEnum;
}
2- I am also suggesting using the standard list-style-type terminology, instead of translating it. In the lang. file, this means using
$string['answernumberinglower-alpha'] = 'lower-alpha';
rather than
$string['answernumberinglower-alpha'] = 'a., b., c., ...';
This may look less user-friendly to the end-user, but they will get used to it, and it is coherent with web-authoring packages listing. The only string that might need "translating" is none -> No numbering. The other advantage is that keeping the CSS terminology in the numbering styles listing in question editing obviates the MSIE problem described below, i.e. such styles as katakana, hebrew, etc. will still be readable in the list rather than being replaced by garbage is e.g. katakana equivalent to a,b,b is used in the lang. file.
3- Display results and problems
a) All of the language-related list styles display fine in FireFox (version 2.0). In MSIE (7.0), unfortunately, very few are displayed OK (lower and upper roman); most are not (katakana, etc.) they are automatically replaced by decimal figures. One more reason for adopting FireFox!
b) The final result (as shown on attached screen shot) is OK in MSIE 7 (except for not displaying a number of language-related styles) but there is a slight alignment problem in FireFox. Because the choice text is displayed as an ordered list <ol><li>...</li></ol> located within a table cell, FireFox decides to display that list with a vertical space above and under it. I have not managed to destroy that unncessary vertical spacing, but I'll keep trying, and hope someone may suggest a solution.
As a conclusion, in keeping with Moodle's "international" vocation, I hope you will consider my efforts to making the list numbering more international, and I'm looking forward to moodlers' views.
Joseph
) I'm afraid Tim opened a bigger can of worms than he expected.