<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=idOWAReplyText77344 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>often I set properties ahead of time like this, in a script before the interaction, especially if I'm duplicating the responses:</FONT></DIV>
<DIV dir=ltr><FONT face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial>icon.nextSibling.childNodes[n].attributes.correct = '1';</FONT></DIV>
<DIV dir=ltr><FONT face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial>horses for courses. Are you doing this outside Xerte? Building the whole .rlo on the fly somewhere?</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> Wed 18/02/2009 22:37<BR><B>To:</B> Xerte list<BR><B>Subject:</B> RE: [Xerte] How to use the judge function correctly<BR></FONT><BR></DIV>
<DIV>The Gecko DOM ref.<BR>I was just fooling with all sorts of stuff.<BR><BR>This is the form I'm using now:<BR><BR>interaction.XMLElement.childNodes[2].attributes.myNewAttribute = "correct";<BR>interaction.XMLElement.childNodes[2].attributes.correct = 4;<BR><BR><BR><BR><BR>
<HR id=stopSpelling>
Subject: RE: [Xerte] How to use the judge function correctly<BR>Date: Wed, 18 Feb 2009 21:42:37 +0000<BR>From: Julian.Tenney@nottingham.ac.uk<BR>To: xerte@lists.nottingham.ac.uk<BR><BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
<DIV id=EC_idOWAReplyText90376 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>where does CreateAttribute() come from? Not one of mine. Something undocumented? Or a case thing - createAttribute() might be mine. Or something I didn't know about in the xmlNode class?</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Dave Burnett<BR><B>Sent:</B> Wed 18/02/2009 20:40<BR><B>To:</B> Xerte list<BR><B>Subject:</B> RE: [Xerte] How to use the judge function correctly<BR></FONT><BR></DIV>
<DIV>Thanks Julian.<BR><BR>Yes, this does work;<BR><BR>if (interaction.XMLElement.childNodes[2].clip().correct == undefined) {<BR>interaction.XMLElement.childNodes[2].clip().CreateAttribute['correct'];<BR>interaction.XMLElement.childNodes[2].clip().correct = 0;<BR>}<BR><BR>But I'll use the node syntax you suggested:<BR><BR>node.attributes.myNewAttribute = "value";<BR><BR><BR><BR>
<HR id=EC_stopSpelling>
Subject: RE: [Xerte] How to use the judge function correctly<BR>Date: Wed, 18 Feb 2009 20:05:09 +0000<BR>From: Julian.Tenney@nottingham.ac.uk<BR>To: xerte@lists.nottingham.ac.uk<BR><BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
<DIV id=EC_EC_idOWAReplyText84391 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>If you are building the file at runtime (I think you are) then, yes, my preferred way is to work with the XML. It is then parsed and the file is created. There may be a danger that by setting properties directly, you miss something else the code does when initalising icons. So, yes, for example, you could set the correct property on a response movieclip, but if the engine also does something else at that point (like add the response to the array) then it won't happen.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial>I think, in the case of 'correct' you can set it at runtime, because I seem to remember building it to work in a dynamic way. That may not be the case for every movieclip property that has a corresponding xml attribute.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial>J</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Dave Burnett<BR><B>Sent:</B> Wed 18/02/2009 19:11<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>I must have fat-fingered a key somewhere.<BR><BR>Just rebuilt it and I do get a 2 value for <BR>interaction.responses.length<BR>with an int with 3 responses attached.<BR><BR>interaction.responses[1] gives me <BR>_level0.engine.IFC.PG_MC20.Int_MC1.box3<BR><BR>Is that the whole array?<BR>I guess the point is to address the XML nodes as opposed to the underlying constructors?<BR><BR><BR><BR>
<HR id=EC_EC_stopSpelling>
Subject: RE: [Xerte] How to use the judge function correctly<BR>Date: Wed, 18 Feb 2009 18:09:48 +0000<BR>From: Julian.Tenney@nottingham.ac.uk<BR>To: xerte@lists.nottingham.ac.uk<BR><BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
<DIV id=EC_EC_EC_idOWAReplyText91120 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>I thought the same thing...</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk on behalf of Dave Burnett<BR><B>Sent:</B> Wed 18/02/2009 18:08<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>I could test that, but since I got 0 instead of Undefined for the length query, I assumed the rest of the objects had to exist.<BR><BR><BR>
<HR id=EC_EC_EC_stopSpelling>
Subject: RE: [Xerte] How to use the judge function correctly<BR>Date: Wed, 18 Feb 2009 18:02:25 +0000<BR>From: Julian.Tenney@nottingham.ac.uk<BR>To: xerte@lists.nottingham.ac.uk<BR><BR>
<STYLE>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
<DIV id=EC_EC_EC_EC_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> </DIV>
<DIV dir=ltr><FONT face=Arial>debug(question) ?? undefined??</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR>
<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=EC_EC_EC_EC_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_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>Hello</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=EC_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=EC_EC_EC_EC_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_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=EC_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>INTERACTION.prototype.judge = function() {<BR> //check that each response whose correct is not undefined<BR> //has the same status as correct<BR> for (var i = 0; i<this.responses.length; i++) {<BR> if (this.responses[i].correct != undefined) {<BR> //trace(this.responses[i].correct +" " +this.responses[i].status);<BR> if (this.responses[i].correct != this.responses[i].status) {<BR> //doesn't match - user cannot have matched all correctly<BR> return false;<BR> }<BR> }<BR> }<BR> return true;<BR>};</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=EC_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=EC_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>That is the flash 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_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=EC_EC_EC_EC_EC_609571515-17022009><FONT face=Verdana color=#0000ff size=2>Pat</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV class=EC_EC_EC_EC_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%21550F681DAD532637%215295.entry?ocid=TXT_TAGLM_WL_getmore_092008">Learn Now</A> </DIV><BR>
<HR>
See how Windows Mobile brings your life together—at home, work, or on the go. <A href="http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/">See Now</A> </DIV><BR>
<HR>
See how Windows Mobile brings your life together—at home, work, or on the go. <A href="http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/">See Now</A> </DIV><BR>
<HR>
Stay up to date on your PC, the Web, and your mobile phone with Windows Live. <A href="http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/">See Now</A> </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> </DIV></BODY></HTML>