1.3.6. Response Processing¶
1.3.6.1. Generalized Response Processing¶
- class pyslet.qtiv2.processing.ResponseProcessing(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
Response processing is the process by which the Delivery Engine assigns outcomes based on the candidate’s responses:
<xsd:attributeGroup name="responseProcessing.AttrGroup"> <xsd:attribute name="template" type="uri.Type" use="optional"/> <xsd:attribute name="templateLocation" type="uri.Type" use="optional"/> </xsd:attributeGroup> <xsd:group name="responseProcessing.ContentGroup"> <xsd:sequence> <xsd:group ref="responseRule.ElementGroup" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group>
- Run(state)¶
Runs response processing using the values in state.
- state is an ItemSessionState instance.
- class pyslet.qtiv2.processing.ResponseRule(parent, name=None)¶
Bases: pyslet.qtiv2.core.QTIElement
Abstract class to represent all response rules.
- Run(state)¶
Abstract method to run this rule using the values in state.
- class pyslet.qtiv2.processing.ResponseCondition(parent)¶
Bases: pyslet.qtiv2.processing.ResponseRule
If the expression given in a responseIf or responseElseIf evaluates to true then the sub-rules contained within it are followed and any following responseElseIf or responseElse parts are ignored for this response condition:
<xsd:group name="responseCondition.ContentGroup"> <xsd:sequence> <xsd:element ref="responseIf" minOccurs="1" maxOccurs="1"/> <xsd:element ref="responseElseIf" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="responseElse" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.ResponseIf(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
A responseIf part consists of an expression which must have an effective baseType of boolean and single cardinality. If the expression is true then the sub-rules are processed, otherwise they are skipped (including if the expression is NULL):
<xsd:group name="responseIf.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> <xsd:group ref="responseRule.ElementGroup" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group>
- Run(state)¶
Run this test and, if True, any resulting rules.
Returns True if the condition evaluated to True.
- class pyslet.qtiv2.processing.ResponseElseIf(parent)¶
Bases: pyslet.qtiv2.processing.ResponseIf
Represents the responseElse element, see ResponseIf
<xsd:group name="responseElseIf.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> <xsd:group ref="responseRule.ElementGroup" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.ResponseElse(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
Represents the responseElse element, see ResponseCondition
<xsd:group name="responseElse.ContentGroup"> <xsd:sequence> <xsd:group ref="responseRule.ElementGroup" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group>
- Run(state)¶
Runs the sub-rules.
- class pyslet.qtiv2.processing.SetOutcomeValue(parent)¶
Bases: pyslet.qtiv2.processing.ResponseRule
The setOutcomeValue rule sets the value of an outcome variable to the value obtained from the associated expression:
<xsd:attributeGroup name="setOutcomeValue.AttrGroup"> <xsd:attribute name="identifier" type="identifier.Type" use="required"/> </xsd:attributeGroup> <xsd:group name="setOutcomeValue.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.StopProcessing¶
Bases: pyslet.qtiv2.core.QTIError
Raised when a rule which stops processing is encountered.
- class pyslet.qtiv2.processing.ExitResponse(parent, name=None)¶
Bases: pyslet.qtiv2.processing.ResponseRule
The exit response rule terminates response processing immediately (for this invocation). It does this by raising StopProcessing:
<xsd:complexType name="exitResponse.Type"/>
1.3.7. Template Processing¶
- class pyslet.qtiv2.processing.TemplateProcessing(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
Template processing consists of one or more templateRules that are followed by the cloning engine or delivery system in order to assign values to the template variables:
<xsd:group name="templateProcessing.ContentGroup"> <xsd:sequence> <xsd:group ref="templateRule.ElementGroup" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group> <xsd:complexType name="templateProcessing.Type" mixed="false"> <xsd:group ref="templateProcessing.ContentGroup"/> </xsd:complexType>
- Run(state)¶
Runs template processing rules using the values in state.
- state is an ItemSessionState instance.
- class pyslet.qtiv2.processing.TemplateRule(parent, name=None)¶
Bases: pyslet.qtiv2.core.QTIElement
Abstract class to represent all template rules.
- Run(state)¶
Abstract method to run this rule using the values in state.
- class pyslet.qtiv2.processing.TemplateCondition(parent)¶
Bases: pyslet.qtiv2.processing.TemplateRule
If the expression given in the templateIf or templateElseIf evaluates to true then the sub-rules contained within it are followed and any following templateElseIf or templateElse parts are ignored for this template condition:
<xsd:group name="templateCondition.ContentGroup"> <xsd:sequence> <xsd:element ref="templateIf" minOccurs="1" maxOccurs="1"/> <xsd:element ref="templateElseIf" minOccurs="0" maxOccurs="unbounded"/> <xsd:element ref="templateElse" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.TemplateIf(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
A templateIf part consists of an expression which must have an effective baseType of boolean and single cardinality. If the expression is true then the sub-rules are processed, otherwise they are skipped (including if the expression is NULL):
<xsd:group name="templateIf.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> <xsd:group ref="templateRule.ElementGroup" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group>
- Run(state)¶
Run this test and, if True, any resulting rules.
Returns True if the condition evaluated to True.
- class pyslet.qtiv2.processing.TemplateElseIf(parent)¶
Bases: pyslet.qtiv2.processing.TemplateIf
Represents the templateElse element, see templateIf
<xsd:group name="templateElseIf.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> <xsd:group ref="templateRule.ElementGroup" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.TemplateElse(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
Represents the templateElse element, see TemplateCondition
<xsd:group name="templateElse.ContentGroup"> <xsd:sequence> <xsd:group ref="templateRule.ElementGroup" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:group>
- Run(state)¶
Runs the sub-rules.
- class pyslet.qtiv2.processing.SetTemplateValue(parent)¶
Bases: pyslet.qtiv2.processing.TemplateRule
The setTemplateValue rule sets the value of a template variable to the value obtained from the associated expression:
<xsd:attributeGroup name="setTemplateValue.AttrGroup"> <xsd:attribute name="identifier" type="identifier.Type" use="required"/> </xsd:attributeGroup> <xsd:group name="setTemplateValue.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.SetCorrectResponse(parent)¶
Bases: pyslet.qtiv2.processing.TemplateRule
The setCorrectResponse rule sets the correct value of a response variable to the value obtained from the associated expression:
<xsd:attributeGroup name="setCorrectResponse.AttrGroup"> <xsd:attribute name="identifier" type="identifier.Type" use="required"/> </xsd:attributeGroup> <xsd:group name="setCorrectResponse.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.SetDefaultValue(parent)¶
Bases: pyslet.qtiv2.processing.TemplateRule
The setDefaultValue rule sets the default value of a response or outcome variable to the value obtained from the associated expression:
<xsd:attributeGroup name="setDefaultValue.AttrGroup"> <xsd:attribute name="identifier" type="identifier.Type" use="required"/> </xsd:attributeGroup> <xsd:group name="setDefaultValue.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.ExitTemplate(parent, name=None)¶
Bases: pyslet.qtiv2.processing.TemplateRule
The exit template rule terminates template processing immediately. It does this by raising StopProcessing:
<xsd:complexType name="exitTemplate.Type"/>
1.3.8. Pre-conditions and Branching¶
- class pyslet.qtiv2.processing.TestPartCondition(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
- Evaluate(state)¶
Evaluates the condition using the values in state.
- state is a TestSessionState instance.
- class pyslet.qtiv2.processing.PreCondition(parent)¶
Bases: pyslet.qtiv2.processing.TestPartCondition
A preCondition is a simple expression attached to an assessmentSection or assessmentItemRef that must evaluate to true if the item is to be presented:
<xsd:group name="preCondition.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.BranchRule(parent)¶
Bases: pyslet.qtiv2.processing.TestPartCondition
A branch-rule is a simple expression attached to an assessmentItemRef, assessmentSection or testPart that is evaluated after the item, section, or part has been presented to the candidate:
<xsd:attributeGroup name="branchRule.AttrGroup"> <xsd:attribute name="target" type="identifier.Type" use="required"/> </xsd:attributeGroup> <xsd:group name="branchRule.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- class pyslet.qtiv2.processing.TemplateDefault(parent)¶
Bases: pyslet.qtiv2.core.QTIElement
Overrides the default value of a template variable based on the test context in which the template is instantiated:
<xsd:attributeGroup name="templateDefault.AttrGroup"> <xsd:attribute name="templateIdentifier" type="identifier.Type" use="required"/> </xsd:attributeGroup> <xsd:group name="templateDefault.ContentGroup"> <xsd:sequence> <xsd:group ref="expression.ElementGroup" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:group>
- Run(itemState, testState)¶
Updates the value of a template variable in itemState based on the values in testState.