Search in sources :

Example 6 with LOMDuration

use of org.olat.modules.qpool.model.LOMDuration in project openolat by klemens.

the class MetadataConverterHelper method convertDuration.

public static LOMDuration convertDuration(String durationStr) {
    LOMDuration duration = new LOMDuration();
    if (StringHelper.containsNonWhitespace(durationStr) && durationStr.startsWith("P")) {
        // remove p
        durationStr = durationStr.substring(1, durationStr.length());
        int indexT = durationStr.indexOf('T');
        if (indexT < 0) {
            convertDurationP(durationStr, duration);
        } else {
            String pDurationStr = durationStr.substring(0, indexT);
            convertDurationP(pDurationStr, duration);
            String tDurationStr = durationStr.substring(indexT + 1, durationStr.length());
            convertDurationT(tDurationStr, duration);
        }
    }
    return duration;
}
Also used : LOMDuration(org.olat.modules.qpool.model.LOMDuration)

Aggregations

LOMDuration (org.olat.modules.qpool.model.LOMDuration)6 Test (org.junit.Test)2 AbstractComponent (org.olat.core.gui.components.AbstractComponent)2 QItemType (org.olat.modules.qpool.model.QItemType)2 MetaUIFactory.bigDToString (org.olat.modules.qpool.ui.metadata.MetaUIFactory.bigDToString)2