Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
en:create:texts [11.03.2014 11:32] janisaltherren:create:texts [23.04.2021 18:07] – [Other possibilities] sophia.schauer
Line 1: Line 1:
 ====== Text elements ====== ====== Text elements ======
  
-To enter texts independently from a certain question, the most convenient way is this:+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.
  
-  - Go to **Text elements and labels** at the sidebar under **Questionnaire** +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.
-  - Click on //New text element// +
-  - Enter a short //ID// for internal use (e.g. "welcome"+
-  - Enter the //text//. You can format it using HTML (see below) +
-  - Save the text block by clicking on //OK// +
-  - To insert it into the questionnaire, go to **Compose questionnaire**The newly created text element is now visible on the right under //Texts, images, audio//. You can drag-and-drop the text element into the questionnaire page. You can position it above, between or beneath questions or alone on an own page.+
  
-===== Other possibilities =====+  * 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]]).
  
-There are 4 different ways how to implement texts into the questionnaire.+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.
  
-  * //Text elements//\\ Try to always use text elements for texts. The questionnaire will stay clean and slimand you are able to use functions like multilingual surveys+ 
-    * [[:en:glossary#drag_drop|Dragging and dropping]] text elements into the questionnaire- + 
-    * Implementing text elements using the php function ''[[functions-base#text|text()]]''+===== Use in Questionnaire ===== 
-  * //HTML-Code directly in the questionnaire//\\ Use HTML-code only to insert short snippets of code (e.g. when placing questionnaire elements) or if you have to insert dynamically created content without using placeholders. + 
-    * Drag a //HTML-code//-element into the questionnaire and enter your HTML-code. +There are 4 possibilities of embedding texts in questionnairesOn 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]]. 
-    * Insert HTML-code using the PHP-function ''[[functions-output#html|html()]]''The following example shows HTML-code divided into several lines for better legibility.+ 
 +  * //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:
  
 <code php> <code php>
 html(' html('
-  <h1> Heading <br> +  <h1> Anmeldung zum Proseminar <br> 
-  Instruments for online surveys </h1>+  Instruments for the online survey </h1>
 '); ');
 </code> </code>
 +
  
 ===== Text formatting ===== ===== Text formatting =====
Line 44: Line 48:
 | no line break | <nowiki>$$Text$$</nowiki> | <nowiki>No line break at the hyphen: $$e-mail-</nowiki>\\ <nowiki>address$$</nowiki> | No line break at the hyphen:\\ e-mail-address | | no line break | <nowiki>$$Text$$</nowiki> | <nowiki>No line break at the hyphen: $$e-mail-</nowiki>\\ <nowiki>address$$</nowiki> | No line break at the hyphen:\\ e-mail-address |
  
-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 [[::de:create:functions-base#value|value()]] in correspondence with the format code ''label''.+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 ^ ^ Description ^ Format-Code ^ Example ^ Output in questionnaire ^ Output in dataset ^
en/create/texts.txt · Last modified: 13.02.2024 19:00 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki