[QTI] Rounding outcome variables

Steve Lay swl10 at cam.ac.uk
Fri Aug 22 13:43:32 BST 2008


There is a critical issue in this discussion which is sometimes lost 
when people implement systems that use decimal representations of 
numbers internally (or at least, seem to).

There is a big difference between displaying numbers to 2 decimal places 
when you display your answer to the user and storing it in a rounded form.

Dick has pointed out that there are times when you need to use the 
decimal representation for checking answers (especially if you want to 
know about the decimal representation used by the student, to 
distinguish 3.14 and 3.140 for example) but this seems to be more 
related to displaying the output of a scoring process?

When does moodle round to 2 d.p?

Steve

Niall Barr wrote:
> Hi all,
>  
> I'm trying to fix the (very broken) Moodle QTIv2 item export, so that it 
> generates valid QTI items that behave exactly the same as the Moodle 
> items. One thing Moodle does is round scores to 2 decimal places, so 
> that a score made by adding three parts each with a value of 0.33333 
> becomes 1.
>  
> Is there a neat way of doinf this, or do I need to do something like 
> this at the end of responseProcessing?
>  
> 
> <setOutcomeValue identifier="SCORE">
> 
>   <divide>
> 
>     <round>
> 
>       <product>
> 
>         <variable identifier="SCORE"/>
> 
>         <baseValue baseType="float">100</baseValue>
> 
>        </product>
> 
>       </round>
> 
>     <baseValue baseType="float">100</baseValue>
> 
>   </divide>
> 
> </setOutcomeValue>
> 
>  
> 
> (Unfortunatly this doesn't work in either of the item players I'm using 
> - bits are unimplemented in APIS (though it should only take an hour or 
> so to fix that) and R2Q2 doesn't seem to calculate <product> correctly.)
> 
>  
> 
> Niall 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> IMS-QTI mailing list
> IMS-QTI at lists.ucles.org.uk
> http://lists.ucles.org.uk/lists/listinfo/ims-qti



More information about the IMS-QTI mailing list