numeric values in authoring should support locale decimal separator

Description

Steps to reproduce:
1. Create an assessment.
2. Add a question. For point value, enter a number which has decimal point using comma instead of dot (eg: 10,5 instead of 10.5).
You will see error:
"Validation Error: Value is not of the correct type"

There are 2 issues here:
1.For purpose of International System of Units (SI), it should except comma and translate to dot.
2. Error message: should be internationalized.

Activity

Show:

Lydia Li June 15, 2010 at 10:35 PM

Fixed the discount point.

David Roldán Martínez June 15, 2010 at 12:20 PM

Validation error only happens with discount values. Probably, applying the same solution that the one to points will work.

Jean-François Lévêque September 11, 2009 at 5:01 AM

may help

Diego del Blanco Orobitg May 2, 2007 at 12:05 AM

Hi. As said we have investigate this issue in evaluation in SAK-8643. Solution was very simple.

It was a javascript function that changes comma by point
------------------------------------------------------------------------------------------------------ function toPoint(id)
{
var x=document.getElementById(id).value
document.getElementById(id).value=x.replace(',','.')
}
------------------------------------------------------------------------------------------------------

And in each "numeric" jsp inputText tag we must add this:
------------------------------------------------------------------------------------------------------ onchange="toPoint(this.id)"
------------------------------------------------------------------------------------------------------

Sample:
<h:inputText value="#{description.totalOverrideScore}" size="5" id="adjustTotal3" required="false" rendered="#{totalScores.anonymous eq 'false' || description.assessmentGradingId ne '-1'}" onchange="toPoint(this.id)">

It solves the problem of validation. Then float values are stored correctly in database. If code reads float values from database as float values there is not any trouble. The trouble only can happen if a float value is readed as a string. In that case solution is easy too:

Sample: We have a string variable called totalAutoScore:
------------------------------------------------------------------------------------------------------ if (totalAutoScore!= null){
totalAutoScore.replace(',', '.'), "0");
}
------------------------------------------------------------------------------------------------------ We can do this in setters and getters...

This is all the work to do. If we are in a system that uses points... all this code really does nothing. If have a system "with commas", this code traslates always commas to point.

Marc Marc May 1, 2007 at 10:08 AM

I would say not "instead" but potentially "in addition" and wouldn't that make it a feature request, not a bug? This seems like one little piece under a broader internationalization effort. Diego has done a big part by adding i18n support (), but what else is there? I have no idea, not in my expertise. Maybe Diego would know?
-mARC

Fixed

Details

Priority

Fix versions

Components

Assignee

Reporter

Environment

ie, FF
Created April 30, 2007 at 11:20 AM
Updated April 17, 2018 at 8:38 AM
Resolved June 15, 2010 at 10:35 PM