<code>
Jacques Marais
Former user (Deleted)
Owned by Jacques Marais
Â
DescriptionÂ
The code widget allows for displaying of pre-formatted text that is typically associated with source code.Â
Optionally, a label can be included and is specified using a key to a lang file entry. Visibility bindings are also supported.
Â
Â
Examples
Example With a Label Excluded
View XML
<code> <visible function="showCodeSnippet"/> <binding variable="question"> <attribute name="codeSnippet"/> </binding> </code>
Backing unit
unit QuestionManagement; Question question; void initQuestion() { question = getCurrentQuestion(); } bool showCodeSnippet() { if(question.codeSnippet == null) { return false; } return true; } . . .
Example With a Label Included
<code label="info.code_example"> <visible function="showCodeSnippet"/> <binding variable="question"> <attribute name="codeSnippet"/> </binding> </code>
Backing unit
unit QuestionManagement; Question question; void initQuestion() { question = getCurrentQuestion(); } bool showCodeSnippet() { if(question.codeSnippet == null) { return false; } return true; } . . .
en.lang file entries
info.code_example = Code example:
Â
Â