exe
Class fibQuestion

java.lang.Object
  extended by exe.question
      extended by exe.fibQuestion
Direct Known Subclasses:
XMLfibQuestion

public class fibQuestion
extends question

This class extends question to provide support for fill-in-the-blank questions.

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

A fibQuestion 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 fibQuestion:

FIBQUESTION id

Question information for a fibQuestion:

FIBQUESTION id
The question text appears here.

ENDTEXT

ANSWER

Correct answer possibility 1 appears here.

Correct answer possibility 2 appears here.

. . .

Correct answer possibility n appears here.

ENDANSWER

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

Field Summary
protected  java.util.Vector<java.lang.String> correctAnswers
          Holds the possible correct answers to this question.
 
Fields inherited from class exe.question
id, mustBeAsked, out, questionText
 
Constructor Summary
fibQuestion(java.io.PrintWriter out, java.lang.String id)
          Constructs a new fibQuestion 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(java.lang.String answer)
          Sets one of the possible correct answers for this fibQuestion.
 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

correctAnswers

protected java.util.Vector<java.lang.String> correctAnswers
Holds the possible correct answers to this question. The correct answer choices are stored as String objects and are compared to the text entered into the question window to determine if the user's answer is correct.

Constructor Detail

fibQuestion

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

Parameters:
out - Specifies the output stream to which this fibQuestion should perform its write operations.
id - Gives this fibQuestion 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(java.lang.String answer)
Sets one of the possible correct answers for this fibQuestion. This possible correct answer is added to the Vector of correct answers. When the user enters an answer, the text will be compared with all the possible correct answers in the list to determine if the user's answer is correct.

Parameters:
answer - Specifies the text of one of the possible correct answers to the fibQuestion. Note that this String must be identical to the answer that the user is required to enter into the question window's text field.

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