next up previous contents index
Next: Measuring Time Up: Examples Previous: A Calculator (Java-Script)   Contents   Index


Showing Stimuli for a fixed amount of time (PHP)

In the following example we show a stimulus for six seconds. Then the stimulus disappeares and is replaced by a question.

Technically this is achived using a META-Tag that calls a new page after a specified amount of time.

As an additional stimulus you may add a layered image (123.gif in the example) that shows the elapsing time, displaying numbers from 1 to 6.

<HTML>
<?
    if (! $NEXT)
        echo "<HEAD>
            <META HTTP-EQUIV=Refresh CONTENT=6;URL=$SCRIPT_NAME?NEXT=1>
            </HEAD>";
    echo "<BODY BGCOLOR=white>
        <FORM METHOD=POST ACTION=$SCRIPT_NAME>";
    if (! $NEXT) {
        echo "Please think a few moments about the following question...
        <h4>When was the Yalta Conference?</h4>
        a) 4.-11. February 1945<BR>
        b) 17. July - 2. August 1945<P>
        <IMG SRC=123.gif>\n";
    }
    if ($NEXT==1) {
        echo "The correct answer is...<P>
        <INPUT TYPE=SUBMIT NAME=A VALUE=a>
        <INPUT TYPE=SUBMIT NAME=A VALUE=b>
        <INPUT TYPE=HIDDEN NAME=NEXT VALUE=2>";
    };

    if ($NEXT==2) 
        echo "You have chosen ($A)<P>";        
?>
</FORM>
</BODY>
</HTML>

next up previous contents index
Next: Measuring Time Up: Examples Previous: A Calculator (Java-Script)   Contents   Index
Oliver Kirchkamp