====== 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: html('

Anmeldung zum Proseminar
Instruments for the online survey

');
===== 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 | __Text__ | I am __against__ the proposal | I am __against__ the proposal | | bold | **Text** | What is **your opinion** on this? | What is **your opinion** on this? | | italic | //Text// | Rate between //never// and //often// | Rate between //never// and //often// | | Heading 1 | === Text === | === A. Bulk === | {{scr.texts.example.h1.png}} | | Heading 2 | == Text == | == A.1. Definition == | {{scr.texts.example.h2.png}} | | Horizontal ruler, separator | -- | Paragraph\\ --\\ Paragraph | {{:de:create:scr.texts.example.hr.png}}| | no line break | $$Text$$ | No line break at the hyphen: $$e-mail-\\ address$$ | No line break at the hyphen:\\ e-mail-address | | Tooltip | ((*|Content)) | Wiki-((Notation|Notation means notation)) | | Link | [[URL|Title]] | [[https://www.soscisurvey.de/|SoSci Survey]] | [[https://www.soscisurvey.de/|SoSci Survey]] | If you want text parts to show in the questionnaire, but not as variable labels in your dataset, use double curly brackets (''{'' and ''}''). Texts marked like this also won't show up using the query [[:en:create:functions:value|value()]] in correspondence with the format code ''label''. ^ Description ^ Format-Code ^ Example ^ Output in questionnaire ^ Output in dataset ^ | Show only in questionnaire | {{Text}} | Other {{options:}} | Other options: | Other | ==== HTML formatting ==== Technically, you enter HTML-code at any position in the questionnaire. HTML (HyperText Markup Language) is the standard format for websites in the internet. Don't be afraid - you won't need to know everything about HTML to use it for simple tasks like implementing pictures or texts. It just may be helpful to know the structure. **Tip:** If you struggle a bit with writing HTML code at first, an online HTML editor such as [[https://html-online.com/editor/|HTML-Online.com]] can be helpful. HTML-Code is made out of two parts: The //actual information// that is to be displayed in the browser and tags around this information that define //how// to display the information. Tags are written in pointy brackets. The following example highlights the tags: **HTML-Code**

Hello World

How are you, World?

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. ''

'') and a closing tag (''

''). The tag ''

'' marks the beginning of a paragraph and ''

'' its end. The only relevant exceptions are the line break ''
'' (which is more like a command ("break the line here!") than a tag) and the image ''''. **Tip:** The
-Tag is especially helpful when labels are not line-breaking correctly in a scale. **HTML-Code**

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), Logo **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}} | | **
** | line break | ''this line will break
here'' | {{:en:create:scr.texts.example.br.png?nolink|}} | | **** | highlighted (depending on browser, usually bold) | ''Text, now highlighted'' | Text, now **highlighted** | | **** | bold | ''Text, partly bold.'' | Text, partly **bold**. | | **** | italic | ''This text is italic.'' | This text is //italic//. | | **** | underlined | ''You can underline texts!'' | You can __underline__ texts! | | **** | Set text smaller | ''This is a sentence
And this could be its explanation'' | {{:en:create:scr.texts.example.small.png?nolink|}} | | **

** | First-degree headline | ''

A. Main part

'' | {{:en:create:scr.texts.example.h1.png?nolink|}} | | **

** | Second-degree headline | ''

A.1. Definition

'' | {{:en:create:scr.texts.example.h2.png?nolink|}} | | **** | Hyperlink to a website | ''%%SoSciSurvey%%'' | [[https://www.soscisurvey.de|SoSciSurvey]] | | **** | Text part that can be formatted using CSS | ''%%This is red Text%%'' | {{:en:create:scr.texts.example.span.png?nolink|}} | | **
** | Text block that can be formatted using CSS | ''%%
Text in a red box
%%'' | {{:en:create:scr.texts.example.div.png?nolink|}} | Tags are better used for textual highlightning than for layouting and design. However, the and the
tag are "empty" containers that do not style texts themselves. You can use them to style text (parts) using CSS-formatting. Have a look at [[http://www.w3schools.com/|w3schools]] for further tutorials on this. In case you need colored text, you can use the color-code in the example and replace it with your color of choice. For example, #FF0000 is FF(=255) red, 00 green, 00 blue, on a scale from 00=none to FF=brightest (the scale goes a little like ''0123456789ABCDEF''). The color calculator can help you with this. You'll find it when editing your **Questionnaire Layout**. "Common" tags like the

or

tag don't have a defined appearance. The font-style and -size is being defined by scoscisurvey through a main CSS. Depending on the Questionnaire Layout a headline may be smaller or larger, or have a different color. **Example for highlighted Text**

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 ^ |

CE

| CE | |

C<D and C>E

| CE | Other HTML-Entities are the ''&'' fort the ampersand (&) and ''"'' for the quotation mark ("). More helpful Entities like ''•'' (•) are listed at [[http://www.w3schools.com/charsets/ref_html_entities_4.asp|w3schools]].