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:combine [23.11.2020 15:56] sophia.schaueren:create:combine [19.05.2021 20:54] sophia.schauer
Line 2: Line 2:
  
 You might want to ask different options about one item. For example the rating of a characteristic and its importance. This is how to implement this. You might want to ask different options about one item. For example the rating of a characteristic and its importance. This is how to implement this.
 +
 +**Note:** Please be sure to also read the notes on mobile devices below.
  
 **Example 1**\\ **Example 1**\\
Line 201: Line 203:
 </code> </code>
  
 +===== Combine Multiple Dropdown-Questions  =====
 +
 +Dropdown questions can be placed next to each other using tables for combined queries (see also chapter [[table-layout|Placing Elements side by side]]).
 +
 +For a step-by-step description of the following example, see [[table-layout-dropdowns|Place Dropdowns Side by Side]].
 +
 +{{ :de:create:scr.example.combine.dropdown.jpg?nolink |}}
 +
 +
 +===== Mobile devices and responsive display =====
 +
 +A relevant part of the respondants fill in the questionnaire not on an computer but on a mobile device. The most questions in SoSci Survey switch to a different display mode. Therefore in most cases it is enough to try the questionnaire in the end of the implementation on an mobile device. More in the chapter [[:en:create:smartphones]].
 +
 +Combined questions, however, do not automatically adjust the layout to the size of the screen (responsive design) - and therefore may not be completed on mobile devices. Here it is suitable to offer an alternative presentation for mobile devices.
 +
 +First, create a question of the type "Device and request variables". In the questions in the //Device// tab, put a check mark at //Screen size//. After saving you get two variables for the width and height of the screen in pixels. Note the variable identifier for the screen width, which you can find in the //Variables// tab. In the following example it is assumed that the variable has the identifier "GR01_ScW".
 +
 +
 +Now place this question on a page in the questionnaire that comes before the combined question.
 +In the following example it is assumed that the variable has the identifier "GR01_ScW". The screen width (unlike the //Format//, which is often not recognized correctly on Apple devices) is not saved until you click "Next".
 +
 +Now, with a few lines of [[:en:create:php|PHP code]], you can either display the combined question or display the two questions one below the other (and with optimizations for mobile devices). A width of 600 pixels is chosen as the limit here. Depending on the question types and layout, choosing a larger or smaller number may be appropriate.
 +
 +<code php>
 +if (value('GR01_ScW') > 600) {
 +  // combined question
 +  question('AB01','combine=AB02');
 +} else {
 +  // single questions
 +  question('AB01');
 +  question('AB02');
 +}
 +</code>
  
 +For an explanation of the code, please refer to the [[:en:create:php-filters]] tutorial.
en/create/combine.txt · Last modified: 08.09.2023 11:55 by paul.heineck
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki