Class QuizBase

java.lang.Object
  |
  +--InfoBase
        |
        +--QuizBase

public class QuizBase
extends InfoBase

Description: this object tracks the user answers for the Quiz and stores the actual answers. it also holds the chainmap object which will be warped when the user finishes the quiz... it also keeps track of which question the ueser is on and a mechanism to ask questions. if the program is run in application mode the user can print the results to an output file...


Field Summary
 boolean displayactual
           
 boolean displayResults
           
 boolean displayvector
           
 boolean done
           
 boolean isWarped
           
 int locationsAnswered
           
 chainMap map
           
 QuestionResults questionResults
           
 boolean showWarpedMap
           
 javax.swing.JTextField status
           
 MapWarper Warped
           
 
Constructor Summary
QuizBase()
           
QuizBase(int numQuestions)
           
QuizBase(int numQuestions, int numloc)
           
 
Method Summary
 void askLocation()
          ask the next question (Location) in the Quiz
 void displayLocations(java.awt.Graphics g)
          //Method: displayLocations // 1)displays all of the user entered points // 2)displays the actual locations (if selected) // 3)displays the vectors form user to actual locations (if selected) // 4)displays the warped map (if selected)
 void finish()
          finishes the simulation
 void hideActualVectors()
           
 boolean isFinished()
          returns whether the Quiz is Finished
 QuizLocation logUserPoint(int x, int y)
          save the Users entry to a location
 void moveToNextLocation()
          ask information about the next point
 void print()
           
 void printOutput(java.lang.String filename)
           
 void printToFile(java.io.RandomAccessFile r)
          prints the actual and user answers to all the questions in a quiz to a file specified by the user
 void saveMap(javax.swing.JFrame parent)
          saves the Map as a JPEG image to a file specified by the user
 void saveResults(javax.swing.JFrame parent)
           
 void setMap(chainMap map)
          sets the map to be warped
 void setTextField(javax.swing.JTextField s)
           
 void Start()
          begins asking questions in the quiz
 void toggleActual()
          turns whether the actual locations are shown on or off
 boolean toggleActualShown()
           
 void toggleResults()
          turns whether the results are shown or hidden
 void toggleVectors()
          turns whether the vectors from the users locations to actual locations are shown on or off
 void toggleWarped()
          turns whether the warped map is shown or hidden
 void WarpMap()
          warps the map
 
Methods inherited from class InfoBase
addLocation, addQuestion, addQuestion, addQuestion, setNumLocations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

done

public boolean done

status

public javax.swing.JTextField status

locationsAnswered

public int locationsAnswered

questionResults

public QuestionResults questionResults

Warped

public MapWarper Warped

map

public chainMap map

displayactual

public boolean displayactual

displayvector

public boolean displayvector

displayResults

public boolean displayResults

isWarped

public boolean isWarped

showWarpedMap

public boolean showWarpedMap
Constructor Detail

QuizBase

public QuizBase()

QuizBase

public QuizBase(int numQuestions)

QuizBase

public QuizBase(int numQuestions,
                int numloc)
Method Detail

setMap

public void setMap(chainMap map)
sets the map to be warped

WarpMap

public void WarpMap()
warps the map

hideActualVectors

public void hideActualVectors()

toggleActual

public void toggleActual()
turns whether the actual locations are shown on or off

toggleVectors

public void toggleVectors()
turns whether the vectors from the users locations to actual locations are shown on or off

toggleWarped

public void toggleWarped()
turns whether the warped map is shown or hidden

toggleResults

public void toggleResults()
turns whether the results are shown or hidden

isFinished

public boolean isFinished()
returns whether the Quiz is Finished

print

public void print()

setTextField

public void setTextField(javax.swing.JTextField s)

Start

public void Start()
begins asking questions in the quiz

finish

public void finish()
finishes the simulation

askLocation

public void askLocation()
ask the next question (Location) in the Quiz

logUserPoint

public QuizLocation logUserPoint(int x,
                                 int y)
save the Users entry to a location

moveToNextLocation

public void moveToNextLocation()
ask information about the next point

displayLocations

public void displayLocations(java.awt.Graphics g)
//Method: displayLocations // 1)displays all of the user entered points // 2)displays the actual locations (if selected) // 3)displays the vectors form user to actual locations (if selected) // 4)displays the warped map (if selected)

toggleActualShown

public boolean toggleActualShown()

printOutput

public void printOutput(java.lang.String filename)

saveResults

public void saveResults(javax.swing.JFrame parent)

saveMap

public void saveMap(javax.swing.JFrame parent)
saves the Map as a JPEG image to a file specified by the user

printToFile

public void printToFile(java.io.RandomAccessFile r)
prints the actual and user answers to all the questions in a quiz to a file specified by the user