[Xerte] How to use the judge function correctly

Dave Burnett d_b_burnett at hotmail.com
Tue Feb 17 18:18:32 GMT 2009



Thanks Paul. Including the RS did indeed allow me to address (and set) the correct status on the fly.

Now I'm wondering if you have to know the rs values or you can use an object reference:

Say instead of 
interaction.response.checkbox.correct;

this

interaction.response[1].correct;

That unfortunately gives me "Undefined"



Subject: RE: [Xerte] How to use the judge function correctly
Date: Tue, 17 Feb 2009 09:38:35 -0800
From: Paul.Swanson at harlandfs.com
To: xerte at lists.nottingham.ac.uk



















Dave, I believe if you set the rs property of the response, you
can address it directly.

 

>From the Help:

 

Common Response Properties

All interaction responses share some common properties:

 

name

The name of the icon you will see on the document tree.

 

id

An id that refers to the theoretical 'page' that contains the
content associated with an interaction response. The id property is
optional.

 

rs

An id that refers to the actual interactive element, such as the
button itself. The rs property is optional. You will use this when
scripting interactions.

 

type

The type of response. This is set automatically.

 

erase

This setting of 1 or 0 determines whether the contents of this
response are erased when other responses on the interaction are matched.

 

exit

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: id.exit();

 

 

 







From:
xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett

Sent: Tuesday, February 17, 2009 9:31 AM

To: Xerte list

Subject: RE: [Xerte] How to use the judge function correctly





 

Aha. I think i see what is happening.



Patrick, is there any way to address the responses object directly?

Something like:

interaction.responses[1].status



What I'm really driving at is there any way to dynamically set the correct
status T/F?







Subject: RE: [Xerte] How to use the judge
function correctly

Date: Tue, 17 Feb 2009 16:40:44 +0000

From: Patrick.Lockley at nottingham.ac.uk

To: xerte at lists.nottingham.ac.uk

Well I replied to this,
but sent an attachment and it appears to have lost itself in the ether.

 

So http://www.nottingham.ac.uk/~cczpl/response.rlo

 

basically

 

Set up an interaction,
give it an id

 

Add to the interaction
(i've used check boxes) a series of items, giving each one an id, a response
and a correct attribute

 

At some point, run some
code and add to that code <<interactionid>>.judge()



 







From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett

Sent: 17 February 2009 16:26

To: Xerte list

Subject: RE: [Xerte] How to use the judge function correctly



Hmm.



My interaction (id question) has 4 responses with names, id's, correct set to
1.



If I debug:

question.responses.length



I get 0















Subject: RE: [Xerte] How to use the judge
function correctly

Date: Tue, 17 Feb 2009 15:17:15 +0000

From: Patrick.Lockley at nottingham.ac.uk

To: xerte at lists.nottingham.ac.uk

Hello

 

I don't know how this
function works, but I can possibly help as thus

 

INTERACTION.prototype.judge
= function() {

 //check that each response whose
correct is not undefined

 //has the same status as correct

 for (var i = 0;
i<this.responses.length; i++) {

  if (this.responses[i].correct !=
undefined) {

   //trace(this.responses[i].correct
+" " +this.responses[i].status);

   if
(this.responses[i].correct != this.responses[i].status) {

    //doesn't match -
user cannot have matched all correctly

    return false;

   }

  }

 }

 return true;

};

 

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.

 

Pat



 







From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk]
On Behalf Of Peter Huppertz

Sent: 17 February 2009 15:07

To: xerte at lists.nottingham.ac.uk

Subject: [Xerte] How to use the judge function correctly

Hi
List, 



another
beginner's question. Imagine the following structure: 

-- page
1 

----
interaction: id=question1


--------
button 1: correct=0


--------
button 2: correct=0


--------
button 3: correct=1


-- page
2 

----
script: question1.judge()




The
script returns undefined, regardless of what the user clicks. I also tried
false and true instead of 0 and 1. What's wrong? 



Peter
Huppertz



 







Get
more out of the Web. Learn 10 hidden secrets of Windows Live. Learn
Now 



 







Want
to do more with Windows Live? Learn “10 hidden secrets” from Jamie. Learn Now




_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20090217/ea7ab29a/attachment.html


More information about the Xerte mailing list