|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcox.jmatt.java.MathTools.test.MTFI
public class MTFI
This class provides a Math Test Formatting Item or MTFI. At its most basic level a MTFI is a bit of text placed on a test. The 'Format Item' comes
from the purpose for which the 'bit of text' is used. MTFI provides five distinct types of items all explained in the FIType enum
.
Briefly, the item types are:
All of the items except PAGE_BREAK have content associated with them. For GRAPH_MARK it is assumed to be a short identifier for what graph should appear. The 'TEXT_' elements contain text content intended to appear on the actual test, or answer key in the case of TEXT_NOTE.
This documentation is provided primarily for element explanation and embedding. There should be no need to instantiate this class directly:
MTest
handles it automatically.
Nested Class Summary | |
---|---|
static class |
MTFI.FIType
The Format Item Type enum provides the valid types a MTFI can be. |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_GLOBAL_FORMAT
Default 'entire' format for all MTFI types: '<0:gt;<1> <2>'. |
Constructor Summary | |
---|---|
MTFI(MTFI.FIType pType,
java.lang.String pContent)
This is the only public constructor; a type is ABSOLUTELY required, even though content may be optional. |
Method Summary | |
---|---|
MTFI |
copyOf()
Create a copy of this element. |
java.lang.String |
format()
Format using the internal template. |
java.lang.String |
format(java.lang.String pTemplate)
This class' raison-d'etre. |
java.lang.String |
formatAnswer()
Call format() when printing answers. |
java.lang.String |
formatProblem()
Call format() when appropriate. |
static MTFI |
newInstance(java.lang.String pType,
java.lang.String pContent)
This method is used by MTXProcessor to re-create format items from MathTools XML markup. |
static void |
setEscapeXML(boolean yesNo)
This class maintains a global XML escape flag. |
static void |
setFormat(java.lang.String pFormat)
Set the 'entire MTFI' format, analogous to the 'entire Question' format. |
static void |
setShowID(boolean yesNo)
Set to 'true' to show MTFI type in replacement token 0 when formatting. |
java.lang.String |
toXML()
Print an XML representation of this format itme. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_GLOBAL_FORMAT
Constructor Detail |
---|
public MTFI(MTFI.FIType pType, java.lang.String pContent)
Method Detail |
---|
public static void setEscapeXML(boolean yesNo)
public static void setFormat(java.lang.String pFormat)
public static void setShowID(boolean yesNo)
MTFI
type in replacement token 0 when formatting. Defaults to false.
public static MTFI newInstance(java.lang.String pType, java.lang.String pContent)
MTXProcessor
to re-create format items from MathTools XML markup. If pType is not valid a TEXT_LINE with an error
message is created. Any errors are reported at Error level.
pType
- The type of MTFI to create.pContent
- The tag content, if needed.public java.lang.String format(java.lang.String pTemplate)
This class' raison-d'etre. All other format methods echo to this one. Even thogh MTFI doesn't have Problem and Answer parts per se, the content is
handled similarly and consistently with Question
's replacement tokens: <1> prints with the Problems and <2> prints with the
Answers. All other tokens are blank and this is handled automatically.
Default templates are supplied, they should be appropriate for most cases.
format
in interface MTestElement
pTemplate
- The template String for formatting.public java.lang.String format()
format
in interface MTestElement
public java.lang.String toXML()
toXML
in interface MTestElement
public java.lang.String formatProblem()
format()
when appropriate.
formatProblem
in interface MTestElement
public java.lang.String formatAnswer()
format()
when printing answers.
formatAnswer
in interface MTestElement
public MTFI copyOf()
copyOf
in interface MTestElement
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |