This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
en:create:functions:paneldata [26.06.2016 14:46] – [Example] s1305605 | en:create:functions:paneldata [05.09.2020 13:54] – [Return Value (Serial nNumbers)] sophia.schauer | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== panelData() ====== | + | ====== panelData () ====== |
'' | '' | ||
- | The command | + | The function |
- | **Important:** The function provide a value only, if the interview was started by click at the personalized link in a mass mail (else '' | + | The function '' |
+ | ===== Return Value (Adresslist)===== | ||
+ | The'' | ||
- | ===== Example ===== | + | <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 | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | // Only available for respondents with data protection mode " | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | **Important: | ||
+ | |||
+ | **Note:** If the [[en: | ||
+ | |||
+ | **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 ' | ||
+ | |||
+ | **Note:** If the respondent has received an invitation and a reminder, MAILSENT will indicate the time when the original invitation was sent -- regardless of whether the respondent calls up the link in the invitation or in the reminder. | ||
+ | |||
+ | ===== Return Value (Serial nNumbers) ===== | ||
+ | |||
+ | If the questionnaire uses the [[en: | ||
+ | |||
+ | <code php> | ||
+ | array( | ||
+ | ' | ||
+ | ' | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | **Important: | ||
+ | |||
+ | ===== 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 60: | ||
$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 68: | ||
$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(' | ||
+ | } | ||
</ | </ |