exe
Class tfQuestion

java.lang.Object
  extended by exe.question
      extended by exe.tfQuestion
Direct Known Subclasses:
XMLtfQuestion

public class tfQuestion
extends question

This class extends question to provide support for true-false questions.

In order to use tfQuestion or any of question's other derived classes in a script-producing program, the script-producing program must import the package exe.

A tfQuestion is added to a showfile by placing a question reference at the end of the snapshot in which the question is to appear and then by appending the question information to the question section at the end of the file.

Question reference for a tfQuestion:

TFQUESTION id

Question information for a tfQuestion:

TFQUESTION id
The question text appears here.

ENDTEXT

ANSWER

T (if the answer is true) or F (if the answer is false).

ENDANSWER

Author:
? (original author), Ben Tidman (original comments), Andrew Jungwirth (editing and Javadoc comments)

Field Summary
protected  boolean correctAnswer
          Stores the correct answer to this tfQuestion.
 
Fields inherited from class exe.question
id, mustBeAsked, out, questionText
 
Constructor Summary
tfQuestion(java.io.PrintWriter out, java.lang.String id)
          Constructs a new tfQuestion object that is distinguished by id and outputs its information to out.
 
Method Summary
 void animalInsertQuestion()
          Writes a reference to this question at the current position in the specified PrintWriter output stream using the ANIMAL question reference format.
 void animalWriteQuestionInfo()
          Writes this question's information at the current position in the specified PrintWriter output stream using the ANIMAL question format.
 void insertQuestion()
          Writes a reference to this question at the current position in the specified PrintWriter output stream using the GAIGS question reference format.
 void setAnswer(boolean answer)
          Sets the correct answer to this tfQuestion.
 void writeQuestionInfo()
          Writes this question's information at the current position in the specified PrintWriter output stream using the GAIGS question format.
 
Methods inherited from class exe.question
getID, setMustBeAsked, setQuestionText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

correctAnswer

protected boolean correctAnswer
Stores the correct answer to this tfQuestion.

Constructor Detail

tfQuestion

public tfQuestion(java.io.PrintWriter out,
                  java.lang.String id)
Constructs a new tfQuestion object that is distinguished by id and outputs its information to out.

Parameters:
out - Specifies the output stream to which this tfQuestion should perform its write operations.
id - Gives this tfQuestion a String that can be used to uniquely identify it from other question objects in a collection.
Method Detail

insertQuestion

public void insertQuestion()
Description copied from class: question
Writes a reference to this question at the current position in the specified PrintWriter output stream using the GAIGS question reference format.

Specified by:
insertQuestion in class question

animalInsertQuestion

public void animalInsertQuestion()
Description copied from class: question
Writes a reference to this question at the current position in the specified PrintWriter output stream using the ANIMAL question reference format.

Specified by:
animalInsertQuestion in class question

setAnswer

public void setAnswer(boolean answer)
Sets the correct answer to this tfQuestion.

Parameters:
answer - Specifies the answer to this tfQuestion. A value of true sets the answer to T, and a value of false sets the answer to F.

writeQuestionInfo

public void writeQuestionInfo()
Description copied from class: question
Writes this question's information at the current position in the specified PrintWriter output stream using the GAIGS question format.

Specified by:
writeQuestionInfo in class question

animalWriteQuestionInfo

public void animalWriteQuestionInfo()
Description copied from class: question
Writes this question's information at the current position in the specified PrintWriter output stream using the ANIMAL question format.

Specified by:
animalWriteQuestionInfo in class question