Choice object

Some of the datatypes in the reference can take multiple forms.

This following datatype is either a TranslationStruct or a FileString. See the One of the following items: text.

Reference

Translation

One of the following items:

typedescription
TranslationStructA structured translatable string with placeholders.
FileStringA simple filestring. This implies that it can also just be a string.

To represent this datatype in yaml, you would either write a TranslationStruct or a FileString.

A TranslationStruct is specified as follows:

Reference

TranslationStruct

fieldtypedescription
contentTranslationContentThe content with optional placeholders ({{placeholder-name}}).
placeholdersMap from String to TranslationThe values for the placeholders. It maps the placeholder-name to it's translatable value. The value for a placeholder can thus (if needed) be different for different locales.

Which could be represented in yaml as follows:

# TranslationStruct
content: Some content
placeholders: {}

The yaml above is thus also a valid yaml for a Translation.

A FileString is specified as follows:

Reference

FileString

One of the following items:

typedescription
StringA string of the form file:<filepath> where filepath is the relative path (within the exams or questions folder) to a file containing content. This content can be localized by placing it in locale folders. e.g. file:examples/basic-explanation.html will search for files in folders with following form: questions/examples/locale-<localename>/basic-explanation.html If a file isn't found for a specific locale, questions/examples/basic-explanation.html will be used.
StringA literal string.

Which could be represented in yaml as follows:

# FileString
file:path/to/file

or

# FileString
any string value

The yaml above is thus also a valid yaml for a Translation.