3.3.4. Interactions

class pyslet.qtiv2.interactions.Interaction(parent)

Bases: pyslet.qtiv2.content.BodyElement

Interactions allow the candidate to interact with the item. Through an interaction, the candidate selects or constructs a response:

<xsd:attributeGroup name="interaction.AttrGroup">
        <xsd:attributeGroup ref="bodyElement.AttrGroup"/>
        <xsd:attribute name="responseIdentifier" type="identifier.Type" use="required"/>
</xsd:attributeGroup>
class pyslet.qtiv2.interactions.InlineInteraction(parent)

Bases: pyslet.html40_19991224.InlineMixin, pyslet.qtiv2.interactions.Interaction

Abstract class for interactions that appear inline.

class pyslet.qtiv2.interactions.BlockInteraction(parent)

Bases: pyslet.html40_19991224.BlockMixin, pyslet.qtiv2.interactions.Interaction

An interaction that behaves like a block in the content model. Most interactions are of this type:

<xsd:group name="blockInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="prompt" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.Prompt(parent)

Bases: pyslet.qtiv2.content.BodyElement

The prompt used in block interactions

<xsd:group name="prompt.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="inlineStatic.ElementGroup" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.Choice(parent)

Bases: pyslet.qtiv2.content.BodyElement

Many of the interactions involve choosing one or more predefined choices

<xsd:attributeGroup name="choice.AttrGroup">
        <xsd:attributeGroup ref="bodyElement.AttrGroup"/>
        <xsd:attribute name="identifier" type="identifier.Type" use="required"/>
        <xsd:attribute name="fixed" type="boolean.Type" use="optional"/>
        <xsd:attribute name="templateIdentifier" type="identifier.Type" use="optional"/>
        <xsd:attribute name="showHide" type="showHide.Type" use="optional"/>
</xsd:attributeGroup>
class pyslet.qtiv2.interactions.AssociableChoice(parent)

Bases: pyslet.qtiv2.interactions.Choice

Other interactions involve associating pairs of predefined choices

<xsd:attributeGroup name="associableChoice.AttrGroup">
        <xsd:attributeGroup ref="choice.AttrGroup"/>
        <xsd:attribute name="matchGroup" use="optional">
                <xsd:simpleType>
                        <xsd:list itemType="identifier.Type"/>
                </xsd:simpleType>
        </xsd:attribute>
</xsd:attributeGroup>

3.3.4.1. Simple Interactions

class pyslet.qtiv2.interactions.ChoiceInteraction(parent)

Bases: pyslet.qtiv2.interactions.BlockInteraction

The choice interaction presents a set of choices to the candidate. The candidate’s task is to select one or more of the choices, up to a maximum of maxChoices:

<xsd:attributeGroup name="choiceInteraction.AttrGroup">
        <xsd:attributeGroup ref="blockInteraction.AttrGroup"/>
        <xsd:attribute name="shuffle" type="boolean.Type" use="required"/>
        <xsd:attribute name="maxChoices" type="integer.Type" use="required"/>
        <xsd:attribute name="minChoices" type="integer.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="choiceInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="blockInteraction.ContentGroup"/>
                <xsd:element ref="simpleChoice" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.OrderInteraction(parent)

Bases: pyslet.qtiv2.interactions.BlockInteraction

In an order interaction the candidate’s task is to reorder the choices, the order in which the choices are displayed initially is significant:

<xsd:attributeGroup name="orderInteraction.AttrGroup">
        <xsd:attributeGroup ref="blockInteraction.AttrGroup"/>
        <xsd:attribute name="shuffle" type="boolean.Type" use="required"/>
        <xsd:attribute name="minChoices" type="integer.Type" use="optional"/>
        <xsd:attribute name="maxChoices" type="integer.Type" use="optional"/>
        <xsd:attribute name="orientation" type="orientation.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="orderInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="blockInteraction.ContentGroup"/>
                <xsd:element ref="simpleChoice" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.SimpleChoice(parent)

Bases: pyslet.qtiv2.content.FlowContainerMixin, pyslet.qtiv2.interactions.Choice

A SimpleChoice is a choice that contains flow objects; it must not contain any nested interactions:

<xsd:group name="simpleChoice.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="flowStatic.ElementGroup" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.AssociateInteraction(parent)

Bases: pyslet.qtiv2.interactions.BlockInteraction

An associate interaction is a blockInteraction that presents candidates with a number of choices and allows them to create associations between them:

<xsd:attributeGroup name="associateInteraction.AttrGroup">
        <xsd:attributeGroup ref="blockInteraction.AttrGroup"/>
        <xsd:attribute name="shuffle" type="boolean.Type" use="required"/>
        <xsd:attribute name="maxAssociations" type="integer.Type" use="required"/>
        <xsd:attribute name="minAssociations" type="integer.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="associateInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="blockInteraction.ContentGroup"/>
                <xsd:element ref="simpleAssociableChoice" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.MatchInteraction(parent)

