All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class guinea.logic.Test

java.lang.Object
   |
   +----guinea.logic.Test

public class Test
extends Object
implements PropertyLoader, Runnable

Variable Index

· currentItem
· currentItemIndex
· defaultPlayerClassName
· defaultSubjectUI
The default subject UI block used for testing.
· disableWhenDone
Disable subject UI when subject is done with item or timeout has expired.
· doneCond
Used to wait until all subject are done.
· enableDoneWhenAnswers
Enable DONE-button only after answers to all questions has been given.
· enableQuestionsAfterPlaying
Answering to questions is allowed only after all samples have been listened to.
· FILETYPE_PROPERTIES
Save data using textual property files.
· FILETYPE_SERIALIZED
Save data using java's serialization system.
· items
List of test items in this test.
· itemsFile
The the file that contains item properties.
· itemsFilename
The name of the file that contains item properties.
· itemsProps
The properties used to contruct the item objects.
· itemStartTime
· itemTemplates
· itemTimeout
The timeout of item in milliseconds.
· itemWarningTimeout
If the time to answer is limited, a warning is given before the time expires.
· listenedSamples
During an item, set to true when all item samples (or sample sequence) has been played.
· MCLL
MCLL level of test.
· MCLLmax
Maximum MCLL that subject can set.
· MCLLmin
Minimum MCLL that subject can set.
· numSwitches
· player
The sound player.
· playerProps
The properties that contain the parameters of the player.
· playlist
The playlist as a vector.
· playlistFile
The file that contains the play list.
· playlistFilename
The name of the file that contains the play list.
· progressStatusMonitorID
The monitor object ID of the test progress monitor object.
· requireAllAnswers
Requires that answer gives answers to all questions.
· resultsFile
The results file.
· resultsFilename
The file name of results file.
· resultsFileType
File type of saving files.
· resultsSaved
Shows whether result file has already been written out.
· samples
List of samples for this test.
· sampleSequence
The fixed sample sequence to play to subjects.
· samplesFile
The file that contains sample information.
· samplesFilename
The name of the file that contains sample information.
· samplesProps
The properties used to contruct the sample objects.
· sampleSwitching
· SEQUENCE_FIXED
Sample sequence is fixed.
· SEQUENCE_FORCED
Sample sequence is forced (same as fixed). Deprecated.
· SEQUENCE_FREE
Subject can play samples freely.
· sequenceType
Type of sequence, free or forced.
· sessionID
ID of the current session.
· sessionLog
· showProgressStatus
Whether to show test progress status information to the subjects.
· subjects
List of subjects participating in this test session.
· subjectSetsMCLL
If set to true, the subject sets the MCL level before proceeding to the actual items.
· SWITCHING_NORMAL
· SWITCHING_PARALLEL
· testDirectory
The directory of the test.
· testInProgress
Is the test in progress right now.
· testThread
The thread that runs the test.
· timeoutOccured
Used in the test to indicate that at least one of subject's answering time has expired.
· TIMINGSTART_AFTER_ITEMRUN
Item duration timing start after the item/sequence has been run.
· TIMINGSTART_BEFORE_ITEMRUN
Item duration timing start before the item/sequence is run.
· trainingMode
Is training mode on (true), results are not saved.
· uiFile
The file that contains UI properties.
· uiFilename
The name of the file that contains UI properties.
· uiProps
The properties used to contruct an UI interface object.
· whenTimingStarts
Tells when to start the timing of the duration of item.

Constructor Index

· Test()

Method Index

