Zu Hauptinhalten wechseln

FV Decipher Unterstützung

Alle Themen, Ressourcen für FV Decipher benötigt.


Set a Survey Password

1:  Overview

Password entry into your survey can be done using the <text> question element, the File(..) function and a tab-delimited file. For information on using the File(..) function, click here.

2:  Single Password Only

To create a single-password entry to your survey, you will need some way of identifying respondents in order to check their password. This is usually an extraVariable like source or id.

Given the following tab-delimited file named "passwords.dat":

source           password
un1qu30n3        p4ssw0Rd123
sp3C14LuN        iluvmypuppy99
bl4hblAHB        battery_horse_staple

We can use the File() function as described in Importing External Offline Data to compare unique identifiers with a password.

For example:

<html label="Introduction" where="survey">
  <p>Welcome to the survey!</p>
  <p>On the next page, you'll be asked for your password.</p>

<text label="PASS">
  <title>Please enter your password:</title>

<exec when="init">
dataFile = File("passwords.dat", "source")

<radio label="PASS_CHECK" where="execute">
respData = dataFile.get(source)

if respData and respData['password'] == PASS.val:
    PASS_CHECK.val = PASS_CHECK.yes.index
    PASS_CHECK.val = PASS_CHECK.no.index
  <row label="yes">Yes</row>
  <row label="no">No</row>

<term cond="PASS_CHECK.no">PASS_CHECK: FAIL</term>

<html label="Welcome" where="survey">Welcome! Please "Continue".</html>


Choose any of the links below to demo the code above:

source password
user1 pass1
user2 pass2
user3 pass3
user4 pass4

You will see "Welcome! Please 'Continue'." upon successful entry.

You can use a similar technique to validate a username and password against a tab-delimited file.