[Xerte] cmi.core.score.raw datatype?

Julian Tenney Julian.Tenney at nottingham.ac.uk
Tue Oct 21 14:52:56 BST 2008


I'd have thought the APIWrapper would try and fix any dodgy datatypes coming at it, but I'm not sure,

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Mark Tomlinson, AC&S Ltd
Sent: Tuesday, October 21, 2008 2:50 PM
To: 'Xerte discussion list'
Subject: FW: [Xerte] cmi.core.score.raw datatype?

Oops.

Hit send too quickly



That was why I was using Math.round() as I also thought that BUT:


strScore=(m1score+m2score)/18*100;
_level0.setValue('cmi.core.score.raw',strScore);


Works and if m1score+m2score equates to 6, then the score ends up in the LMS
as 33.33333333  So this LMS obviously accepts non integer values.

It must also be getting cast to a string somewhere, although I am not
explicitly doing that.

Mark


-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 21 October 2008 14:46
To: Xerte discussion list
Subject: RE: [Xerte] cmi.core.score.raw datatype?

Does it need to be an integer?

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Mark Tomlinson,
AC&S Ltd
Sent: Tuesday, October 21, 2008 2:44 PM
To: 'Xerte discussion list'
Subject: RE: [Xerte] cmi.core.score.raw datatype?

Yes, it is a percentage.

Thanks


Mark

-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Martín Dobovšek
Sent: 21 October 2008 14:41
To: Xerte discussion list
Subject: Re: [Xerte] cmi.core.score.raw datatype?

Mark:

Check that value is UNDER or equal 100. It must be string

Best regards

Martin

--- "Mark Tomlinson, AC&S Ltd" <mark.tomlinson at acns-group.com> escribió:

> What data type is cmi.core.score.raw supposed to be?
> 
>  
> 
> If I call : 
> 
>  
> 
> _level0.setValue('cmi.core.score.raw',"50");  as a 'hard coded' value this
> works and sets the score as 50 in the LMS
> 
>  
> 
> If I call:
> 
>  
> 
>
_level0.setValue('cmi.core.score.raw',Math.round((m1score+m2score)/18*100));
> This fails.  I assumed because it was not a string?
> 
>  
> 
> If I call:
> 
>  
> 
>
_level0.setValue('cmi.core.score.raw',String(Math.round((m1score+m2score)/18
> *100)));  This also fails.
> 
>  
> 
>  
> 
> In all failing cases I get a JavaScript alert stating 'Incorrect Data
Type'.
> If I turn on debugging in apiwrapper.js, I get :  Incorrect Data Type   No
> Error
> 
>  
> 
>  
> 
> Anyone any ideas what I am doing wrong here?
> 
>  
> 
> Cheers
> 
>  
> 
> Mark
> 
>  
> 
>  
> 
>  
> 
> 
> 
> 
> 
>  <http://www.acns-group.com> 
> 
> Creating Excellence Together
> 
>  
> 
> 
> 
> Mark Tomlinson
> Managing Director 
> 
> AC&S LTD
> 35A Victoria Road East
> Thornton-Cleveleys
> Lancashire
> FY5 5BU
> UK 
> 
> 
>  <mailto:mark.tomlinson at acns-group.com> mark.tomlinson at acns-group.com 
> 
> 
> tel: 
> fax: 
> mobile: 
> 
> +44 1253 855 997
> +44 870 762 6818
> +44 789 968 7257 
> 
>  
> 
> 
> 
>  
> 
>  
> 
> > _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
> 



      Yahoo! Cocina
Recetas prácticas y comida saludable
http://ar.mujer.yahoo.com/cocina/

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte


More information about the Xerte mailing list