Advertisment

Instant Web-based Surveys 

author-image
PCQ Bureau
New Update

An open source and free package called phpSurveyor can let you construct comprehensive and intelligent surveys through a Web-based and graphical interface. We call it comprehensive because you can setup all kinds of questions (multiple selection, single selection, textual answers and more). The surveys can be configured to be intelligent as it gives you the option to skip question(s) based on the answers to previous questions. 

Advertisment

Installation 



We assume that you are installing phpSurveyor on PCQLinux 2005 (the Linux distribution given out by PCQuest in March 2005). You will need to install and set up PHP scripting engine and MySQL database to run phpSurveyor. Refer to the articles, 'Your own Forum' and 'JDBC Drivers' published in the March 2005 issue of PCQuest. We assume that the IP address of the Linux machine on which you are installing phpSurveyor is 192.168.1.1. Next, create a MySQL database named 'phpsurveyor' for the phpSurveyor as:

Direct Hit!
Applies to:

System administrators and analysts 
USP: Easy set up of comprehensive surveys through a Web-based GUI.
Primary Link:

http://phpsurveyor.sourceforge.net 
Google keywords:

survey publish php

mysqladmin -u root -p create phpsurveyor

Advertisment

When prompted, supply the password for the root MySQL user that you had specified while setting up MySQL on PCQLinux. Download the zipped package of the latest version of phpSurveyor (version 0.98 as of this writing) from

http://phpsurveyor.sourceforge.net. Create a directory named surveyor under /var/www/html and unzip the phpSurveyor package in this directory using the 'unzip' command in Linux. Next issue the following command:

chown -R apache.apache/var/www/html/surveyor

Open the file named config.php, found in the directory /var/www/html/surveyor/admin, in a text editor. Type the values as specified below, leaving other values to their default:

Advertisment

$databaselocation = "localhost"; 



$databaseport = "3306"; 


$databasename = "phpsurveyor"; 


$databaseuser = "root"; 


$databasepass = "secret"; 


$rooturl = "http://192.168.1.1/surveyor";


$rootdir = "/var/www/html/surveyor"; 


$sitename = "Surveyor at PCQuest";


$siteadminemail = "admin@pcquest.com";


$siteadminname = "Admin"; 







In the above, substitute 'secret' for $databasepass with the password for the MySQL's root user. Also feel free to substitute the values for $sitename, $siteadminemail and $siteadminname. Save the file and type in the following URL in a Web browser:

http://192.168.1.1/surveyor/admin/admin.php

Click on the button 'Check Database Fields' on the page that shows up. Then click on the 'Main Admin Screen' button on the subsequent page. This will show up the administration page for phpSurveyor. It's from here you can set up, maintain and analyze all your surveys. But first, we must set up an authenticated access to this page. For this, click on the key icon at the top and then click on 'Initialise Security' (note the misspelled Initialize on the page) button. Click on Continue. On the page titled 'User Control', click on the edit button besides the user named 'admin'. On the subsequent page, change the default password (which is 'password' by default) to your preferred password (say secret123). Henceforth, subsequent accesses to the administration page will prompt you for a user name and password, upon which use admin and secret123.

Advertisment

Create a product survey 



We will create a simple, three-pages long survey with four questions. The questions on each page are as follows:

Page 1

  • Gender: 



    Answer: Male, Female

  •  Which products of our company do you use: 



    Answer: Product A, Product B, Product C
Advertisment

Page 2

  • Which product do you like the best: 



    Answer: Product A, Product B, Product C

Page 3

Advertisment
  • Are you planning to use any product(s) in future ? Please select:



    Answer: Product A, Product B, Product C, None

phpSurveyor allows you to design your own templates 

To create this survey, click on the the icon 'Create or Import New Survey' icon (the last but one icon on the right). Note: You can find out which icons are meant for what by moving the mouse over them. Fill in the form. For 'Format:' select 'Group by Group'. For 'Anonymous:', select No. Click on Create Survey button. Click on the icon 'Add New Group to Survey' (last but one icon on the right). Enter the title as A) Page 1. Click on Add Group. Click on 'Add New Question to Group' icon. For code enter Q1. For question, type in the text for question 1. For type, select Gender from the dropdown. Click on Add Question button. Click on add new question. For code enter Q2. For question, type in question 2. For type, select multiple options. Click on the icon besides 'Warning: You need to add answers to this question'. Add the answers for question 2, with code as A2-1, A2-2, and A2-3. Next, add another group, as before, with the title as B) Page 2. Add a new question with code as Q3, enter question 3 for the question and select List for the type. Click on the icon besides 'Warning: You need to add answers to this question'. Add the answers for question 3, with code as A3-1, A3-2 and A3-3. Finally, add the last group and a question (question 4) with the type as List. Add answers as before with the code as A4-1, A4-2 and A4-3. 

Advertisment

Add intelligence to the survey



You would like to display question 3 ('Which product do you like the best') only if the person selects a product for question 2 ('Which products of our company do you use'). With phpSurveyor, you can set up this kind of conditional display of questions. To achieve this, select 'B) Page 2' from the Groups dropdown and then select question 3 from the questions dropdown. Click on the icon 'Set conditions for this question'. Select question 2 from the Question list. Select all the answers from the Answer list and click on 'Add Condition' button. Click on the close window button at the bottom of the page.

You are done with setting up the questions for the survey. You can test the survey without the answers being recorded by clicking on the 'Do Survey' icon (green wheel). 

Send mail to participants 



Next, add the details (name and e-mail) of the participants. Using phpSurveyor, you can send mail to all of them with the URL to the survey. Click on 'Active this Survey' icon (the blue arrow icon at the top-left). On the next page, click on Activate button. Click on 'Initialise Token' and Continue button. On the 'Token Control', click on the icon 'Add new token entry'. Type in the firstname, lastname and e-mail adress and click on Add. Similarly add details for other people to whom you want to send mail to participate in the survey. Click on wheel icon 'Generate Token'. To dispatch the e-mail invitation, click on 'Send email invitation' and then click on 'Send Invitations' button. As the participants respond, you can view their responses by clicking on 'Browse responses for this survey' icon on the Administration page.

Shekhar Govindarajan, IT4Enterprise

Advertisment