Spelling Test" ; } ## Set Begining time for tracking total time if (!isset($_SESSION['startTime'])) { $_SESSION['startTime'] = date('U') ; } $currentTime = date('U') ; $totalTime = $currentTime - $_SESSION['startTime'] ; ### Import files as arrays (one word per line, nothing like) $incorrectArray = file($incorrectFile) ; $correctArray = file($correctFile) ; $allCorrectNumber = rand (0,$controlNumber) ; if ($allCorrectNumber < 1) { $numberCorrect = 4 ; $numberWrong = 0 ; $correctKeys = array_rand ($correctArray , $numberCorrect) ; //$incorrectKey = array_rand ($incorrectArray , $numberWrong) ; $testArray[0] = $correctArray[$correctKeys[0]] ; $testArray[1] = $correctArray[$correctKeys[1]] ; $testArray[2] = $correctArray[$correctKeys[2]] ; $testArray[3] = $correctArray[$correctKeys[3]] ; $incorrectWord = "None" ; $correctChoice = '5' ; } else { $numberCorrect = 3 ; $numberWrong = 1 ; $correctKeys = array_rand ($correctArray , $numberCorrect) ; $incorrectKey = array_rand ($incorrectArray , $numberWrong) ; $testArray[0] = $correctArray[$correctKeys[0]] ; $testArray[1] = $correctArray[$correctKeys[1]] ; $testArray[2] = $correctArray[$correctKeys[2]] ; $testArray[3] = $incorrectArray[$incorrectKey] ; shuffle($testArray) ; $correctChoice = array_search($incorrectArray[$incorrectKey] , $testArray) ; $incorrectWord = $incorrectArray[$incorrectKey] ; } $debugMessage = "
" . " All Correct Number: $allCorrectNumber
Number Correct : $numberCorrect
Number Wrong : $numberWrong
Correct Answer : $correctChoice
Incorrect Word : $incorrectWord " ; //build test word array #### Find out if they are correct if ($_POST) // if the form was submitted { if ($_POST['correct'] == $_POST['word']) { $message = "You Were Correct" ; $_SESSION['num_correct'] ++ ; } else { $message = "You Were Wrong it was " . $_REQUEST['incorrectWord'] . "" ; $_SESSION['num_wrong'] ++ ; } } // end if POST ?> Spelling Test

Which one of these is incorrect




None of the above


Restart Test
Total Time: Minutes
Current Score
Number Correct So Far:
Number Incorrect So Far:

Problems/Comments -> andrew@graymerica.com
View source code