<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br>Thanks Paul. Including the RS did indeed allow me to address (and set) the correct status on the fly.<br><br>Now I'm wondering if you have to know the rs values or you can use an object reference:<br><br>Say instead of <br>interaction.response.checkbox.correct;<br><br>this<br><br>interaction.response[1].correct;<br><br>That unfortunately gives me "Undefined"<br><br><br><br><hr id="stopSpelling">Subject: RE: [Xerte] How to use the judge function correctly<br>Date: Tue, 17 Feb 2009 09:38:35 -0800<br>From: Paul.Swanson@harlandfs.com<br>To: xerte@lists.nottingham.ac.uk<br><br>







<style>
.ExternalClass .EC_shape
{;}
</style>

<style>
.ExternalClass p.EC_MsoNormal, .ExternalClass li.EC_MsoNormal, .ExternalClass div.EC_MsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.EC_MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.EC_MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.EC_ec586423616-17022009
{;}
.ExternalClass span.EC_ecec609571515-17022009
{;}
.ExternalClass span.EC_EmailStyle20
{font-family:'Calibri','sans-serif';color:#1F497D;font-weight:normal;font-style:normal;text-decoration:none none;}
.ExternalClass .EC_MsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:8.5in 11.0in;}
.ExternalClass div.EC_Section1
{page:Section1;}
</style>





<div class="EC_Section1">

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">Dave, I believe if you set the rs property of the response, you
can address it directly.</span></p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">From the Help:</span></p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p class="EC_MsoNormal"><b><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">Common Response Properties</span></b></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">All interaction responses share some common properties:</span></p>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal"><i><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">name</span></i></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">The name of the icon you will see on the document tree.</span></p>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal"><i><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">id</span></i></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">An id that refers to the theoretical 'page' that contains the
content associated with an interaction response. The<i> id </i>property is
optional.</span></p>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal"><i><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">rs</span></i></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">An id that refers to the actual interactive element, such as the
button itself. The <i>rs </i>property is optional. You will use this when
scripting interactions.</span></p>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal"><i><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">type</span></i></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">The type of response. This is set automatically.</span></p>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal"><i><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">erase</span></i></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">This setting of 1 or 0 determines whether the contents of this
response are erased when<i> </i>other responses on the interaction are matched.</span></p>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal"><i><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">exit</span></i></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif'; color: rgb(1, 1, 1);">A boolean (0 or 1) value that determines whether the response
will cause the interaction to exit, or not. Interactions that are set to
perpetual will not exit, regardless of the response setting. You can force an
interaction to exit by calling it's exit method: <i>id.exit();</i></span></p>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">&nbsp;</span></p>

<p class="EC_MsoNormal"><span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; color: rgb(31, 73, 125);">&nbsp;</span></p>

<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">

<div>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0in 0in;">

<p class="EC_MsoNormal"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">
xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <b>On Behalf Of </b>Dave Burnett<br>
<b>Sent:</b> Tuesday, February 17, 2009 9:31 AM<br>
<b>To:</b> Xerte list<br>
<b>Subject:</b> RE: [Xerte] How to use the judge function correctly</span></p>

</div>

</div>

<p class="EC_MsoNormal">&nbsp;</p>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">Aha. I think i see what is happening.<br>
<br>
Patrick, is there any way to address the responses object directly?<br>
Something like:<br>
interaction.responses[1].status<br>
<br>
What I'm really driving at is there any way to dynamically set the correct
status T/F?</span></p>

<div class="EC_MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">

<hr id="EC_stopSpelling" size="2" width="100%" align="center">

</span></div>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">Subject: RE: [Xerte] How to use the judge
function correctly<br>
Date: Tue, 17 Feb 2009 16:40:44 +0000<br>
From: Patrick.Lockley@nottingham.ac.uk<br>
To: xerte@lists.nottingham.ac.uk</span></p>

