Search in sources :

Example 1 with QTIExportKPRIMItemFormatConfig

use of org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig in project openolat by klemens.

the class QTIStatisticsResource method getQTIItemConfigs.

/**
 * Copy of QTIArchiveWizardController.getQTIItemConfigs but with all options set
 * to true except for the time column.
 *
 * @param itemList
 * @return
 */
private static final Map<Class<?>, QTIExportItemFormatConfig> getQTIItemConfigs(List<QTIItemObject> itemList) {
    Map<Class<?>, QTIExportItemFormatConfig> itConfigs = new HashMap<>();
    for (Iterator<QTIItemObject> iter = itemList.iterator(); iter.hasNext(); ) {
        QTIItemObject item = iter.next();
        if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)) {
            if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null) {
                QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, true, true, false);
                itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)) {
            if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null) {
                QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, true, true, false);
                itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)) {
            if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null) {
                QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, true, true, false);
                itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)) {
            if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null) {
                QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
                itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)) {
            if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null) {
                QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, true, false);
                itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
            }
        } else // if cannot find the type via the ItemParser, look for the QTIItemObject type
        if (item.getItemType().equals(QTIItemObject.TYPE.A)) {
            QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
            itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.R)) {
            QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, true, true, false);
            itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.C)) {
            QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, true, true, false);
            itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.B)) {
            QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, true, false);
            itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        } else {
            throw new OLATRuntimeException(null, "Can not resolve QTIItem type", null);
        }
    }
    return itConfigs;
}
Also used : QTIExportEssayItemFormatConfig(org.olat.ims.qti.export.QTIExportEssayItemFormatConfig) QTIExportMCQItemFormatConfig(org.olat.ims.qti.export.QTIExportMCQItemFormatConfig) HashMap(java.util.HashMap) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) QTIExportSCQItemFormatConfig(org.olat.ims.qti.export.QTIExportSCQItemFormatConfig) QTIExportKPRIMItemFormatConfig(org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig) QTIExportItemFormatConfig(org.olat.ims.qti.export.QTIExportItemFormatConfig) QTIExportFIBItemFormatConfig(org.olat.ims.qti.export.QTIExportFIBItemFormatConfig)

Example 2 with QTIExportKPRIMItemFormatConfig

use of org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig in project openolat by klemens.

the class IQEditReplaceWizard method getQTIItemConfigs.

private Map<Class<?>, QTIExportItemFormatConfig> getQTIItemConfigs(List<QTIItemObject> qtiItemObjectList) {
    Map<Class<?>, QTIExportItemFormatConfig> itConfigs = new HashMap<>();
    for (Iterator<QTIItemObject> iter = qtiItemObjectList.iterator(); iter.hasNext(); ) {
        QTIItemObject item = iter.next();
        if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)) {
            if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null) {
                QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
                itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)) {
            if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null) {
                QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
                itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)) {
            if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null) {
                QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, false, false, false);
                itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)) {
            if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null) {
                QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
                itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)) {
            if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null) {
                QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
                itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
            }
        } else if (item.getItemType().equals(QTIItemObject.TYPE.A)) {
            QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
            itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.R)) {
            QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
            itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.C)) {
            QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
            itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.B)) {
            QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
            itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        } else {
            throw new OLATRuntimeException(null, "Can not resolve QTIItem type", null);
        }
    }
    return itConfigs;
}
Also used : QTIExportEssayItemFormatConfig(org.olat.ims.qti.export.QTIExportEssayItemFormatConfig) QTIExportMCQItemFormatConfig(org.olat.ims.qti.export.QTIExportMCQItemFormatConfig) HashMap(java.util.HashMap) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) QTIExportSCQItemFormatConfig(org.olat.ims.qti.export.QTIExportSCQItemFormatConfig) QTIExportKPRIMItemFormatConfig(org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig) QTIExportItemFormatConfig(org.olat.ims.qti.export.QTIExportItemFormatConfig) QTIExportFIBItemFormatConfig(org.olat.ims.qti.export.QTIExportFIBItemFormatConfig)

Example 3 with QTIExportKPRIMItemFormatConfig

use of org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig in project OpenOLAT by OpenOLAT.

the class QTIStatisticsResource method getQTIItemConfigs.

/**
 * Copy of QTIArchiveWizardController.getQTIItemConfigs but with all options set
 * to true except for the time column.
 *
 * @param itemList
 * @return
 */
