Inhaltsverzeichnis

Request of a Personal Code

The use of a “personal code” for printed questionnaires (pen 'n paper) has proven to be effective in multi-wave surveys. In the first questionnaire, the participant create a code from the fragments of personal information. This could look like the following:

If the participant enters the same code in the second questionnaire, the two data sets can be matched. The above example is only for illustration – actual recommendations can be found, for example, in:

Pöge, A. (2008). Persönliche Codes „reloaded“. Methoden – Daten – Analysen, 2(1), 59-70. German version, online available.

An advantage of this solution is that the code functioned relatively reliably and provided high anonymity in times before the Social Web. However, this solution also has disadvantages:

Alternatives in the Online Questionnaire

If an online questionnaire is used, further options are available for multi-wave surveys. Every solution is a compromise between data protection and convenience/reliability. The following options are arranged by data protection level, whereby the first and “worst” option already guarantees a good level of data protection – but not maximum data protection. For most purposes, serial mail is the method of choice.

Query of a Personal Code

If one has decided against the alternatives for the inquiry of a personal code, there are two fundamental possibilities of the implementation in SoSci Survey:

Open-ended Text Input

The first variant is obvious and corresponds to the procedure in the printed questionnaire. You explain to the participant how to create the code and then use a Text Inputs question so that the participant can enter the code.

To check at least the correct format, you can define a “regular expression” for the text input question. To do this, click on the input field on the left in the navigation and define a regular expression under restrictions for the text input. Regular expressions are complex search patterns with exciting possibilities (regular-expressions.info), but at first glance they also look somewhat complex. It's half as bad for the personal code:

  /[A-Z]{2}[0-9]{3}[A-Z]/

This regular expression describes a code consisting of 2 letters (capital letters, no umlauts), three digits and then another letter, e.g. AB123C.

Separate Text Inputs

It is easier for the respondent to fill in the individual components of the code separately. The format check is also easier.

It is not really necessary to display the participant's personal code “en bloc” again, but if you want to do this, use a little JavaScript. Assuming your text input question has the identifier “PC01” and contains 6 input fields, you would place the following HTML/JavaScript code under the question:

<div style="margin: 2em; font-size: 1.2em;">
  Your personal code:
  <span id="personalCode" style="font-weight: bold;">&ndash;</span>
</div>
<script type="text/javascript">
<!--
var pcInputs = ["PC01_01", "PC01_02", "PC01_03", "PC01_04", "PC01_05", "PC01_06"];
function pcRefresh() {
  var code = "";
  for (var i=0; i<pcInputs.length; i++) {
    code+= document.getElementById(pcInputs[i]).value;
  }
  document.getElementById("personalCode").innerHTML = code;
}
// Init
pcRefresh();
for (var i=0; i<pcInputs.length; i++) {
  document.getElementById(pcInputs[i]).addEventListener("keyup", pcRefresh);
}
// -->
</script>

For the later analysis it is helpful to save the code “en bloc” in the data set. For this you need a Internal variable (e.g. “IV01_01”) and the following PHP code on the next page (!):

$code = implode(valueList('PC01'));
put('IV01_01', $code);

If you expect empty fields, you can also save the components of the code separately with a hyphen (apart from the fact that you have the individual components in the data record again anyway):

$code = implode('-', valueList('PC01'));
put('IV01_01', $code);

Tip: Make sure you specify a mandatory response for open text input, missing data is usually not helpful.