· addItem(String, Item)
· addSubject(String)
Add a test subject to the test.
· addSubject(String, SubjectUI)
Add a test subject to the test with a specific subject UI block.
· endItem()
Finish current item.
· endItemSamples()
Unload and remove sample objects that were needed with this item.
· endItemUI()
· endPlayer()
· endTest()
· getDefaultItemTemplate()
Get or construct a default test item template for use with this test.
· getDefaultPlayerClassName()
· getItem(int)
Get test item.
· getItem(String)
Get test item.
· getItemBinding(int)
· getItemBinding(Item)
· getItemBinding(String)
· getItemClassName()
Get the default class name of the test item used by this test.
· getItemIndex(Item)
Get the index of a test item.
· getItemIndex(String)
Get the index of a test item.
· getItemsFile()
· getItemsFilename()
· getItemTemplates()
Get a table (dictionary) of test item templates that are used in the test.
· getItemTimeout()
Get the current value of item timeout
· getItemWarningTimeout()
Get the current value of warning timeout
· getNumItems()
Get the number of items in the test.
· getPlayer()
· getPlaylistFile()
· getPlaylistFilename()
Get the name of the playlist file.
· getProgressStatusInfo()
Get the test progress status info to show to the subject.
· getResultsFile()
· getResultsFilename()
· getSampleSequence()
Get the fixed sample sequence.
· getSamplesFile()
· getSamplesFilename()
· getSampleSwithing()
Get the sample switching type.
· getSequenceType()
Get the type of the sample sequence.
· getSessionID()
· getSubjectItem(String, int)
· getSubjectItem(String, String)
· getTestDirectory()
Get the test directory of this test.
· getTestDirectoryName()
Get the test directory of this test.
· getUIFile()
· getUIFilename()
· initItem()
Initialize current item.
· initItemSamples()
Load and create sample objects for playing.
· initItemUI()
· initPlayer()
Initialize the sound player.
· initTest()
· loadItems()
Load test items from files to the test.
· loadSamples()
· loadTest(String)
Deprecated.
· loadTest(String, String)
Deprecated.
· loadUI()
· loadUI(Properties, String)
Deprecated.
· loadUI(String)
Deprecated.
· loadUI(String, String)
Deprecated.
· loadUIProperties()
· progressCheck()
· progressCheck(String)
· propertyLoad(Properties, String)
· run()
· runItem()
· runSequence()
· runTest()
· saveItemResults()
· saveTestResults()
· serializeResults(String)
· setConfigFile(String)
· setItemsFilename(String)
· setItemTimeout(double)
Set the item timeout.
· setItemWarningTimeout(double)
Set the warning timeout.
· setPlayer(SoundPlayer)
· setPlaylistFile(String)
Set the file name of the playlist file. Deprecated.
· setPlaylistFilename(String)
Set the file name of the playlist file.
· setQuestionsEnabled(boolean)
Enable or disable the question (answer) components for all subjects.
· setResultsFilename(String)
· setSampleSequence(Sequence)
Set the fixed sample sequence.
· setSamplesFilename(String)
· setSampleSwitching(int)
Set the sample switching type.
· setSequenceType(int)
Set the type of the sample sequence.
· setSessionID(String)
· setTestDirectory(File)
Set the test directory.
· setTestDirectory(String)
Set the test directory.
· setUIFilename(String)
· setWarningIndicators(double, double)
Used internally to set the timeout and warning indicators for all subjects.
· setWarningIndicators(int, int)
Used internally to set the timeout and warning indicators for all subjects.
· showProgressStatus(SubjectUI, Object)
Show test progress status to the subject.
· startTest()
· startWarningIndicators()

Variables

· currentItemIndex
 protected transient int currentItemIndex
· currentItem
 protected transient Item currentItem
· itemStartTime
 protected long itemStartTime
· SEQUENCE_FIXED
 public static final int SEQUENCE_FIXED
Sample sequence is fixed.

· SEQUENCE_FORCED
 public static final int SEQUENCE_FORCED
Note: SEQUENCE_FORCED is deprecated. use SEQUENCE_FIXED instead.

Sample sequence is forced (same as fixed).

· SEQUENCE_FREE
 public static final int SEQUENCE_FREE
Subject can play samples freely.

· sequenceType
 protected int sequenceType
Type of sequence, free or forced.

