Making a Login Page
Overview
About Login Pages
Examples/Techniques
Logging in via Email Address
Logging in via First Name, Last Name
Logging in automatically -- no user info required
Logins in General
Restricting Logins
Adding a Password
Known Bug
Overview
In the Survey Editor, the first page is your login page. (by default). This page contains the information that people use to log in, or the information which will just go into the database whenever anyone visits the survey. Depending upon what you put on this page, it will dramatically change the experience of users filling out your survey. Skim through this page to find out how to make the right login page for your survey.
About Login Pages
The first page is the login page, by default. On this page, if you want users to log in and be able to log in repeatly, put the info you want them to be able to log in as here. Then, set those "key" variables as type "key" (i.e. click the checkbox next to the variable name that says "is a key").
Example 1: Log in via Email address
In this default survey, there is an "Email" question below with a variable named "email" and the variable type is "stringKey". Users type in their email when they visit this page, and anytime they come back to this page they can log in again and jump to the last page they didn't finish (by default).
Example 2: Log in via First name, Last name
If you want people to be able to log in with their first name and last name, they will then be able to re-log in and complete the survey later with their name. (Note that many people have nick-names for their first name and sometimes type one or the other, so this isn't 100% reliable that they'll be able to log in again).
This means that if "Aaron" "Powers" logs in multiple times, he will always get the same ID in the database, and the same data. To let people log in with their first and last names:
(1) delete the question below
(2) and add two short answer questions labelled "First Name" and "Last Name"
(3) set the variable names to "firstName" and "lastName"
(4) change the type of variable for both of them to "stringKey"
(5) click "fix" if you need to and you get an error message.
Example 3: No login info
You want people to log in without completely anonymously, and don't want them to enter anything the first time. You don't care whether they can come back and complete the survey later -- if they come back again, they'll start the survey from scratch and be assigned another userid and you'll never know the difference.
If you want to do this, just delete the "Email" question below. They will automatically be logged in.
Logins In General:
Any thing that is not a key on the first page, the "Login" page, will just go into the database every time the user enters it, just like a regular survey page. But you can make certain questions login variables, similar to letting someone login with a username and password. Add all the questions you want to be login prompts to the login page, and then, check the "is a key" checkbox. Combined, all of these "key" variables will make a unique user, for which they will get the same data in the survey and database every time.
Restricting Logins
You can preset the list of participants that can fill out a survey, see the Participants page. However, this will not restrict it to them only -- anyone can log in still.
To restrict it to only those users, you can change the JSP code. (Read the JSP Intro before doing this).
- Download the first JSP page in your survey, your login page -- "index.jsp"
- In your "survey" or "surveypage" tag, change createUsersAtLogin="true" to createUsersAtLogin="false". See docs.
Then, only the users you've imported will be able to log in.
Adding A Password
- If you want to assign passwords to everyone and lock out other people, follow the directions above, under Restricting Logins.
- Open the Survey Editor.
- In the "Survey" tab, on the first page, the "Login" page, click "New Question". Inside the Wizard:
- Make the type "Short Answer"
- Click "Next".
- Put in the text you want (probably "Password")
- Click "Next"
- Change the "Variable Name" to "password".
- Click the checkbox labelled "Is a key (login variable for re-logging in)
- Click "Finished" to close the Wizard and save your changes.
- If you want people to assign themselves a password the first time they log in, stop here. Otherwise, continue following these directions.
- Click Save. (This creates the column in the next step so you can put in the passwords -- if you don't save here, you won't see the "password" column below).
- Go to the "View" menu, and select "Show Users". In the "Users" tab:
- Create any new rows you want, and type the login information into the table for each user. For example, put any assigned passwords into the "password" column.
You're done. Users should now only be able to log in with the correct password.
Known Bug On Login Pages:
If you use only "abstract" questions as your "key" variables on your login page, and/or your key variables are in "other" fields, the survey will auto-log people in -- it will not find the "key" variables and will thus assume that the page should be auto-logged in. If you encounter this bug, contact us and we will fix it. (Currently, no one has had need for this feature).
|
|