exe
Class XMLmsQuestion

java.lang.Object
  extended by exe.question
      extended by exe.msQuestion
          extended by exe.XMLmsQuestion

public class XMLmsQuestion
extends msQuestion

This class allows multiple-selection questions to be displayed along with GAIGS snapshots. It inherits the functionality of the msQuestion class but outputs its information in the new GAIGS XML format.

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

An XMLmsQuestion 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 an XMLmsQuestion:

<question_ref ref = "id"/>

Question information for an XMLmsQuestion:

<question type = "MSQUESTION" id = "id">
  <question_text>The question text appears here. </question_text>

  <answer_option is_correct = "yes">Correct answer choice 1 appears here. </answer_option>

  <answer_option is_correct = "no">Incorrect answer choice 1 appears here. </answer_option>

  <answer_option is_correct = "yes">Correct answer choice 2 appears here. </answer_option>

  <answer_option is_correct = "no">Incorrect answer choice 2 appears here. </answer_option>

  . . .

  <answer_option is_correct = "no">Incorrect answer choice n appears here. </answer_option>

<question>

Author:
Andrew Jungwirth

Field Summary
 
Fields inherited from class exe.msQuestion
choices, correctChoices
 
Fields inherited from class exe.question
id, mustBeAsked, out, questionText
 
Constructor Summary
XMLmsQuestion(java.io.PrintWriter out, java.lang.String id)
          Constructs a new XMLmsQuestion object that is distinguished by id and outputs its information to out.
 
Method Summary
 void insertQuestion()
          Inserts the GAIGS XML <question_ref> tag for this XMLmsQuestion at the current position in the specified PrintWriter output stream.
 void writeQuestionInfo()
          Writes this XMLmsQuestion's information at the current position in the specified PrintWriter output stream using the GAIGS XML format.
 
Methods inherited from class exe.msQuestion
addChoice, animalInsertQuestion, animalWriteQuestionInfo, setAnswer, setAnswer, shuffle
 
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
 

Constructor Detail

XMLmsQuestion

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

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

insertQuestion

public void insertQuestion()
Inserts the GAIGS XML <question_ref> tag for this XMLmsQuestion at the current position in the specified PrintWriter output stream.

Overrides:
insertQuestion in class msQuestion

writeQuestionInfo

public void writeQuestionInfo()
Writes this XMLmsQuestion's information at the current position in the specified PrintWriter output stream using the GAIGS XML format.

This method is called by the XMLquestionCollection's writeQuestionsAtEOSF() method and likely will never have to be invoked explicitly.

Overrides:
writeQuestionInfo in class msQuestion