Bases: pyslet.qtiv2.interactions.BlockInteraction

A match interaction is a blockInteraction that presents candidates with two sets of choices and allows them to create associates between pairs of choices in the two sets, but not between pairs of choices in the same set:

<xsd:attributeGroup name="matchInteraction.AttrGroup">
        <xsd:attributeGroup ref="blockInteraction.AttrGroup"/>
        <xsd:attribute name="shuffle" type="boolean.Type" use="required"/>
        <xsd:attribute name="maxAssociations" type="integer.Type" use="required"/>
        <xsd:attribute name="minAssociations" type="integer.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="matchInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="blockInteraction.ContentGroup"/>
                <xsd:element ref="simpleMatchSet" minOccurs="2" maxOccurs="2"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.SimpleAssociableChoice(parent)

Bases: pyslet.qtiv2.content.FlowContainerMixin, pyslet.qtiv2.interactions.AssociableChoice

associableChoice is a choice that contains flowStatic objects, it must not contain nested interactions:

<xsd:attributeGroup name="simpleAssociableChoice.AttrGroup">
        <xsd:attributeGroup ref="associableChoice.AttrGroup"/>
        <xsd:attribute name="matchMax" type="integer.Type" use="required"/>
        <xsd:attribute name="matchMin" type="integer.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="simpleAssociableChoice.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="flowStatic.ElementGroup" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.SimpleMatchSet(parent)

Bases: pyslet.qtiv2.core.QTIElement

Contains an ordered set of choices for the set

<xsd:group name="simpleMatchSet.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="simpleAssociableChoice" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.GapMatchInteraction(parent)

Bases: pyslet.qtiv2.interactions.BlockInteraction

A gap match interaction is a blockInteraction that contains a number gaps that the candidate can fill from an associated set of choices:

<xsd:attributeGroup name="gapMatchInteraction.AttrGroup">
        <xsd:attributeGroup ref="blockInteraction.AttrGroup"/>
        <xsd:attribute name="shuffle" type="boolean.Type" use="required"/>
</xsd:attributeGroup>

<xsd:group name="gapMatchInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="blockInteraction.ContentGroup"/>
                <xsd:group ref="gapChoice.ElementGroup" minOccurs="1" maxOccurs="unbounded"/>
                <xsd:group ref="blockStatic.ElementGroup" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.Gap(parent)

Bases: pyslet.html40_19991224.InlineMixin, pyslet.qtiv2.interactions.AssociableChoice

A gap is an inline element that must only appear within a gapMatchInteraction

<xsd:attributeGroup name="gap.AttrGroup">
        <xsd:attributeGroup ref="associableChoice.AttrGroup"/>
        <xsd:attribute name="required" type="boolean.Type" use="optional"/>
</xsd:attributeGroup>
class pyslet.qtiv2.interactions.GapChoice(parent)

Bases: pyslet.qtiv2.interactions.AssociableChoice

The choices that are used to fill the gaps in a gapMatchInteraction are either simple runs of text or single image objects, both derived from gapChoice:

<xsd:attributeGroup name="gapChoice.AttrGroup">
        <xsd:attributeGroup ref="associableChoice.AttrGroup"/>
        <xsd:attribute name="matchMax" type="integer.Type" use="required"/>
        <xsd:attribute name="matchMin" type="integer.Type" use="optional"/>
</xsd:attributeGroup>
class pyslet.qtiv2.interactions.GapText(parent)

Bases: pyslet.qtiv2.interactions.GapChoice

A simple run of text to be inserted into a gap by the user, may be subject to variable value substitution with printedVariable:

<xsd:group name="gapText.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="printedVariable" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.GapImg(parent)

Bases: pyslet.qtiv2.interactions.GapChoice

A gap image contains a single image object to be inserted into a gap by the candidate:

<xsd:attributeGroup name="gapImg.AttrGroup">
        <xsd:attributeGroup ref="gapChoice.AttrGroup"/>
        <xsd:attribute name="objectLabel" type="string.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="gapImg.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="object" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
</xsd:group>

3.3.4.2. Text-based Interactions

class pyslet.qtiv2.interactions.InlineChoiceInteraction(parent)

Bases: pyslet.qtiv2.interactions.InlineInteraction

An inline choice is an inlineInteraction that presents the user with a set of choices, each of which is a simple piece of text:

<xsd:attributeGroup name="inlineChoiceInteraction.AttrGroup">
        <xsd:attributeGroup ref="inlineInteraction.AttrGroup"/>
        <xsd:attribute name="shuffle" type="boolean.Type" use="required"/>
        <xsd:attribute name="required" type="boolean.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="inlineChoiceInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="inlineChoice" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.InlineChoice(parent)

Bases: pyslet.qtiv2.interactions.Choice

A simple run of text to be displayed to the user, may be subject to variable value substitution with printedVariable:

<xsd:group name="inlineChoice.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="printedVariable" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.StringInteractionMixin

Abstract mix-in class for interactions based on free-text input. String interactions can be bound to numeric response variables, instead of strings, if desired:

<xsd:attributeGroup name="stringInteraction.AttrGroup">
        <xsd:attribute name="base" type="integer.Type" use="optional"/>
        <xsd:attribute name="stringIdentifier" type="identifier.Type" use="optional"/>
        <xsd:attribute name="expectedLength" type="integer.Type" use="optional"/>
        <xsd:attribute name="patternMask" type="string.Type" use="optional"/>
        <xsd:attribute name="placeholderText" type="string.Type" use="optional"/>
</xsd:attributeGroup>
class pyslet.qtiv2.interactions.TextEntryInteraction(parent)

Bases: pyslet.qtiv2.interactions.StringInteractionMixin, pyslet.qtiv2.interactions.InlineInteraction

A textEntry interaction is an inlineInteraction that obtains a simple piece of text from the candidate.

class pyslet.qtiv2.interactions.TextFormat

Bases: pyslet.xsdatatypes20041028.Enumeration

Used to control the format of the text entered by the candidate:

<xsd:simpleType name="textFormat.Type">
        <xsd:restriction base="xsd:NMTOKEN">
                <xsd:enumeration value="plain"/>
                <xsd:enumeration value="preFormatted"/>
                <xsd:enumeration value="xhtml"/>
        </xsd:restriction>
</xsd:simpleType>

Defines constants for the above formats. Usage example:

TextFormat.plain

Note that:

TextFormat.DEFAULT == TextFormat.plain

For more methods see Enumeration

class pyslet.qtiv2.interactions.ExtendedTextInteraction(parent)

Bases: pyslet.qtiv2.interactions.StringInteractionMixin, pyslet.qtiv2.interactions.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>
class pyslet.qtiv2.interactions.HottextInteraction(parent)

Bases: pyslet.qtiv2.interactions.BlockInteraction

The hottext interaction presents a set of choices to the candidate represented as selectable runs of text embedded within a surrounding context, such as a simple passage of text:

<xsd:attributeGroup name="hottextInteraction.AttrGroup">
        <xsd:attributeGroup ref="blockInteraction.AttrGroup"/>
        <xsd:attribute name="maxChoices" type="integer.Type" use="required"/>
        <xsd:attribute name="minChoices" type="integer.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="hottextInteraction.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="blockInteraction.ContentGroup"/>
                <xsd:group ref="blockStatic.ElementGroup" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.Hottext(parent)

Bases: pyslet.html40_19991224.FlowMixin, pyslet.qtiv2.interactions.Choice

A hottext area is used within the content of an hottextInteraction to provide the individual choices:

<xsd:group name="hottext.ContentGroup">
        <xsd:sequence>
                <xsd:group ref="inlineStatic.ElementGroup" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
</xsd:group>

3.3.4.3. Graphical Interactions

class pyslet.qtiv2.interactions.GapImg(parent)

Bases: pyslet.qtiv2.interactions.GapChoice

A gap image contains a single image object to be inserted into a gap by the candidate:

<xsd:attributeGroup name="gapImg.AttrGroup">
        <xsd:attributeGroup ref="gapChoice.AttrGroup"/>
        <xsd:attribute name="objectLabel" type="string.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="gapImg.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="object" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.GapImg(parent)

Bases: pyslet.qtiv2.interactions.GapChoice

A gap image contains a single image object to be inserted into a gap by the candidate:

<xsd:attributeGroup name="gapImg.AttrGroup">
        <xsd:attributeGroup ref="gapChoice.AttrGroup"/>
        <xsd:attribute name="objectLabel" type="string.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="gapImg.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="object" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
</xsd:group>
class pyslet.qtiv2.interactions.GapImg(parent)

Bases: pyslet.qtiv2.interactions.GapChoice

A gap image contains a single image object to be inserted into a gap by the candidate:

<xsd:attributeGroup name="gapImg.AttrGroup">
        <xsd:attributeGroup ref="gapChoice.AttrGroup"/>
        <xsd:attribute name="objectLabel" type="string.Type" use="optional"/>
</xsd:attributeGroup>

<xsd:group name="gapImg.ContentGroup">
        <xsd:sequence>
                <xsd:element ref="object" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
</xsd:group>