====== Text Elements ======
Texts are -- besides questions -- the most important component of questionnaires. You need them for greetings, longer explanations and often as stimuli (e.g. articles). Texts are created likely questions in a section. Select the desired section and click //Add text// in the **Questionnaire** on the left.
Enter a //description// for the text that only you as the project manager will see. Then you can select different display variants for the text.
* Standard is a "simple text". This fits seamlessly into the questionnaire from the formatting and allows simple formatting via [[#wiki-notation|wiki notation]].
* The "Formatted Text" display allows formatting with an editor. **Important:** Please do __not__ copy text directly from Microsoft Word into a formatted text. This will copy a lot of unnecessary formatting, which can lead to display errors later.
* For more sophisticated design, you can directly enter HTML or JavaScript using the "HTML Code" display. For example, you can also include videos ([[:en:create:media]]).
* You can display extensive information clearly as a text ([[:en:create:accordion|accordion]])
If desired, you can also enter text content in the //Title// tab that will be formatted like a question. As soon as you save the text ({{:button.save.png?nolink|Save button}}), it will appear in the question catalog.
===== Use in Questionnaire =====
There are 4 possibilities of embedding texts in questionnaires. On the one hand you can enter HTML code directly in the questionnaire, on the other hand you can use text modules (see above). Direct typing of HTML code makes the **Questionnaire compilation** quite confusing, therefore we recommend creating texts in the question catalog. In addition to different formatting, these also support [[:en:create:multilang|multilingual questionnaires]].
* //Texts//\\ Texts from the question catalog are included in the questionnaire in the same way as questions under **Composing questionnaire**:
* Drag text via [[:en:glossary#drag_drop|Drag & Drop]] into the questionnaire.
* Include text with the PHP function ''[[:en:create:functions:text|text()]]'' or ''[[:en:create:functions:show|show()]]''.
* //HTML code directly in the questionnaire//\\ Use HTML code in the questionnaire only if you need either very short snippets of HTML code (e.g. to place questionnaire elements) or if you need to insert dynamically generated content directly (not using placeholders).
* Drag a block of type //HTML-Code// into the questionnaire and type HTML code directly there.
* Include HTML code in the questionnaire with the PHP function ''[[:en:create:functions:html|html()]]''. As you can see in the following example, the HTML code can be spread over several lines for clarity:
How are you, World?
html('
===== Text Formatting =====
If you create a text in the **List of Questions** you can directli in edit in the editor. The formatting is the transaltet in HTML code in the background. But also questions, explanations, items and other desciptions can be formatted. There are two ways to format texts: a wiki-format for simple formatting (e.g. in question texts) and HTML-format for advanced formatting (e.g. in welcome texts). You may mix both notations as desired.
==== Wiki-Notation ====
The Wiki notation allows simple highlights - no matter if in independent texts, questions, items or verbal scale anchors.
**Tip:** Use highlighting __very__ sparingly. A homogenous layout looks much more professional. You should not use more than 3 accentuations per page - otherwise the layout will be more confusing than helpful.
^ Description ^ Format-Code ^ Example ^ Result ^
| underlined | Anmeldung zum Proseminar
');
Instruments for the online survey
Translated into human language, this example says nothing else, but:
* Write "Hello world". Write it as a first-degree-heading (''h1'').
* Write "How are you, world?". Write it as a paragraph (''p'').
The output would look like this:\\
{{scr.texts.example1.png}}
Usually, every HTML-tag needs a starting tag (e.g. ''Hello World
'' marks the beginning of a paragraph and ''
'' its end. The only relevant exceptions are the line break ''
Here should be a
line break
**Output of the example above**\\
{{scr.texts.example2.png}}
Sometimes, you will need to define additional attributes to tags. The ''''-tag, for example, needs to know where to find the image (''src'', "source") and which text to show in case the image can't be displayed (''alt'', alternative),
**Output of the example above**\\
{{scr.texts.example3.png}}
===== Most important tags to format texts =====
Along with texts output trough ''html()'', you can use HTML-tags for Question titles, explanations and scale labels. This is an overview over the most important tags:
^ Tag ^ Meaning ^ Example ^ Output ^
| **** | Paragraph | ''
Paragraph 1
Paragraph 2
'' | {{:en:create:scr.texts.example.p.png?nolink}} | | **or
Demonstration of HTML-Tags
This paragraph contains a highlighted word.
This paragraph contains words in several colors: alight, a
medium and a
darker green
This is a large word,
and a large, bold, red text.
Using div's, you can define the margins to the outside of the div (e.g. on the top of the div) and borders
Using padding, you can define the margins on the inside of the div (e.g. between the border and the text. Here: all around
**Output demonstration of the example above**\\
{{:en:create:scr.texts.example4.png?nolink&500|}}
**Tip:** Sometimes a certain text is formatted bold by default. If, at a single point, you need it in standard weight, you can use ''Text''. If you want this element never to be bold, you should edit the questionnaire layout.
===== HTML-Entities =====
Tags are defined using angle brackets, like explained above. Sometimes you need to use angle brackets in your text. For this case, there are the HTML-Entities: < ('less than', <) and > ('greater than', >):
^ Example ^ Output ^
| C
C<D and C>E
| C