· testInProgress
 protected boolean testInProgress
Is the test in progress right now.

· sessionID
 protected String sessionID
ID of the current session. If no session ID is given, an automatically generated ID is used instead (is will be a string 'S' and the difference, measured in minutes, between the current time and midnight, January 1, 1970 UTC).

· items
 protected BindingVector items
List of test items in this test.

· itemsFilename
 protected String itemsFilename
The name of the file that contains item properties.

· itemsFile
 protected File itemsFile
The the file that contains item properties.

· itemsProps
 protected Properties itemsProps
The properties used to contruct the item objects.

· itemTemplates
 protected Hashtable itemTemplates
· playlistFilename
 protected String playlistFilename
The name of the file that contains the play list.

· playlistFile
 protected File playlistFile
The file that contains the play list.

· playlist
 protected Vector playlist
The playlist as a vector. It contains the names (IDs) of items that are to be played in this order.

· subjects
 protected BindingVector subjects
List of subjects participating in this test session.

· samples
 protected BindingVector samples
List of samples for this test.

· samplesFilename
 protected String samplesFilename
The name of the file that contains sample information.

· samplesFile
 protected File samplesFile
The file that contains sample information.

· samplesProps
 protected Properties samplesProps
The properties used to contruct the sample objects.

· disableWhenDone
 protected boolean disableWhenDone
Disable subject UI when subject is done with item or timeout has expired. Also used to prevent subject to change answers after he/she has decided being done.

· requireAllAnswers
 protected boolean requireAllAnswers
Requires that answer gives answers to all questions. If false, some answers can be left unanswered.

· enableDoneWhenAnswers
 protected boolean enableDoneWhenAnswers
Enable DONE-button only after answers to all questions has been given. If false, DONE-button can be used even that all questions haven't been answered.

· enableQuestionsAfterPlaying
 protected boolean enableQuestionsAfterPlaying
Answering to questions is allowed only after all samples have been listened to. If false, questions can be answered even if subject hasn't listened to all samples in the item.

· listenedSamples
 protected transient boolean listenedSamples
During an item, set to true when all item samples (or sample sequence) has been played.

· sampleSequence
 protected Sequence sampleSequence
The fixed sample sequence to play to subjects.

· uiFilename
 protected String uiFilename
The name of the file that contains UI properties.

· uiFile
 protected File uiFile
The file that contains UI properties.

· uiProps
 protected Properties uiProps
The properties used to contruct an UI interface object.

· defaultSubjectUI
 protected SubjectUI defaultSubjectUI
The default subject UI block used for testing. It is loaded from the file 'uiFilename'.

· player
 protected SoundPlayer player
The sound player.

· playerProps
 protected Properties playerProps
The properties that contain the parameters of the player.

· testThread
 protected transient Thread testThread
The thread that runs the test.

· itemTimeout
 protected long itemTimeout
The timeout of item in milliseconds. The subject has that much time to give answers. It it is 0, there is no time limit to answer.

· itemWarningTimeout
 protected long itemWarningTimeout
If the time to answer is limited, a warning is given before the time expires. This is milliseconds before the time ends.

· timeoutOccured
 protected transient boolean timeoutOccured
Used in the test to indicate that at least one of subject's answering time has expired.

· trainingMode
 protected boolean trainingMode
Is training mode on (true), results are not saved. Otherwise, the test is for real and results are saved.

· SWITCHING_NORMAL
 public static final int SWITCHING_NORMAL
· SWITCHING_PARALLEL
 public static final int SWITCHING_PARALLEL
· sampleSwitching
 protected int sampleSwitching
· numSwitches
 protected transient int numSwitches
· doneCond
 protected transient KeyCounter doneCond
Used to wait until all subject are done.

· resultsFilename
 protected String resultsFilename
The file name of results file. If null, a name will be created.

· resultsFile
 protected File resultsFile
The results file. If null, a name will be created.

