PHP
  Home arrow PHP arrow Page 4 - Developing a Short and Simple IQ Test Online Using PHP
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Developing a Short and Simple IQ Test Online Using PHP
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 11
    2009-01-14


    Table of Contents:
  • Developing a Short and Simple IQ Test Online Using PHP
  • Designing an IQ Grading System
  • The HTML Test Form
  • PHP Script to Process

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Developing a Short and Simple IQ Test Online Using PHP - PHP Script to Process
    ( Page 4 of 4 )

    Below is the source code of IQ.php


    <HTML>

    <HEAD>

    <TITLE>Your IQ Test Result!</TITLE>

    </HEAD>

    <BODY>

    <?php

    //Initialize variables

      $T1 = $_POST['T1'];

      $T2 = $_POST['T2'];

      $T3 = $_POST['T3'];

      $T4 = $_POST['T4'];

      $T5 = $_POST['T5'];

      $T6 = $_POST['T6'];

      $T7 = $_POST['T7'];

      $T8 = $_POST['T8'];

      $T9 = $_POST['T9'];

      $T10 = $_POST['T10'];

       $empty=strlen($_POST['age']);

         if ($empty==0)

    {

      die('You forgot to enter your age. Press back.Thanks.');

    }

      else

    {

      $chronologicalage = $_POST['age'];

    }


    //1

       if($T1 == round)

    {

      $TS1 = 3;

    }

       else

    {

      $TS1 = 0;

    }

    //2

       if($T2 ==15)

    {

      $TS2 = 3;

    }

       else

    {

      $TS2 = 0;

    }

    //3

       if($T3 == 15)

    {

      $TS3 = 3;

    }

       else

    {

      $TS3 = 0;

    }

    //4

       if($T4 == 12)

    {

      $TS4 = 3;

    }

       else

    {

      $TS4 = 0;

    }

    //5

       if($T5 == 1)

    {

      $TS5 = 3;

    }

       else

    {

      $TS5 = 0;

    }

    //6

       if($T6 == 13)

    {

      $TS6 = 3;

    }

       else

    {

      $TS6 = 0;

    }

    //7

       if($T7 =="cnn")

    {

      $TS7 = 4;

    }

       else

    {

      $TS7 = 0;

    }

    //8

       if($T8 == 1980)

    {

      $TS8 = 4;

    }

       else

    {

      $TS8 = 0;

    }

    //9

       if($T9 =="vlookup")

    {

      $TS9 = 4;

    }

       else

    {

      $TS9 = 0;

    }

    //10

       if($T10 == 360000)

    {

      $TS10 = 30;

    }

       else

    {

      $TS10 = 0;

    }

    //Total mental age scores

    $mentalage= $TS1 + $TS2+ $TS3+ $TS4+ $TS5+ $TS6+ $TS7+ $TS8+ $TS9+ $TS10;

      $IQ= ($mentalage/$chronologicalage)*100;

    echo "<br />Hi, your IQ is:"." ".round($IQ,0);

    echo "<br />";

    echo "<br />Thank you for taking this test!<br />"

    ?>

    </BODY>

    </HTML>


    Basically, you can vary the test questions but never the scoring. You can use this type of test online. Please note that this is not guaranteed to be accurate because it is just a 10 question test.



     
     
    >>> More PHP Articles          >>> More By Codex-M
     

       

    PHP ARTICLES

    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5
    - The Role of Interfaces in Applying the Depen...
    - Dependency Injection: Using a Setter Method ...
    - Using a Model Class with the Dependency Inje...
    - Injecting Objects Using Setter Methods with ...
    - Injecting Objects by Constructor with the De...
    - The Dependency Injection Design Pattern in P...
    - Performing Inferential Statistical Analysis ...
    - Performing Descriptive Statistical Analysis ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT