All Packages Class Hierarchy This Package Previous Next Index
Class guinea.logic.SessionSubject
java.lang.Object
|
+----guinea.logic.SessionSubject
- public class SessionSubject
- extends Object
- implements ControlListener, AnswerListener, SubjectUIListener
Variable Index
- ·
active
- Is this session subject active?
- ·
answers
- The answers given by this subject for the current test item.
- ·
currentItem
- The subject's own copy of the current test item.
- ·
doneTime
- The ending time of testing the current item.
- ·
group
- The subject group this subject belongs to.
- ·
ITEM_DONE
- The subject has finished grading this item and pressed the
'Done'-button on the UI panel.
- ·
ITEM_IDLE
-
- ·
ITEM_RUNNING
- The subject is currently testing the current item.
- ·
ITEM_TIMED_OUT
- The time limit for grading this item has expored.
- ·
itemStatus
- The test/item status of this subject.
- ·
requiredAnswers
- A list of questions (question IDs) whose answers are required
before can proceed to next item.
- ·
sessionID
- The session ID of the current session.
- ·
subjectID
- The subject ID of this subject.
- ·
test
- The test that is being tested by the subject.
- ·
TEST_ABORTED
- The subject has aborted the session.
- ·
TEST_FINISHED
- The subject has finished testing all items.
- ·
ui
- The subject UI panel of this subject.
- ·
warn
-
Constructor Index
- ·
SessionSubject()
- Create a new session subject.
- ·
SessionSubject(SubjectUI)
- Create a new session subject.
- ·
SessionSubject(Test, SubjectUI)
- Create a new session subject.
Method Index
- ·
abortTest(ControlEvent)
-
- ·
answerGiven(AnswerEvent)
-
- ·
controlPerformed(ControlEvent)
-
- ·
doneItem(ControlEvent)
-
- ·
getAnswer(String)
- Get answer given for this item from current answers table.
- ·
getControl(String)
-
- ·
getControlValue(String)
- Get the control value of the controller.
- ·
getCurrentItem()
- Get current test item.
- ·
getDoneTime()
-
- ·
getItemStatus()
-
- ·
getParameter(String)
- Get value of an item parameter.
- ·
getParameter(String, Object)
- Get value of an item parameter.
- ·
getQuestion(String)
-
- ·
getSessionID()
-
- ·
getSessionSubjectGroup()
-
- ·
getSubjectID()
-
- ·
getSubjectUI()
-
- ·
getTest()
-
- ·
gotoItem(ControlEvent)
-
- ·
hasAllAnswers()
- Have all required answers been answered.
- ·
hasSubjectUI()
-
- ·
hasTest()
-
- ·
isActive()
-
- ·
nextItem(ControlEvent)
-
- ·
pauseTest(ControlEvent)
-
- ·
prevItem(ControlEvent)
-
- ·
removeCurrentItem()
- Remove current item.
- ·
removeSubjectUI()
-
- ·
resetSubj()
-
- ·
resetSubjectUI()
-
- ·
resetTimeout()
- Reset the indicator to default (inactive) state.
- ·
setActive(boolean)
-
- ·
setAnswer(String, Object)
- Set answer given by subject for a question in answers table.
- ·
setControlsEnabled(boolean)
- Enable or disable all control components.
- ·
setControlValue(String, Object)
- Set the (initial) control value of the controller.
- ·
setCurrentItem(Item)
- Set current item for this session subject.
- ·
setDoneEnabled(boolean)
- Enable or disable the DONE-button that the subject uses to
indicate that he/she has completed grading (or whatever) the
current test item.
- ·
setDoneTime(long)
-
- ·
setDoneTime(long, int)
-
- ·
setEnabled(boolean)
-
- ·
setItemAnswers()
- Save answers given during this item into subject's own copy
for storing.
- ·
setItemStatus(int)
-
- ·
setMonitorValue(String, Object)
- Set the value of the monitored variable.
- ·
setQuestionAnswer(String, Object)
-
- ·
setQuestionsEnabled(boolean)
- Enable or disable all question or answer components.
- ·
setSessionID(String)
-
- ·
setSessionSubjectGroup(SessionSubjectGroup)
-
- ·
setSubjectID(String)
-
- ·
setSubjectUI(SubjectUI)
-
- ·
setTest(Test)
-
- ·
setTimeoutTimes(int)
- Set the timeout time.
- ·
setTimeoutTimes(int, int)
- Set the timeout time and warning time of the indicator.
- ·
setTimeoutVisible(boolean)
- Set visibility of warning indicator.
- ·
startTimeoutWarning()
- Start the timeout warning and the countdown display.
- ·
toString()
- Returns a string representation of the object.
Variables
·
ui
protected SubjectUI ui
- The subject UI panel of this subject.
·
warn
protected WarningDisplayer warn
·
active
protected boolean active
- Is this session subject active?
·
ITEM_IDLE
public static final int ITEM_IDLE
·
ITEM_RUNNING
public static final int ITEM_RUNNING
- The subject is currently testing the current item.
·
ITEM_DONE
public static final int ITEM_DONE
- The subject has finished grading this item and pressed the
'Done'-button on the UI panel.
·
ITEM_TIMED_OUT
public static final int ITEM_TIMED_OUT
- The time limit for grading this item has expored.
·
TEST_ABORTED
public static final int TEST_ABORTED
- The subject has aborted the session.
·
TEST_FINISHED
public static final int TEST_FINISHED
- The subject has finished testing all items.
·
itemStatus
protected transient int itemStatus
- The test/item status of this subject.
·
answers
protected Hashtable answers
- The answers given by this subject for the current test item.
- See Also:
- setItemAnswers, getAnswer, setAnswer
·
subjectID
protected String subjectID
- The subject ID of this subject.
·
sessionID
protected String sessionID
- The session ID of the current session.
·
doneTime
protected long doneTime
- The ending time of testing the current item.
·
test
protected Test test
- The test that is being tested by the subject.
·
group
protected SessionSubjectGroup group
- The subject group this subject belongs to.
·
currentItem
protected Item currentItem
- The subject's own copy of the current test item. It is used
to store answers and other information about testing he
current item by this subject.
·
requiredAnswers
protected String requiredAnswers[]
- A list of questions (question IDs) whose answers are required
before can proceed to next item. If not set, all questions in
the subject's panel are required.
Constructors
·
SessionSubject
public SessionSubject()
- Create a new session subject.
·
SessionSubject
public SessionSubject(SubjectUI ui)
- Create a new session subject.
- Parameters:
- ui - The UI panel for this subject.
·
SessionSubject
public SessionSubject(Test test,
SubjectUI ui)
- Create a new session subject.
- Parameters:
- test - The test the subject is participating in.
- ui - The UI panel for this subject.
Methods
·
setTest
public void setTest(Test test)
·
getTest
public Test getTest()
·
hasTest
public boolean hasTest()
·
setSubjectUI
public void setSubjectUI(SubjectUI ui)
·
removeSubjectUI
public void removeSubjectUI()
·
getSubjectUI
public SubjectUI getSubjectUI()
·
hasSubjectUI
public boolean hasSubjectUI()
·
setSubjectID
public void setSubjectID(String id)
·
getSubjectID
public String getSubjectID()
·
setSessionID
public void setSessionID(String id)
·
getSessionID
public String getSessionID()
·
setDoneTime
public synchronized void setDoneTime(long time)
·
setDoneTime
public synchronized void setDoneTime(long time,
int status)
·
getDoneTime
public long getDoneTime()
·
getItemStatus
public int getItemStatus()
·
setItemStatus
public synchronized void setItemStatus(int status)
·
getSessionSubjectGroup
public SessionSubjectGroup getSessionSubjectGroup()
·
setSessionSubjectGroup
public synchronized void setSessionSubjectGroup(SessionSubjectGroup group)
·
setCurrentItem
public void setCurrentItem(Item item)
- Set current item for this session subject. Answers stored in
the item are copied to the local answers table.
- Parameters:
- item - A test item. If
null
, calls
removeCurrentItem() instead.
- See Also:
- answers
·
getCurrentItem
public Item getCurrentItem()
- Get current test item.
- Returns:
- The current test item or
null
if not
currently set.
·
removeCurrentItem
public Item removeCurrentItem()
- Remove current item. Also local answers table is removed.
- Returns:
- The removed current item. Maybe
null
if
there was no item set.
·
setAnswer
public Object setAnswer(String qid,
Object answer)
- Set answer given by subject for a question in answers table.
- Parameters:
- qid - Question ID.
- answer - The answer. A
null
removes answer
for this question.
- Returns:
- A previous answer given to this question or
null
if this question hasn't been answered
yet.
- See Also:
- answers
·
getAnswer
public Object getAnswer(String qid)
- Get answer given for this item from current answers table.
- Parameters:
- qid - Question ID.
- Returns:
- An answer that has been given to this question or
null
if no answer hasn't been given yet.
- See Also:
- answers
·
setItemAnswers
public void setItemAnswers()
- Save answers given during this item into subject's own copy
for storing.
·
hasAllAnswers
public boolean hasAllAnswers()
- Have all required answers been answered.
- Returns:
-
True
if all required answers have been
answered. Also, if there are no questions or questions that
require answers, true
is returned. Otherwise
false
is returned.
·
getParameter
public Object getParameter(String pname,
Object def)
- Get value of an item parameter. If subject's copy of current
item doesn't have a value for given parameter, the value is
looked for in the subject's group. If no value is found
there, a default is returned.
- Parameters:
- pname - Name of parameter whose value is wanted.
- def - Default value to use if no value is found in
subject's current item or in the group's.
- Returns:
- A value of parameter or, if no parameter value was
found, the value of the def argument.
·
getParameter
public Object getParameter(String pname)
- Get value of an item parameter. If subject's copy of current
item doesn't have a value for given parameter, the value is
looked for in the subject's group.
- Parameters:
- pname - Name of parameter whose value is wanted.
- Returns:
- A value of parameter or, if no parameter value was
found,
null
is returnd.
·
isActive
public boolean isActive()
·
setActive
public boolean setActive(boolean active)
·
getControl
public ControlInterface getControl(String name)
·
getQuestion
public QuestionInterface getQuestion(String name)
·
resetSubj
public synchronized void resetSubj()
·
controlPerformed
public void controlPerformed(ControlEvent e)
·
answerGiven
public void answerGiven(AnswerEvent e)
·
doneItem
public void doneItem(ControlEvent e)
·
nextItem
public void nextItem(ControlEvent e)
·
prevItem
public void prevItem(ControlEvent e)
·
gotoItem
public void gotoItem(ControlEvent e)
·
pauseTest
public void pauseTest(ControlEvent e)
·
abortTest
public void abortTest(ControlEvent e)
·
resetSubjectUI
public void resetSubjectUI()
·
setEnabled
public void setEnabled(boolean enable)
·
setQuestionsEnabled
public void setQuestionsEnabled(boolean enabled)
- Enable or disable all question or answer components.
·
setControlsEnabled
public void setControlsEnabled(boolean enabled)
- Enable or disable all control components.
·
setDoneEnabled
public void setDoneEnabled(boolean enabled)
- Enable or disable the DONE-button that the subject uses to
indicate that he/she has completed grading (or whatever) the
current test item.
·
setQuestionAnswer
public void setQuestionAnswer(String questionID,
Object answer)
·
setMonitorValue
public void setMonitorValue(String monitorID,
Object value)
- Set the value of the monitored variable.
- Parameters:
- monitorID - The ID of the monitor component.
- value - The value of the monitored variable.
·
setControlValue
public void setControlValue(String controlID,
Object value)
- Set the (initial) control value of the controller.
- Parameters:
- controlID - The ID of the controller component.
- value - The value of the controlled variable.
·
getControlValue
public Object getControlValue(String controlID)
- Get the control value of the controller.
- Parameters:
- controlID - The ID of the controller component.
- Returns:
- The value of the controlled variable.
·
setTimeoutVisible
public void setTimeoutVisible(boolean visible)
- Set visibility of warning indicator.
- Parameters:
- visble -
true
makes the indicator visible to
subject. When false, no indicator is shown.
·
setTimeoutTimes
public void setTimeoutTimes(int timeoutTime,
int warningTime)
- Set the timeout time and warning time of the indicator.
- Parameters:
- timeoutTime - How much time there is to answer before the
timeout expires. The timeout is in milliseconds.
- warningTime - When to show that time is about to run out.
It is the number of milliseconds before the timeout.
- See Also:
- startTimeoutWarning
·
setTimeoutTimes
public void setTimeoutTimes(int timeoutTime)
- Set the timeout time. No warning is shown before going
directly to timeout.
- Parameters:
- timeoutTime - How much time there is to answer before the
timeout expires. The timeout is in milliseconds.
·
startTimeoutWarning
public void startTimeoutWarning()
- Start the timeout warning and the countdown display.
·
resetTimeout
public void resetTimeout()
- Reset the indicator to default (inactive) state.
·
toString
public String toString()
- Returns a string representation of the object.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index