· FILETYPE_SERIALIZED
 public static final int FILETYPE_SERIALIZED
Save data using java's serialization system.

· FILETYPE_PROPERTIES
 public static final int FILETYPE_PROPERTIES
Save data using textual property files.

· resultsFileType
 protected int resultsFileType
File type of saving files.

· resultsSaved
 protected boolean resultsSaved
Shows whether result file has already been written out.

· TIMINGSTART_BEFORE_ITEMRUN
 public static final int TIMINGSTART_BEFORE_ITEMRUN
Item duration timing start before the item/sequence is run.

· TIMINGSTART_AFTER_ITEMRUN
 public static final int TIMINGSTART_AFTER_ITEMRUN
Item duration timing start after the item/sequence has been run.

· whenTimingStarts
 public int whenTimingStarts
Tells when to start the timing of the duration of item.

· subjectSetsMCLL
 protected boolean subjectSetsMCLL
If set to true, the subject sets the MCL level before proceeding to the actual items.

· MCLLmin
 protected Volume MCLLmin
Minimum MCLL that subject can set.

· MCLLmax
 protected Volume MCLLmax
Maximum MCLL that subject can set.

· MCLL
 protected Volume MCLL
MCLL level of test.

· sessionLog
 protected SessionLog sessionLog
· showProgressStatus
 protected boolean showProgressStatus
Whether to show test progress status information to the subjects.

· progressStatusMonitorID
 protected String progressStatusMonitorID
The monitor object ID of the test progress monitor object.

· testDirectory
 protected File testDirectory
The directory of the test. All pathnames are relative to this directory.

· defaultPlayerClassName
 protected String defaultPlayerClassName

Constructors

· Test
 public Test()

Methods

· getItem
 public Item getItem(int index)
Get test item.

Parameters:
index - is the index to the item list
· getItem
 public Item getItem(String itemID)
Get test item.

Parameters:
itemID - is the ID of item
· getItemIndex
 public int getItemIndex(String itemID)
Get the index of a test item.

Parameters:
itemID - is a item id.
· getItemIndex
 public int getItemIndex(Item item)
Get the index of a test item.

Parameters:
item - is a test item.
· getNumItems
 public int getNumItems()
Get the number of items in the test.

Returns:
number of items or -1 if items haven't been loaded yet.
· getItemBinding
 public Binding getItemBinding(int index)
· getItemBinding
 public Binding getItemBinding(String itemID)
· getItemBinding
 public Binding getItemBinding(Item item)
· addItem
 public void addItem(String name,
                     Item item)
· addSubject
 public Subj addSubject(String subjID,
                        SubjectUI ui)
Add a test subject to the test with a specific subject UI block.

