Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-783

Better getCutValue() for Onyx tests

    XMLWordPrintable

    Details

      Description

      The method de.bps.onyx.plugin.course.nodes.iq.IQEditForm.getCutValue() does not return float values, recognize a comma as decimal point and does not update the form field cutValue. This is a tested replacement for that:

      public Float getCutValue() {
      String val = cutValue.getValue();
      Float f = Float.NaN;
      try

      { f = Float.valueOf(val); }

      catch (Exception e) {
      try

      { NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN); f = Float.valueOf(nf.parse(val).floatValue()); }

      catch (ParseException e1) {
      }
      }
      cutValue.setValue(f.toString());
      return f;
      }

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: