Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
en:create:functions:dropvalue [17.11.2019 16:42] – moritz.guenther | en:create:functions:dropvalue [17.11.2019 16:52] – moritz.guenther |
---|
===== Applications ===== | ===== Applications ===== |
| |
The function ''dropValue()'' can be useful in levying the e-mail address of an individual in order to send an e-mail to that address via ''[[:en:create:functions:mailsend]]'' and then delete the e-mail address afterwards. However, if the e-mail is not to include user specific information, the function [[de:create:questions:email]] may be more useful. | The function ''dropValue()'' can be useful in levying the e-mail address of an individual in order to send an e-mail to that address via ''[[:en:create:functions:mailsend]]'' and then delete the e-mail address afterwards. However, if the e-mail is not to include user specific information, the function [[en:create:questions:email]] may be more useful. |
| |
Ein anderer Einsatzbereich kann darin bestehen, dass die Teilnehmer eine Antwort (z.B. eine Mailadresse oder ein kurzer Aufsatz) geben soll, diese aber aus Datenschutzgründen nicht im Datensatz auftauchen darf. Etwa als Priming-Aufgabe oder wenn nur die Länge des Textes interessiert, nicht aber der Inhalt. Wenn Sie Informationen über den Text speichern, achten Sie aber darauf, dass der PHP-Code der Seite ggf. mehrfach ausgeführt werden könnte, z.B. wenn der Teilnehmer die Seite erneut lädt. In solchen Fällen hilft die Funktion ''[[:de:create:functions:getroute]]''. Natürlich sollte dem Teilnehmer auch kein Zurück-Knopf angeboten werden. | Anotoher application may arise if an interviewee is to provide an answer (e.g. an e-mail address or a short essay) which is not to be saved in the data set due to privacy issues. This may be needed as a priming task or if the interviewer is only interested in the length of the text entered, but not its actual content. However, if you do save information on the text entered, please consider that PHP-code may be executed repeatedly - e.g. if the interviewee reloads the page. In such cases the function ''[[:de:create:functions:getroute]]'' may be helpful. Also note, that the interviewee should not be provided a button to go back. |
| |
<code php> | <code php> |
if (getRoute() == 'next') { | if (getRoute() == 'next') { |
// Länge des eingegebenen Textes im Eingabefeld TX01_01 bestimmen (in Zeichen) | // determines length of the entered text TX01_01 (in characters) |
$length = mb_strlen(value('TX01_01')); | $length = mb_strlen(value('TX01_01')); |
// Die Länge in der internen Variable IV01_01 speichern | // saves the length in the internal variable IV01_01 |
put('IV01_01', $length); | put('IV01_01', $length); |
// Die eigentliche Texteingabe löschen | // deletes the actual text that was entered |
dropValue('TX01_01'); | dropValue('TX01_01'); |
} | } |
</code> | </code> |