(Set | Add | Subtract | Multiply | Divide ) 'Set' Defines constants for the above action types. Usage example:: Action.Add Note that:: Action.DEFAULT == Action.Set For more methods see :py:class:`~pyslet.xsdatatypes20041028.Enumeration`""" decode = {'Set': 1, 'Add': 2, 'Subtract': 3, 'Multiply': 4, 'Divide': 5} xsi.MakeEnumeration(Action) class Area(xsi.Enumeration): """Area enumeration:: (Ellipse | Rectangle | Bounded ) 'Ellipse' Defines constants for the above area types. Usage example:: Area.Rectangle Note that:: Area.DEFAULT == Area.Ellipse
</xsd:restriction> </xsd:simpleType> Defines constants for the above modes. Usage example:: NavigationMode.linear Note that:: NavigationMode.DEFAULT == None For more methods see :py:class:`~pyslet.xsdatatypes20041028.Enumeration`""" decode = {'linear': 1, 'nonlinear': 2} xsi.MakeEnumeration(NavigationMode) class SubmissionMode(xsi.Enumeration): """The submission mode determines when the candidate's responses are submitted for response processing. A testPart in individual mode requires the candidate to submit their responses on an item-by-item basis. In simultaneous mode the candidate's responses are all submitted together at the end of the testPart:: <xsd:simpleType name="submissionMode.Type"> <xsd:restriction base="xsd:NMTOKEN"> <xsd:enumeration value="individual"/> <xsd:enumeration value="simultaneous"/> </xsd:restriction> </xsd:simpleType>
def FormatTrueFalseEnum(value): if value: return "TRUE" elif value is not None: return "FALSE" else: return None class QMLAlignEnum: decode = {'Left': 1, 'Right': 2, 'Top': 3, 'Bottom': 4, 'Middle': 5} xsi.MakeEnumeration(QMLAlignEnum) def ParseAlignEnum(value): """Decodes a shape value from a string. <xs:simpleType name="AlignEnum"> <xs:restriction base="xs:string"> <xs:enumeration value="Left"/> <xs:enumeration value="Right"/> <xs:enumeration value="Top"/> <xs:enumeration value="Bottom"/> <xs:enumeration value="Middle"/> </xs:restriction> </xs:simpleType> """
class TextType(xsi.Enumeration): """text type enumeration:: "text" | "html" | "xhtml" This enumeration is used for setting the :py:attr:`Text.type` attribute. Usage: TextType.text, TextType.html, TextType.xhtml""" decode = { 'text': 1, 'html': 2, 'xhtml': 3 } xsi.MakeEnumeration(TextType) class Text(AtomElement): """Base class for atomPlainTextConstruct and atomXHTMLTextConstruct.""" XMLATTR_type = ('type', TextType.DecodeLowerValue, TextType.EncodeValue) def __init__(self, parent): AtomElement.__init__(self, parent) self.type = TextType.text def SetValue(self, value, type=TextType.text): """Sets the value of the element. *type* must be a value from the :py:class:`TextType` enumeration
</xsd:restriction> </xsd:simpleType> Defines constants for the above orientations. Usage example:: Orientation.horizontal Note that:: Orientation.DEFAULT == None For more methods see :py:class:`~pyslet.xsdatatypes20041028.Enumeration`""" decode = {'horizontal': 1, 'vertical': 2} xsi.MakeEnumeration(Orientation) class Shape(xsi.Enumeration): """A value of a shape is always accompanied by coordinates and an associated image which provides a context for interpreting them:: <xsd:simpleType name="shape.Type"> <xsd:restriction base="xsd:NMTOKEN"> <xsd:enumeration value="circle"/> <xsd:enumeration value="default"/> <xsd:enumeration value="ellipse"/> <xsd:enumeration value="poly"/> <xsd:enumeration value="rect"/> </xsd:restriction> </xsd:simpleType>
</xsd:restriction> </xsd:simpleType> Defines constants for the above formats. Usage example:: TextFormat.plain Note that:: TextFormat.DEFAULT == TextFormat.plain For more methods see :py:class:`~pyslet.xsdatatypes20041028.Enumeration`""" decode = {'plain': 1, 'preFormatted': 2, 'xhtml': 3} xsi.MakeEnumeration(TextFormat, 'plain') xsi.MakeLowerAliases(TextFormat) class ExtendedTextInteraction(StringInteractionMixin, BlockInteraction): """An extended text interaction is a blockInteraction that allows the candidate to enter an extended amount of text:: <xsd:attributeGroup name="extendedTextInteraction.AttrGroup"> <xsd:attributeGroup ref="blockInteraction.AttrGroup"/> <xsd:attributeGroup ref="stringInteraction.AttrGroup"/> <xsd:attribute name="maxStrings" type="integer.Type" use="optional"/> <xsd:attribute name="minStrings" type="integer.Type" use="optional"/> <xsd:attribute name="expectedLines" type="integer.Type" use="optional"/> <xsd:attribute name="format" type="textFormat.Type" use="optional"/> </xsd:attributeGroup>"""