<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<STYLE>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</STYLE>

<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY class=hmmessage>
<DIV id=idOWAReplyText13302 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>does it exist when you try and get at it?</FONT></DIV>
<DIV dir=ltr><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial>debug(question) ?? undefined??</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Dave Burnett<BR><B>Sent:</B> Tue 17/02/2009 16:26<BR><B>To:</B> Xerte list<BR><B>Subject:</B> RE: [Xerte] How to use the judge function correctly<BR></FONT><BR></DIV>
<DIV><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><BR>
<HR id=stopSpelling>
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<BR><BR>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>Hello</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>I don't know how this function works, but I can possibly help as thus</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>INTERACTION.prototype.judge = function() {<BR>&nbsp;//check that each response whose correct is not undefined<BR>&nbsp;//has the same status as correct<BR>&nbsp;for (var i = 0; i&lt;this.responses.length; i++) {<BR>&nbsp;&nbsp;if (this.responses[i].correct != undefined) {<BR>&nbsp;&nbsp;&nbsp;//trace(this.responses[i].correct +" " +this.responses[i].status);<BR>&nbsp;&nbsp;&nbsp;if (this.responses[i].correct != this.responses[i].status) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;//doesn't match - user cannot have matched all correctly<BR>&nbsp;&nbsp;&nbsp;&nbsp;return false;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>&nbsp;return true;<BR>};</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>Pat</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV class=EC_OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><B>From:</B> 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<BR></FONT><BR></DIV>
<DIV></DIV><FONT face=sans-serif size=2>Hi List,</FONT> <BR><BR><FONT face=sans-serif size=2>another beginner's question. Imagine the following structure:</FONT> <BR><FONT face=sans-serif size=2>-- page 1</FONT> <BR><FONT face=sans-serif size=2>---- interaction: id=question1</FONT> <BR><FONT face=sans-serif size=2>-------- button 1: correct=0</FONT> <BR><FONT face=sans-serif size=2>-------- button 2: correct=0</FONT> <BR><FONT face=sans-serif size=2>-------- button 3: correct=1</FONT> <BR><FONT face=sans-serif size=2>-- page 2</FONT> <BR><FONT face=sans-serif size=2>---- script: question1.judge()</FONT> <BR><BR><FONT face=sans-serif size=2>The script returns undefined, regardless of what the user clicks. I also tried false and true instead of 0 and 1. What's wrong?</FONT> <BR><BR><FONT face=sans-serif size=2>Peter Huppertz</FONT></BLOCKQUOTE><BR>
<HR>
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!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_getmore_092008" target=_new>Learn Now</A> </DIV></BODY></HTML>