2009-08-03
QPL Reference Manual

Warning! This page is in the process of being rewritten for QPL Version 6. It may still have references to QPL Version 5.

These instructions are intended for the web site administrator. The steps below describe how to install the finished QPL project files, that were delivered by the questionnaire author, on a web site. These instructions also presume that the one-time server set up tasks have already been completed for the target web server.

If you have installed Apache, PHP, and MySQL on your Windows PC (for developing and testing applications), please see Installing QPL Project Files on a Local Web Server for quick installation instructions.

Task Comments
1. Review instructions The questionnaire author should have made a number of decisions about where he or she want the project deployed, how various QPL configuration options should be set, and how user accounts should be set up.
2. Create directory The questionnaire author should have suggested a URL in his or her instructions.

(Note: Each QPL project must be loaded into a separate directory on your web server.)
3. Copy files Copy the project files to the web site directory.
4. Lowercase file names All the file names must use lowercase letters on a Linux server.
5. Check job.sql file The questionnaire author should have used the MySQL user name and password that you selected for all QPL projects when you completed the one-time server set up tasks. Check that the GRANT statement in their project SQL file uses the account you defined, not the default settings shown below.
...
GRANT ALL ON job.* TO qplsurvey@localhost idENTIFIED BY "surfclam";
...

You can also discover the QPL System Administrator user name and password for the project by checking the INSERT statement...
...
INSERT INTO user (q_uname, q_pswd, q_name, q_user_status)
    valueS ('admin', 'changeme', 'System Administrator', 5),
...

This account is used after the project is deployed to select the final default project configuration options (see step 9 below).
6. Remove the qpl_config.inc file The questionnaire author should not have included a copy of the QPL configuration file, qpl_config.inc, with his package. This file is used by all QPL projects on a server to get various information about your server, including path locations and the MySQL user name and password that all the QPL projects should use. This file should have been configured stored on the server on the PHP include file path when you completed the one-time server set up tasks.
7. Run SQL scripts First run the project MySQL script, job.sql, to create the project data base. (Note: replace "job"with the project file name.)

Next, run any additional SQL scripts that the questionnaire author may have created to load user accounts or preload respondent information.

Finally, delete the .sql files from the server.
8. Set default project settings Launch the project by entering the URL in your browser and then logging in as the System Administrator (using the user name and password from step 6).

Go to the "Edit -> Project default settings" page and select the options specified by the questionnaire author.

Exit the administrative pages properly by clicking on the "Cancel" button on the main administrative page.
9. Test the questionnaire Five test respondent accounts are automatically created:

User names: test1 through test5
Password: changeme

Remember, any information you enter on a test account, including the last page you were viewing, will be stored in the MySQL database, and used when someone else logs in using this account. This is often a source of confusion and concern if others will be using the same account for testing. The system is set up, however, so that data entered under test accounts are not included in the summary tabulation report or the export data files.

Next, you should ask the questionnaire author to test the site before sending out notification email messages to respondents.

Rebuilding the Web Site

If you need to rebuild the site after the instrument has been changed as a result or pretesting (and no data needs to be migrated to the new version), you should drop the database and rebuild the site following the steps above.

If you need to modify the site after respondents have begun using it (that is, live data has been collected), then you face a much more delicate task. If only wording changes have been made to some questions which have no affect on the data base structure, then you can simply overwrite the web site files with the new project files.

If, however, changes were made that affect the "data" table structure then you must create an "ALTER TABLE" SQL script that converts the old data table into the new data table. Then you must update the web site with the new project files and run this script (not the new job.sql script).