How to display all values of List (text) instead of just the selected ones? When viewing a node, how can I display all values of a List (text) instead of just the selected ones.

So, instead of displaying:

B (good)


I want to display all values, with some markup telling selected and unselected apart:

[_] A (superior)
[_] A-
[_] B+
[X] B (good)
[_] B-
[_] C+
[_] C (average)
[_] C-
[_] D+
[_] D (poor)    
[_] F (failure)
[_] I (incomplete)
[_] PR (course in progress)
[_] W (withdrew from course)
[_] FF (failing in a pass/fail course)
[_] PP (passing in a pass/fail course)
[_] N/C (not for credit)   


Now, I have actually solved this already for myself and for some others (who had desperately been searching for this functionality) in my sandbox module https://drupal.org/sandbox/kari.kaariainen/1349570, but I just wanted to ask if anyone else has a) needed this, b) solved it and how?

Edit: my solution is to rebuild the $items at hook_field_formatter_prepare_view so that it doesn't have just the selected items, but all items, including data about whether an item has been selected or not. $items will then be handled by hook_field_formatter_view actually outputting items with added markup and translated.

It's kind of frustrating to bring back data at prepare_view, so I'm wondering if data for all items could be retrieved from database initially.

Another thing is i18n support, which I'm now copying from i18n module. Code for each field type (there will be more than just text lists) will need to be duplicated and modified separately. I'm wondering if field translation could be left for i18n and not duplicating code.
Even if no one here says they have needed to do that you can pretty much bet others out there have, so it's good that you have your code on drupal.org where other can use it if they need it.

I had a quick look over your code and your solution is the way I would do it: create a new field formatter for text list fields using hook_field_formatter_info() and hook_field_formatter_view().

A couple of things I notice though are:


The name of the module is very long. If you can make it shorter while still being somewhat descriptive I think that would be good (also better for you as the coder).
The markup you are outputting is not themeable, so if other people start to use the module and want to override the markup in any way it is harder for them. See image_field_formatter_view() as an example of creating a render array with a specific theme function. Also see hook_theme() for defining your own theme functions.
Text that gets displayed to the user that is hard coded into the module should be run through the t() function so that others can write translations for your module. See the drupal 6 version of that t() api docs page for better and more thorough information. t() is not currently used is for $form['instructions'].
This one is a bit more of a personal choice but I would probably make the  markup options a lot less than 500 characters. I would also quite possibly not allow HTML markup and just allow them to enter characters that would then display in a span. If the user wants something fancy they can override the theme function (as per point 2). Also, the instructions encourage users to use inline styles, which are not recommended. Users should use the classes you provide to add any css in their theme's css files.