[LON-CAPA-users] Access to effective language in scriptblock?
Guy Albertelli II
Tue, 19 Jun 2007 13:04:22 -0400 (EDT)
> Imagine that you'd like to create a problem which should be offered in
> two or more different languages. The effective language which will be
> used for the student depends on the different settings within LON-CAPA,
> e.g. user's language preference or course setting.
> For problem texts in different languages, the languageblock could be used:
> <startouttext />
> <languageblock include="de">Deutscher Text</languageblock>
> <languageblock exclude="de">English text</languageblock>
> <endouttext />
> But what to do if the text elements must be "calculated" in the script
> block? Is there any possibility to access the effective language within
> the script block?
looks one can do this right now:
Wouldn't be difficult to add a &get_preferred_languages() routine to
return the list of desired languages.
> For example, this is necessary for the option list and
> the answer for optionresponse and for the answer for stringresponse, etc.
> I can send example code if needed. There are quite a lot of different
> problems where this is needed.
> Thanks for any help,
> Stefan Bisitz