The following programs are needed to use phpTest:
PHP 4.06 and above. You do not need register_globals turned on, and no notices or warnings will be displayed if you have warnings set to E_ALL in your php.ini file.
MySQL 3.22 and above (earlier versions might work but have not been tested)
I've tested phpTest on both Windows and Linux, with IIS and Apache on Windows and with Apache on Linux. Other webservers probably will work with little or no modifications.
The phpTest homepage is located at http://www.resynthesize.com/code/phptest.php. Both win32 zip packages and unix tarballs are available:
phptest-latest.tar.gz for unix systems
phptest-latest.zip for windows systems
Download and extract one of the files to somewhere underneath your webserver document root. You can take a look at the INSTALL file that comes with the distribution for quick install instructions. For more detailed instructions, read on
I've setup CVS access for phpTest on savannah.gnu.org. I check in code about once a day when I'm actively working on phpTest. You can browse the CVS via cvsweb at http://savannah.gnu.org/cgi-bin/viewcvs/phptest/phptest/. You can access the code anonymously via a cvs client with the following commands:
cvs
-d:pserver:anoncvs@subversions.gnu.org:/cvsroot/phptest
login
cvs -z3
-d:pserver:anoncvs@subversions.gnu.org:/cvsroot/phptest co
phptest
There are some mailing lists set up to facilitate the discussion of phpTest. phpTest users is designed for end users who want to discuss the software. The url for this list to subscibe and view archives is http://mail.freesoftware.fsf.org/mailman/listinfo/phptest-users. phpTest developers is for people working on or interested in contributing to phpTest. The url for this list is http://mail.freesoftware.fsf.org/mailman/listinfo/phptest-devel
Before we can actually start using phpTest, we have to dump the data into a MySQL database. I recommend that you create a new database for phpTest, but that is not strictly necessary, as long as there aren't any naming collisions with the phpTest tables and the tables already in your database. To create a new database, login to the MySQL console with a user with appropriate permissions. Then type the following:
CREATE DATABASE
phptest;
Press enter. You should see the following output:
Query OK, 1 row
affected (0.00 secs)
Now, let's dump the data into the database. The distribution comes with a file called phptest.sql. This file contains all of the information we need to put into the database. Type the following to do this. (note: if you look at phptest.sql in a text editor, you'll notice a lot of strange characters. Don't worry, those are just images stored as text.)
mysql -u username -p password database_name
< phptest.sql
If the command runs successfully, you will not see any output and simply receive a shell prompt. Note that you have to substitute username, password, and database_name with appropriate values. If you followed the steps above to create a new database, the database_name would be phptest. The user that you use must have create and insert grants.
The database is now ready to go, we just need to edit some variables to get everything working.
Before we can use phpTest for the first time, we need to set up some configuration variables. Open the file h.inc.php. Go down the list and set each variable with an appopriate value
Variables look like this:
define('VARIABLE_NAME',
'VALUE');Following is some more information about each config variable.
DB_HOST
This is the host of your MySQL database. If it's on the same server as phpTest, you can type 'localhost' here. Otherwise enter the hostname of the MySQL server.
DB_USERNAME
The MySQL username to use when accessing the database. It's a good idea to limit this user's grants to
INSERT, DELETE,and
UPDATE
DB_PASSWORD
The user password to access the database.
DEFAULT_DB
The name of your database you dumped the table into.
DB_TYPE
Leave this to say 'mysql'. I'm going to try to support other databases in the future, but for now mysql is the only option that will work.
DB_USE_PCONNECT
If this is set to 1, then phpTest will use persistent database connectios to your db. You should use this if your setup supports it (most php+mysql installs do) as it will improve performance.
ABSOLUTE_PATH
The absolute http path to your installation of phpTest. This should like something like http://www.mysite.com/phptest/. Make sure to leave the trailing slash.
The rest of the configuration is done from within phpTest. Once you login as an administrative user (discussed later), click on the 'Configuration' menu item to edit other configuration variables.
Following is a list of some configuration variables that require additional explanation:
Hash Var
This is used sort of like a public key/private key var for some functions. Make sure to set it to some unique value that no one else knows.
Language
The language to use for phpTest. All interface text is available in different languages. Currently available language modules are
english
spanish
czech
brazilian-portuguese
If you want to translate phpTest to your own language, modify english.inc.php and save it under a different filename e.g. french.inc.php. Then, send that file back to me so I can include it in future releases. Unfortunatly since phpTest is still under heavy development, some language files may be behind or lacking in phrases compared to the english version. Since I don't speak any language other than english, it's up to the language file maintainers to send those updates to me.
Date Format
Since different regions use different display formats, you can customize phpTest to display dates in the manner most comfortable for your users. Possible values are:
us12: 12 hour USA format. Example: 05/28/2002 10:56pm
us24: 24 hour USA format. Example: 05/28/2002 22:56
eu12: 12 hour europe format. Example: 28/05/2002 10:56pm
eu24: 24 hour europe format. Example: 28/05/2002 22:56
verbose: verbose format. Example: Fri, May 28th, 2002 10:56pm
mysql: MySQL format: Example: 2002-05-28 22:56:00
Titlebar Text
The value of this variable is displayed in the browser titlebar.
Admin Email
If an SQL error message is generated, this email is displayed. It's a good idea to put your email here so that you can be notified if someone is having problems.
Show Weight
If set to '1', the weight of each question will be displayed when a user is taking a test.
Max File Size
The maximum file size to allow for image uploads. The browser is responsible for verifying this size, so don't depend on it.
Self Register
If set to 1, users will be able to sign up for accounts. If set to 0, only administrators can add accounts.
Self Register Group
The default group for people who register themselves. If this is not a valid group, an SQL error will probably be generated. By default, all new self-registered users will be put in a group called 'visitors'.
Require Valid Email
If set to 1, new users will be required to have a valid email address.
The rest of the variables are the html colors for the look of the test. You can modify them if you want but it's not required.
Open up the index.php page on your server. You should be greeted with a login screen. The initial admin login/password is admin/123456. There is also a guest account: guest/guest. Login with the admin account and change your password. Click on a few menu items and verify everything is working. There are a few tests and questions to play around with. If everything is working here, congratulations! If not, see the troubleshooting section later.