Parameters:
subjID - the subject ID of the subject. If null, a new ID is generated (based on the session's ID).
ui - the UI block that is used with this subject.
Returns:
subject's info object.
· addSubject
 public Subj addSubject(String subjID)
Add a test subject to the test. Subject UI block is loaded from UI file.

Parameters:
subjID - the subject ID of the subject. If null, a new ID is generated (based on the session's ID).
Returns:
subject's info object.
· loadUI
 public static SubjectUI loadUI(String uiFilename) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException
Note: loadUI() is deprecated. use SubjectUIHelp.loadUI methods.

· loadUI
 public static SubjectUI loadUI(String uiFilename,
                                String defaultUIClassName) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException
Note: loadUI() is deprecated. use SubjectUIHelp.loadUI methods.

· loadUI
 public static SubjectUI loadUI(Properties uiProps,
                                String defaultUIClassName) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException
Note: loadUI() is deprecated. use SubjectUIHelp.loadUI methods.

· loadUI
 public SubjectUI loadUI() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException
· loadUIProperties
 public Properties loadUIProperties() throws IOException
· getSubjectItem
 public Item getSubjectItem(String subjID,
                            String itemID)
· getSubjectItem
 public Item getSubjectItem(String subjID,
                            int itemIndex)
· run
 public void run()
· startTest
 public Thread startTest()
· runTest
 public void runTest()
· initTest
 public void initTest() throws Exception
· initItemUI
 protected void initItemUI()
· getProgressStatusInfo
 protected Object getProgressStatusInfo()
Get the test progress status info to show to the subject.

Returns:
a progress status info object.
· showProgressStatus
 protected void showProgressStatus(SubjectUI ui,
                                   Object info)
Show test progress status to the subject.

Parameters:
ui - The subject UI that shows the info.
info - An object containing status info about the test. If null, no status info is shown.
· runItem
 protected void runItem() throws InterruptedException
· runSequence
 protected void runSequence() throws InterruptedException
· saveItemResults
 protected void saveItemResults()
· endItemUI
 protected void endItemUI()
· saveTestResults
 public void saveTestResults() throws Exception
· endTest
 public void endTest()
· initItem
 protected void initItem() throws Exception
Initialize current item. Loads samples, reset answers, init gui.

Throws: Exception
an exception is thrown if item initialization fails for some reason.
· endItem
 protected void endItem()
Finish current item. Unload samples, setup GUI, record answers.

· initItemSamples
 protected void initItemSamples() throws Exception
Load and create sample objects for playing. Information about samples are read from the information about the current item.

Throws: Exception
initialization of samples may throw a exception if something went wrong.
· endItemSamples
 protected void endItemSamples()
Unload and remove sample objects that were needed with this item.

· getDefaultPlayerClassName
 public String getDefaultPlayerClassName()
· initPlayer
 protected void initPlayer() throws Exception
Initialize the sound player.

Throws: Exception
an exception is thrown if player initialization fails for some reason.
· endPlayer
 protected void endPlayer()
· setPlayer
 public void setPlayer(SoundPlayer player)
· getPlayer
 public SoundPlayer getPlayer()
· serializeResults
 protected void serializeResults(String filename)
· getSampleSequence
 public Sequence getSampleSequence()
Get the fixed sample sequence.

Returns:
The fixed sample sequence that is to play to subjects. Returns null if sequence has not been set.
· setSampleSequence
 public void setSampleSequence(Sequence seq)
Set the fixed sample sequence.

Parameters:
seq - The sequence to be used in the test or null to remove fixed sequence.
· getSequenceType
 public int getSequenceType()
Get the type of the sample sequence.

Returns:
SEQUENCE_FREE for free sequence or SEQUENCE_FIXED for fixed sequence.
· setSequenceType
 public void setSequenceType(int type)
Set the type of the sample sequence.

Parameters:
type - SEQUENCE_FREE for free sequence or SEQUENCE_FIXED for fixed sequence.
· getSampleSwithing
 public int getSampleSwithing()
Get the sample switching type.

Returns:
SWITCHING_PARALLEL or SWITCHING_NORMAL
· setSampleSwitching
 public void setSampleSwitching(int type)
Set the sample switching type.

Parameters:
type - SWITCHING_PARALLEL or SWITCHING_NORMAL
· setItemTimeout
 public void setItemTimeout(double seconds)
Set the item timeout. It is the time the subject has available to give his/hers answers.

Parameters:
secondstimeout - in seconds
· getItemTimeout
 public double getItemTimeout()
Get the current value of item timeout

Returns:
timeout in seconds.
· setItemWarningTimeout
 public void setItemWarningTimeout(double seconds)
Set the warning timeout. It is the time before actual timeout when the warning indicator is lit.

Parameters:
seconds - seconds before the timeout to show the warning.
· getItemWarningTimeout
 public double getItemWarningTimeout()
Get the current value of warning timeout

Returns:
warning timeout in seconds.
· setWarningIndicators
 protected void setWarningIndicators(int timeout,
                                     int warning)
Used internally to set the timeout and warning indicators for all subjects.

Parameters:
timeout - timeout in milliseconds
warning - warning time in milliseconds
· setWarningIndicators
 protected void setWarningIndicators(double timeout,
                                     double warning)
Used internally to set the timeout and warning indicators for all subjects.

Parameters:
timeout - timeout in seconds
warning - warning time in seconds
· startWarningIndicators
 protected void startWarningIndicators()
· setSessionID
 public void setSessionID(String sessionID)
· getSessionID
 public String getSessionID()
· setConfigFile
 public void setConfigFile(String filename)
· getTestDirectory
 public File getTestDirectory()
Get the test directory of this test.

Returns:
The test directory.
· getTestDirectoryName
 public String getTestDirectoryName()
Get the test directory of this test.

Returns:
The directory name.
· setTestDirectory
 public void setTestDirectory(String dir)
Set the test directory.

Parameters:
dir - The test directory. If it is a file, its parent directory will be used.
· setTestDirectory
 public void setTestDirectory(File dir)
Set the test directory.

Parameters:
dir - The test directory. If it is a file, its parent directory will be used.
· progressCheck
 protected void progressCheck(String error)
· progressCheck
 protected void progressCheck()
· loadItems
 public void loadItems() throws Exception
Load test items from files to the test.

Throws: Exception
if something goes wrong in loading.
· loadSamples
 public void loadSamples() throws Exception
· setQuestionsEnabled
 protected void setQuestionsEnabled(boolean enabled)
Enable or disable the question (answer) components for all subjects.

· getItemClassName
 public String getItemClassName()
Get the default class name of the test item used by this test.

Returns:
A class name of test item.
· getDefaultItemTemplate
 public Item getDefaultItemTemplate()
Get or construct a default test item template for use with this test. The default implementation creates a template by creating an instance of the default item class got from getItemClassName(). Subclasses may also override this with their own.

Returns:
A test item template or null if class not specified or instantiation failed.
See Also:
getItemClassName
· getItemTemplates
 public Dictionary getItemTemplates()
Get a table (dictionary) of test item templates that are used in the test. The table generally contains at least the 'default' template.

Parameters:
A - dictionary of test item templates.
· setUIFilename
 public void setUIFilename(String filename)
· getUIFilename
 public String getUIFilename()
· getUIFile
 public File getUIFile()
· setItemsFilename
 public void setItemsFilename(String filename)
· getItemsFilename
 public String getItemsFilename()
· getItemsFile
 public File getItemsFile()
· setSamplesFilename
 public void setSamplesFilename(String filename)
· getSamplesFilename
 public String getSamplesFilename()
· getSamplesFile
 public File getSamplesFile()
· setResultsFilename
 public void setResultsFilename(String filename)
· getResultsFilename
 public String getResultsFilename()
· getResultsFile
 public File getResultsFile()
· setPlaylistFilename
 public void setPlaylistFilename(String filename)
Set the file name of the playlist file.

Parameters:
playlist - Name of the playlist file.
· getPlaylistFilename
 public String getPlaylistFilename()
Get the name of the playlist file.

Returns:
The file name of the playlist or null if no playlist has been set.
· getPlaylistFile
 public File getPlaylistFile()
· setPlaylistFile
 public void setPlaylistFile(String playlist)
Note: setPlaylistFile() is deprecated. Use setPlaylistFilename instead.

Set the file name of the playlist file.

Parameters:
playlist - Name of the playlist file.
See Also:
setPlaylistFilename
· propertyLoad
 public void propertyLoad(Properties p,
                          String name) throws IllegalArgumentException
· loadTest
 public static Test loadTest(String configFilename) throws Exception
Note: loadTest() is deprecated. use TestHelp.loadTest methods instead.

· loadTest
 public static Test loadTest(String configFilename,
                             String name) throws Exception
Note: loadTest() is deprecated. use TestHelp.loadTest methods instead.


All Packages  Class Hierarchy  This Package  Previous  Next  Index