private static final Map<Class<?>, QTIExportItemFormatConfig> getQTIItemConfigs(List<QTIItemObject> itemList) {
    Map<Class<?>, QTIExportItemFormatConfig> itConfigs = new HashMap<>();
    for (Iterator<QTIItemObject> iter = itemList.iterator(); iter.hasNext(); ) {
        QTIItemObject item = iter.next();
        if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)) {
            if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null) {
                QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, true, true, false);
                itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)) {
            if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null) {
                QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, true, true, false);
                itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)) {
            if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null) {
                QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, true, true, false);
                itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)) {
            if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null) {
                QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
                itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)) {
            if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null) {
                QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, true, false);
                itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
            }
        } else // if cannot find the type via the ItemParser, look for the QTIItemObject type
        if (item.getItemType().equals(QTIItemObject.TYPE.A)) {
            QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
            itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.R)) {
            QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, true, true, false);
            itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.C)) {
            QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, true, true, false);
            itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.B)) {
            QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, true, false);
            itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        } else {
            throw new OLATRuntimeException(null, "Can not resolve QTIItem type", null);
        }
    }
    return itConfigs;
}
Also used : QTIExportEssayItemFormatConfig(org.olat.ims.qti.export.QTIExportEssayItemFormatConfig) QTIExportMCQItemFormatConfig(org.olat.ims.qti.export.QTIExportMCQItemFormatConfig) HashMap(java.util.HashMap) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) QTIExportSCQItemFormatConfig(org.olat.ims.qti.export.QTIExportSCQItemFormatConfig) QTIExportKPRIMItemFormatConfig(org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig) QTIExportItemFormatConfig(org.olat.ims.qti.export.QTIExportItemFormatConfig) QTIExportFIBItemFormatConfig(org.olat.ims.qti.export.QTIExportFIBItemFormatConfig)

Example 4 with QTIExportKPRIMItemFormatConfig

use of org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig in project OpenOLAT by OpenOLAT.

the class IQEditReplaceWizard method getQTIItemConfigs.

private Map<Class<?>, QTIExportItemFormatConfig> getQTIItemConfigs(List<QTIItemObject> qtiItemObjectList) {
    Map<Class<?>, QTIExportItemFormatConfig> itConfigs = new HashMap<>();
    for (Iterator<QTIItemObject> iter = qtiItemObjectList.iterator(); iter.hasNext(); ) {
        QTIItemObject item = iter.next();
        if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)) {
            if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null) {
                QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
                itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)) {
            if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null) {
                QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
                itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)) {
            if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null) {
                QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, false, false, false);
                itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)) {
            if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null) {
                QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
                itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
            }
        } else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)) {
            if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null) {
                QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
                itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
            }
        } else if (item.getItemType().equals(QTIItemObject.TYPE.A)) {
            QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
            itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.R)) {
            QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
            itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.C)) {
            QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
            itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
        } else if (item.getItemType().equals(QTIItemObject.TYPE.B)) {
            QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
            itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        } else {
            throw new OLATRuntimeException(null, "Can not resolve QTIItem type", null);
        }
    }
    return itConfigs;
}
Also used : QTIExportEssayItemFormatConfig(org.olat.ims.qti.export.QTIExportEssayItemFormatConfig) QTIExportMCQItemFormatConfig(org.olat.ims.qti.export.QTIExportMCQItemFormatConfig) HashMap(java.util.HashMap) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException) QTIExportSCQItemFormatConfig(org.olat.ims.qti.export.QTIExportSCQItemFormatConfig) QTIExportKPRIMItemFormatConfig(org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig) QTIExportItemFormatConfig(org.olat.ims.qti.export.QTIExportItemFormatConfig) QTIExportFIBItemFormatConfig(org.olat.ims.qti.export.QTIExportFIBItemFormatConfig)

Aggregations

HashMap (java.util.HashMap)4 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)4 QTIExportEssayItemFormatConfig (org.olat.ims.qti.export.QTIExportEssayItemFormatConfig)4 QTIExportFIBItemFormatConfig (org.olat.ims.qti.export.QTIExportFIBItemFormatConfig)4 QTIExportItemFormatConfig (org.olat.ims.qti.export.QTIExportItemFormatConfig)4 QTIExportKPRIMItemFormatConfig (org.olat.ims.qti.export.QTIExportKPRIMItemFormatConfig)4 QTIExportMCQItemFormatConfig (org.olat.ims.qti.export.QTIExportMCQItemFormatConfig)4 QTIExportSCQItemFormatConfig (org.olat.ims.qti.export.QTIExportSCQItemFormatConfig)4 QTIItemObject (org.olat.ims.qti.export.helper.QTIItemObject)4