Professional > Interview scripting > Sample management > Sample management facilities > Authentication of inbound respondents > Authentication page
 
Authentication page
You define the page that is to be used for authentication when you activate the project. UNICOM Intelligence Interviewer - Server uses this information to display the authentication page. You can define the authentication page as either an UNICOM Intelligence Interviewer - Server template or a URL. However, you are very strongly advised to define authentication pages using templates at all times.
Template
The template must be an UNICOM Intelligence Interviewer - Server template. When UNICOM Intelligence Interviewer - Server displays an authentication page defined as a template, it automatically inserts questions based on the authentication fields at the position indicated by the <mrData> tag.
URL
The URL must link to a web page containing a form that points to UNICOM Intelligence Interviewer - Server(mrIWeb.dll). When you define the authentication page as a URL, you can use Common Gateway Interface (CGI) scripts and active server pages (ASPs). However,UNICOM Intelligence Interviewer - Server does not insert questions based on the authentication fields into the page automatically--you must create all of the fields on the page yourself. This method is not recommended because it causes a new skeleton interview to be started each time auto-authentication is run and there is no way of stopping the skeleton interview if the respondent then fails the authentication process.
Sometimes you may want to ask for additional information (such as age, gender, car owner, etc.). The recommended way of doing this is to create an additional pre-authentication web page to ask this information outside of the UNICOM Intelligence Interviewer - Server system. When respondents join the interview, you route them to this page. The page should contain a form that points to UNICOM Intelligence Interviewer - Server(mrIWeb.dll) and a hidden field that defines the name of the project. When the respondent clicks the Submit button, the information he or she has entered is passed to the authentication function.
All of the responses passed to the authentication function are available to the sample management script in the SampleFields object, and they are copied to the corresponding fields on the SampleRec object by the AuthenticateSampleRec and AddSampleRec methods. However, when the SampleRec object is written, the information is stored in the sample table only if the names of the questions in the HTML form match the names of the columns mapped in the sample table during activation.
The details of the authentication page are held as interview properties that you can access from the sample management script. This means that you can change the authentication page that is to be shown from within the script.
Disabling button double-clicks in the default templates
Survey respondents are often presented the option of logging in to complete surveys. After a respondent enters a user ID and clicks OK, it can sometimes takes a few seconds for the server to authenticate the user credentials. If a respondent clicks OK a second time, the server may generate a message similar to the following:
Thank you for your interest in participating in this survey.
A survey is active for your ID. Please continue the original survey or return in 10 minutes to restart.
You can avoid this by adding the following script to the header tags for all default templates:
<script language="javascript" defer="true">
function addEvent(target, eventName, handlerName)
{
if (target.addEventListener) // W3C
{
target.addEventListener(eventName, handlerName, false);
  return true;
  }
  else if (target.attachEvent) // IE
  {
    return target.attachEvent("on" + eventName, handlerName);
  }
  else
  {
    target["on" + eventName] = handlerName;
  }
    }
    var ctrlNext;
    ctrlNext = document.getElementsByName("_NNext")[0];
              
    function NextClicked()
    {
      if(ctrlNext != null)
      {
        setTimeout('ctrlNext.disabled = true;', 1);
      }
    }
            
  addEvent(ctrlNext, 'click', NextClicked);
</script>
The script prevents additional clicks from registering with the server.
See also
Authentication of inbound respondents