Versions Compared
Version | Old Version 7 | New Version Current |
---|---|---|
Changes made by | Former user | |
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Table of Contents |
---|
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
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<code> <visible function="showCodeSnippet"/> <binding variable="question"> <attribute name="codeSnippet"/> </binding> </code> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
unit QuestionManagement; Question question; void initQuestion() { question = getCurrentQuestion(); } bool showCodeSnippet() { if(question.codeSnippet == null) { return false; } return true; } . . . |
Info |
---|
Example With a Label Included
Code Block | ||||
---|---|---|---|---|
| ||||
<code label="info.code_example"> <visible function="showCodeSnippet"/> <binding variable="question"> <attribute name="codeSnippet"/> </binding> </code> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
unit QuestionManagement; Question question; void initQuestion() { question = getCurrentQuestion(); } bool showCodeSnippet() { if(question.codeSnippet == null) { return false; } return true; } . . . |
Code Block | ||
---|---|---|
| ||
info.code_example = Code example: |
Info |
---|