This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
en:create:functions:paneldata [26.06.2016 14:46] – [Example] s1305605 | en:create:functions:paneldata [03.02.2018 22:15] – Full update admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== panelData() ====== | + | ====== panelData () ====== |
'' | '' | ||
- | The command | + | The function |
- | **Important: | ||
+ | ===== Return Value ===== | ||
- | ===== Example ===== | + | The'' |
+ | |||
+ | <code php> | ||
+ | array ( | ||
+ | 0 => (string) Subgroup, | ||
+ | 1 => (string) User-defined data 1, | ||
+ | 2 => (string) User-defined data 2, | ||
+ | 3 => (string) User-defined data 3, | ||
+ | 4 => (string) User-defined data 4, | ||
+ | 5 => (string) User-defined data 5, | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | **Important: | ||
+ | |||
+ | **Note:** If individual sending times are used for the mailing, the information on the sending time (like certain user-defined data) can remove anonymity and should not be stored in the data set. If the address entry is not anonymous, the sending time is automatically stored in the MAILSENT variable in the data set and ' | ||
+ | |||
+ | |||
+ | ===== Example: Importing data ===== | ||
The following example is based on the assumption, that the name of the company is placed in field 1 of the address record. Now, the name of the company should be used as the content of the placeholder '' | The following example is based on the assumption, that the name of the company is placed in field 1 of the address record. Now, the name of the company should be used as the content of the placeholder '' | ||
Line 15: | Line 35: | ||
$data = panelData(); | $data = panelData(); | ||
if ($data === null) { | if ($data === null) { | ||
- | // error message and stop of the survey, | + | // Error message and abort of the questionnaire, |
- | // if the survey | + | // if the questionnaire |
text(' | text(' | ||
buttonHide(); | buttonHide(); | ||
Line 23: | Line 43: | ||
$company = $data[1]; | $company = $data[1]; | ||
replace(' | replace(' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Example: Experiment in two-wave survey ===== | ||
+ | |||
+ | In this example, participants register themselves for a study ([[: | ||
+ | |||
+ | **Note:** An [: | ||
+ | |||
+ | <code php> | ||
+ | if (value(' | ||
+ | question(' | ||
+ | } else { | ||
+ | question(' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | After opt-in confirmation of the e-mail address, the participant is automatically forwarded to a second questionnaire. Depending on the group affiliation, | ||
+ | |||
+ | <code php> | ||
+ | $info = panelData(); | ||
+ | if ($info) { | ||
+ | $group = $info[' | ||
+ | if ($group == ' | ||
+ | text(' | ||
+ | mailSchedule(false, | ||
+ | } else { | ||
+ | mailSchedule(false, | ||
+ | } | ||
+ | } else { | ||
+ | // Display error message that the questionnaire does not contain a valid participation key. | ||
+ | // (e.g. when not started from a mailing) or that the address entry was called after | ||
+ | // the address record had been deleted from the address list | ||
+ | text(' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | For easier analysis, it would make sense to store the group membership via '' | ||
+ | |||
+ | <code php> | ||
+ | $group = $info[' | ||
+ | put(' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Example: Time between invitation and participation ===== | ||
+ | |||
+ | In this example, mailings are sent to the participants at random times as part of random experience sampling. It is important for the evaluation whether the participant has completed the questionnaire within 30 minutes or not. However, the dispatch time should not be saved in the data record because this could jeopardise anonymity. | ||
+ | |||
+ | With the help of '' | ||
+ | |||
+ | If the sending time cannot be determined, code -1 is stored. This can happen if the interview was not started from a mailing link or if the address entry has been deleted in the meantime by the project manager or the respondent. | ||
+ | |||
+ | <code php> | ||
+ | $info = panelData(); | ||
+ | if ($info) { | ||
+ | $sent = $info[' | ||
+ | $delay = time() - $sent; | ||
+ | if ($delay <= 1800) { | ||
+ | put(' | ||
+ | } else { | ||
+ | put(' | ||
+ | } | ||
+ | } else { | ||
+ | put(' | ||
+ | } | ||
</ | </ |