ZedAI XForms QTI Example 3

From zedwiki

Jump to: navigation, search

Example 3

Image:Example3.jpg

XForms

<html xmlns="http://www.w3.org/2002/06/xhtml2/" 
  xmlns:xforms="http://www.w3.org/2002/xforms" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:ev="http://www.w3.org/2001/xml-events" 
  xmlns:my="SYSTEM">
  <head>
    <title>XHTML2 + XForms Example 02</title>
    <xforms:model>
      <xforms:instance>
        <my:worksheet>
          <my:questions>
            <my:q1>
              <my:part/>
            </my:q1>
          </my:questions>
        </my:worksheet>
      </xforms:instance>
      <!--Constraint to force both sections of question one to be entered.-->
      <xforms:bind nodeset="my:worksheet/my:questions/my:q1/my:part" 
        constraint="count(.) = 2"/>
      <xforms:submission action="page005.xml" method="put" ref="/my:worksheet" />
    </xforms:model>
  </head>
  <body>
    <h>Show Your Work Problem</h>
    <p>Solve the question and show your work.</p>
    <ol>
      <li>
        <xforms:group>
          <xforms:textarea ref="my:worksheet/my:questions/my:q1/my:part">
            <xforms:label>There are 5 people who want to eat 2 bananas. 
              How many bananas are needed?</xforms:label>
          </xforms:textarea>
          <xforms:input ref="my:worksheet/my:questions/my:q1/my:part">
            <xforms:label>If there are 17 bananas, how many would be 
              left over?</xforms:label>
          </xforms:input>
        </xforms:group>
      </li>
    </ol>
  </body>
</html>

QTI

<html xmlns="http://www.w3.org/2002/06/xhtml2/" 
  xmlns:qti="http://www.imsglobal.org/xsd/imsqti_v2p0" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:ev="http://www.w3.org/2001/xml-events" 
  xmlns:my="SYSTEM">
  <head>
    <title>XHTML2 + QTI Example 02</title>
  </head>
  <body>
    <h>Show Your Work Problem</h>
    <p>Solve the question and show your work.</p>
    <ol>
      <li>
        <qti:assessmentItem identifier="textEntry" title="Question 1" adaptive="false" 
          timeDependent="false">
          <qti:responseDeclaration identifier="q1part1" cardinality="single"/>
          <qti:responseDeclaration identifier="q1part2" cardinality="single"/>
          <qti:itemBody>
            <qti:p>There are 5 people who want to eat 2 bananas. How many bananas 
              are needed?</qti:p>
            <qti:extendedTextInteraction responseIdentifier="q1part1"/>
            <qti:p>If there are 17 bananas, how many would be left over? 
              <qti:textEntryInteraction responseIdentifier="q1part2"/>
            </qti:p>
          </qti:itemBody>
        </qti:assessmentItem>
      </li>
    </ol>
  </body>
</html>
Personal tools