<p class="EC_MsoNormal"><span class="EC_ec586423616-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">Well I replied to this,
but sent an attachment and it appears to have lost itself in the ether.</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ec586423616-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">So <a href="http://www.nottingham.ac.uk/%7Ecczpl/response.rlo">http://www.nottingham.ac.uk/~cczpl/response.rlo</a></span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ec586423616-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">basically</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ec586423616-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">Set up an interaction,
give it an id</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ec586423616-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">Add to the interaction
(i've used check boxes) a series of items, giving each one an id, a response
and a correct attribute</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ec586423616-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">At some point, run some
code and add to that code &lt;&lt;interactionid&gt;&gt;.judge()</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<blockquote style="margin-right: 0in; margin-bottom: 5pt;">

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<div class="EC_MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">

<hr size="2" width="100%" align="center">

</span></div>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <b>On Behalf Of </b>Dave Burnett<br>
<b>Sent:</b> 17 February 2009 16:26<br>
<b>To:</b> Xerte list<br>
<b>Subject:</b> RE: [Xerte] How to use the judge function correctly</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"><br>
Hmm.<br>
<br>
My interaction (id question) has 4 responses with names, id's, correct set to
1.<br>
<br>
If I debug:<br>
question.responses.length<br>
<br>
I get 0<br>
<br>
<br>
<br>
</span></p>

<div class="EC_MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">

<hr id="EC_EC_stopSpelling" size="2" width="100%" align="center">

</span></div>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">Subject: RE: [Xerte] How to use the judge
function correctly<br>
Date: Tue, 17 Feb 2009 15:17:15 +0000<br>
From: Patrick.Lockley@nottingham.ac.uk<br>
To: xerte@lists.nottingham.ac.uk</span></p>

<p class="EC_MsoNormal"><span class="EC_ecec609571515-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">Hello</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ecec609571515-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">I don't know how this
function works, but I can possibly help as thus</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ecec609571515-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">INTERACTION.prototype.judge
= function() {</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;"><br>
<span class="EC_ecec609571515-17022009">&nbsp;//check that each response whose
correct is not undefined</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;//has the same status as correct</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;for (var i = 0;
i&lt;this.responses.length; i++) {</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;&nbsp;if (this.responses[i].correct !=
undefined) {</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;&nbsp;&nbsp;//trace(this.responses[i].correct
+" " +this.responses[i].status);</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;&nbsp;&nbsp;if
(this.responses[i].correct != this.responses[i].status) {</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;&nbsp;&nbsp;&nbsp;//doesn't match -
user cannot have matched all correctly</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;&nbsp;&nbsp;&nbsp;return false;</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;&nbsp;&nbsp;}</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;&nbsp;}</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;}</span><br>
<span class="EC_ecec609571515-17022009">&nbsp;return true;</span><br>
<span class="EC_ecec609571515-17022009">};</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ecec609571515-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">That is the
flash&nbsp;source code of the function, so it looks like you need to set
responses for the interactions for a judge to work.</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<p class="EC_MsoNormal"><span class="EC_ecec609571515-17022009"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif'; color: blue;">Pat</span></span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<blockquote style="margin-right: 0in; margin-bottom: 5pt;">

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<div class="EC_MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">

<hr size="2" width="100%" align="center">

</span></div>

<p class="EC_MsoNormal" style="margin-bottom: 12pt;"><b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';">From:</span></b><span style="font-size: 10pt; font-family: 'Tahoma','sans-serif';"> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk]
<b>On Behalf Of </b>Peter Huppertz<br>
<b>Sent:</b> 17 February 2009 15:07<br>
<b>To:</b> xerte@lists.nottingham.ac.uk<br>
<b>Subject:</b> [Xerte] How to use the judge function correctly</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">Hi
List,</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"> <br>
<br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">another
beginner's question. Imagine the following structure:</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"> <br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">-- page
1</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"> <br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">----
interaction: id=question1</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">
<br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">--------
button 1: correct=0</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">
<br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">--------
button 2: correct=0</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">
<br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">--------
button 3: correct=1</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">
<br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">-- page
2</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"> <br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">----
script: question1.judge()</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">
<br>
<br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">The
script returns undefined, regardless of what the user clicks. I also tried
false and true instead of 0 and 1. What's wrong?</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"> <br>
<br>
</span><span style="font-size: 10pt; font-family: 'Arial','sans-serif';">Peter
Huppertz</span><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';"></span></p>

</blockquote>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<div class="EC_MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">

<hr size="2" width="100%" align="center">

</span></div>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">Get
more out of the Web. Learn 10 hidden secrets of Windows Live. <a href="http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns%21550F681DAD532637%215295.entry?ocid=TXT_TAGLM_WL_getmore_092008">Learn
Now</a> </span></p>

</blockquote>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">&nbsp;</span></p>

<div class="EC_MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">

<hr size="2" width="100%" align="center">

</span></div>

<p class="EC_MsoNormal"><span style="font-size: 10pt; font-family: 'Verdana','sans-serif';">Want
to do more with Windows Live? Learn “10 hidden secrets” from Jamie. <a href="http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns%21550F681DAD532637%215295.entry?ocid=TXT_TAGLM_WL_domore_092008">Learn Now</a></span></p>

</div>

</div><br /><hr />Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie. <a href='http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008' target='_new'>Learn Now</a></body>
</html>