Location: PHPKode > projects > Ps and Qs: Processing QTI using PHP > qti-eb/qtifiles/mchc_ir_102.xml
<?xml version = "1.0" encoding = "UTF-8" standalone = "no"?>
<!DOCTYPE questestinterop SYSTEM "file:///User/qtiexamples/ims_qtiasiv1p2.dtd">

<!-- Author:	Paul Roberts     			   							-->

<!-- Date:		12th October, 2001     									-->

<!-- Version 1.2 Compliant Example: BasicExampleQMK 					-->

<!-- Amended by Paul Roberts to conform to current DTD 25th Jan 2000 	-->
<questestinterop>
	<item title = "Reading Passage with multiple choices" ident = "QTIRead3" label = "Reading3Item">
		<qticomment>  This is a classic reading comprehension "Testlet" consisting of a
  reading passage followed by 3 questions.
  Using the QTI specs, this could either be implemented as an item with
  three responses or a section with three items which reference common
  material.  We take the former approach.
  Thanks to Eric Shepard of Question Mark for supplying the original 
  passage used in this item.
  
		</qticomment>
		<itemrubric view = "Candidate">
			<material>
				<mattext>Read the passage and then follow the instructions for the </mattext>
				<!-- Break the next out as a separate label material for  -->
				
				<!-- automatic processing tools.  -->
				<mattext label = "QuestionCount">3</mattext>
				<mattext> questions below.</mattext>
			</material>
		</itemrubric>
		<presentation>
			<material label = "Passage">
				<!-- I'm replacing all of the quotes with &quot; within the HTML -->
				
				<!-- so that it colors correctly in my editor.  I'm also -->
				
				<!-- replacing <BR> tags with </BR> so it is well formed HTML.-->
				<mattext texttype = "text/html"><![CDATA[
          &quot;We're studying the four main food groups at
	  school,&quot; Maria said to her father on
	  Wednesday. &nbsp;&quot;And I'm supposed to 
	  do a project. &nbsp;I know I always buy my lunch at
	  school. &nbsp;But I want to take my lunch to school every
	  day next week, and have one food from each of the four main
	  food groups as part of my lunch.&quot; <BR/>
					<br/>&quot;That's a great idea!&quot; said Maria's
	  father. &nbsp;&quot;You can go to the grocery store with me
	  on Friday and we'll get everything you'll need.&quot; <br/>
					<br/>The next afternoon, Maria sat down at the kitchen table
	  and planned her lunch menu for each day of the next
	  week. &nbsp;&quot;You should just take a]]></mattext>
				<!-- This is given a label to link it as a hotspot. -->
				<mattext texttype = "text/html" label = "PBRef">peanut butter</mattext>
				<mattext texttype = "text/html"> and </mattext>
				<mattext texttype = "text/html" label = "BananaRef">banana </mattext>
				<mattext texttype = "text/html" label = "SandwichRef">sandwich</mattext>
				<mattext texttype = "text/html"> every day, and some </mattext>
				<mattext texttype = "text/html" label = "MilkRef">milk?"</mattext>
				<mattext texttype = "text/html">said her younger brother,
        Juan. "The  
      
				</mattext>
				<!-- This is given a label to link it as a hotspot. -->
				<mattext texttype = "text/html" label = "BreadRef">bread</mattext>
				<mattext texttype = "text/html"> would count for the </mattext>
				<mattext texttype = "text/html" label = "GrainRef">grain</mattext>
				<mattext texttype = "text/html"> group, the </mattext>
				<mattext texttype = "text/html" label = "PBRef">peanut butter</mattext>
				<mattext texttype = "text/html"> for the </mattext>
				<mattext texttype = "text/html" label = "ProteinRef">protein</mattext>
				<mattext texttype = "text/html"> group, the </mattext>
				<mattext texttype = "text/html" label = "BananaRef">banana</mattext>
				<mattext texttype = "text/html"> for the </mattext>
				<mattext texttype = "text/html" label = "FruitRef">fruit</mattext>
				<mattext texttype = "text/html"> and </mattext>
				<mattext texttype = "text/html" label = "VegetableRef">vegetable</mattext>
				<mattext texttype = "text/html"> group, and the </mattext>
				<mattext texttype = "text/html" label = "MilkRef">milk</mattext>
				<mattext texttype = "text/html"> would be for the </mattext>
				<mattext texttype = "text/html" label = "DairyRef">dairy</mattext>
				<mattext texttype = "text/html"><![CDATA[ group.&quot; <BR/>
					<br/>&quot;I don't want to take the same thing every
	day!&quot; said Maria. &nbsp;&quot;That would be too bland!
	&nbsp;I want something different every single day.&quot; <br/>
					<br/>The next day, Maria and her father went to the store to get
        the foods she needed, and on Monday, she packed her first lunch
        of the week. &nbsp;But on Tuesday, she couldn't find the]]></mattext>
				<mattext texttype = "text/html" label = "CarrotRef">carrot sticks</mattext>
				<mattext texttype = "text/html"> or the </mattext>
				<mattext texttype = "text/html" label = "MilkRef">milk</mattext>
				<mattext texttype = "text/html"> her menu said she was supposed to
        pack. "Did you eat my 
				</mattext>
				<mattext texttype = "text/html" label = "CarrotRef">carrot sticks</mattext>
				<mattext texttype = "text/html"> and drink my </mattext>
				<mattext texttype = "text/html" label = "MilkRef">milk,</mattext>
				<mattext texttype = "text/html"><![CDATA[ Juan?&quot; she asked her brother,
        sounding quite frustrated. &nbsp;&quot;Now what am I going to
	do?&quot; <BR/>
					<br/>But there in the refrigerator, Maria noticed two of her
	favorites, ]]></mattext>
				<mattext texttype = "text/html" label = "CeleryRef">celery</mattext>
				<mattext texttype = "text/html"> and </mattext>
				<mattext texttype = "text/html" label = "CheeseRef">cheese.</mattext>
				<mattext texttype = "text/html">So she cut up crunchy </mattext>
				<mattext texttype = "text/html" label = "CeleryRef">celery sticks</mattext>
				<mattext texttype = "text/html"> and stuffed them with </mattext>
				<mattext texttype = "text/html" label = "CheeseRef">cheese,</mattext>
				<mattext texttype = "text/html"> and that gave her a </mattext>
				<mattext texttype = "text/html" label = "VegetableRef">vegetable</mattext>
				<mattext texttype = "text/html"> and a </mattext>
				<mattext texttype = "text/html" label = "DairyRef">dairy</mattext>
				<mattext texttype = "text/html"><![CDATA[ food for her lunch after all!<BR/>]]></mattext>
			</material>
			<response_lid ident = "MC01">
				<render_choice>
					<material label = "Stem1">
						<mattext>What are the four food groups Maria is working with?</mattext>
					</material>
					<response_label ident = "a">
						<material label = "LeafA">
							<mattext> meat, bread, fruit and vegetables</mattext>
						</material>
					</response_label>
					<response_label ident = "b">
						<material label = "LeafB">
							<mattext>protein, bread, fruit and vegetables</mattext>
						</material>
					</response_label>
					<response_label ident = "c">
						<material label = "LeafC">
							<mattext>dairy, fruit, vegetables and grain</mattext>
						</material>
					</response_label>
					<response_label ident = "d">
						<material label = "LeafD">
							<mattext> milk, peanut butter, banana and bread</mattext>
						</material>
					</response_label>
					<response_label ident = "e">
						<material label = "LeafE">
							<mattext>protein, grain, fruit and vegetables, and dairy</mattext>
						</material>
					</response_label>
				</render_choice>
			</response_lid>
			<response_str ident = "STR02">
				<render_fib rows = "10" maxchars = "25">
					<material label = "Stem2">
						<mattext>In one word, what is the relationship of Juan to Maria?</mattext>
					</material>
				</render_fib>
			</response_str>
			<response_lid ident = "HS03">
				<material label = "Stem3">
					<mattext>In the passage above, select a food which is a member of the grain group.</mattext>
				</material>
				<render_hotspot>
					<material>
						<matref linkrefid = "Passage"/>
					</material>
					<!-- <QTICOMMENT> Selected a member of the grain group.</QTICOMMENT> -->
					<response_label ident = "Grain" labelrefid = "BreadRef"/>
					<!-- <QTICOMMENT> Selected the word sandwich, which is not quite what was asked for</QTICOMMENT> -->
					<response_label ident = "Sandwich" labelrefid = "SandwichRef"/>
					<!-- <QTICOMMENT> Selected a member of the word grain itself.</QTICOMMENT> -->
					<response_label ident = "Group" labelrefid = "GrainRef"/>
					<!-- <QTICOMMENT> Selected a some other item of food.</QTICOMMENT> -->
					<response_label ident = "OtherFood" labelrefid = "BananaRef"/>
					<response_label ident = "OtherFood" labelrefid = "MilkRef"/>
					<response_label ident = "OtherFood" labelrefid = "PBRef"/>
					<response_label ident = "OtherFood" labelrefid = "CarrotRef"/>
					<response_label ident = "OtherFood" labelrefid = "CeleryRef"/>
					<response_label ident = "OtherFood" labelrefid = "CheeseRef"/>
					<!-- <QTICOMMENT> Selected one of the other food groups..</QTICOMMENT> -->
					<response_label ident = "OtherGroup" labelrefid = "ProteinRef"/>
					<response_label ident = "OtherGroup" labelrefid = "DairyRef"/>
					<response_label ident = "OtherGroup" labelrefid = "FruitRef"/>
					<response_label ident = "OtherGroup" labelrefid = "VegetableRef"/>
				</render_hotspot>
			</response_lid>
		</presentation>
		<resprocessing scoremodel = "SumOfScore">
			<qticomment>  This scoring method uses the default scoring model to produce a outcome "Score" which is the number of right answers.
     
			</qticomment>
			<outcomes>
				<decvar varname = "Score" defaultval = "0"/>
				<interpretvar varname = "Score">
					<material>
						<mattext>The score will report the number of correct questions, from 0 (none) to 3 (all).
	   
						</mattext>
					</material>
				</interpretvar>
			</outcomes>
			<respcondition title = "Question1" continue = "Yes">
				<qticomment> We use continue = Yes, because we are going to do the logic for all three responses separately.
       
				</qticomment>
				<conditionvar>
					<varequal respident = "MC01">e</varequal>
				</conditionvar>
				<setvar varname = "Score" action = "Add">1</setvar>
			</respcondition>
			<respcondition title = "Question2" continue = "Yes">
				<conditionvar>
					<varequal respident = "STR02">brother</varequal>
				</conditionvar>
				<setvar varname = "Score" action = "Add">1</setvar>
			</respcondition>
			<respcondition title = "Question3" continue = "Yes">
				<conditionvar>
					<varequal respident = "HS03">Grain</varequal>
				</conditionvar>
				<setvar varname = "Score" action = "Add">1</setvar>
			</respcondition>
		</resprocessing>
		<resprocessing scoremodel = "VectorRight">
			<qticomment>        This response processing model produces three outcomes, one
	for each of the questions within this item.  Presumably the
	Section level processing will accumulate them in some sensible
	way (e.g., as three inputs to the IRT process).
     
			</qticomment>
			<outcomes>
				<decvar varname = "Q1Right" vartype = "Enumerated" members = "(Right|Wrong)" defaultval = "Wrong"/>
				<decvar varname = "Q2Right" vartype = "Enumerated" members = "(Right|Wrong)" defaultval = "Wrong"/>
				<decvar varname = "Q3Right" vartype = "Enumerated" members = "(Right|Wrong)" defaultval = "Wrong"/>
				<interpretvar varname = "Q1Right" view = "Assessor">
					<material>
						<mattext>Did the candidate get the first question right.</mattext>
					</material>
				</interpretvar>
				<interpretvar varname = "Q2Right" view = "Assessor">
					<material>
						<mattext>Did the candidate get the second question right.</mattext>
					</material>
				</interpretvar>
				<interpretvar varname = "Q3Right" view = "Assessor">
					<material>
						<mattext>Did the candidate get the third question right.</mattext>
					</material>
				</interpretvar>
			</outcomes>
			<respcondition title = "Question1" continue = "Yes">
				<qticomment> We use continue = Yes, because we are going to do the logic for all three responses separately.  Note, because
	 default value is wrong, we only need to set right answers.
       
				</qticomment>
				<conditionvar>
					<varequal respident = "MC01">e</varequal>
				</conditionvar>
				<setvar varname = "Q1Right">Right</setvar>
			</respcondition>
			<respcondition title = "Question2" continue = "Yes">
				<conditionvar>
					<varequal respident = "STR02">brother</varequal>
				</conditionvar>
				<setvar varname = "Q2Right">Right</setvar>
			</respcondition>
			<respcondition title = "Question3" continue = "Yes">
				<conditionvar>
					<varequal respident = "HS03">Grain</varequal>
				</conditionvar>
				<setvar varname = "Q3Right">Right</setvar>
			</respcondition>
		</resprocessing>
	</item>
</questestinterop>
Return current item: Ps and Qs: Processing QTI using PHP