Search in sources :

Example 36 with QTIItemObject

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

the class QTIExportManager method createContentOfExportFile.

/**
 * @param locale Locale used for export file headers / default values
 * @param results
 * @param type
 * @param anonymizerCallback
 * @return String
 */
private void createContentOfExportFile(List<QTIResult> qtiResults, List<QTIItemObject> qtiItemObjectList, QTIExportFormatter qef) {
    qef.openReport();
    // formatter has information about how to format the different qti objects
    Map<Class<?>, QTIExportItemFormatConfig> mapWithConfigs = qef.getMapWithExportItemConfigs();
    QTIExportItemFactory qeif = new QTIExportItemFactory(mapWithConfigs);
    while (qtiResults.size() > 0) {
        List<QTIResult> assessIDresults = stripNextAssessID(qtiResults);
        qef.openResultSet(new QTIExportSet(assessIDresults.get(0)));
        for (QTIItemObject element : qtiItemObjectList) {
            QTIResult qtir = element.extractQTIResult(assessIDresults);
            qef.visit(qeif.getExportItem(qtir, element));
        }
        qef.closeResultSet();
    }
    qef.closeReport();
}
Also used : QTIResult(org.olat.ims.qti.QTIResult) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject)

Aggregations

QTIItemObject (org.olat.ims.qti.export.helper.QTIItemObject)36 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)20 HashMap (java.util.HashMap)10 QTIResult (org.olat.ims.qti.QTIResult)8 QTIObjectTreeBuilder (org.olat.ims.qti.export.helper.QTIObjectTreeBuilder)8 Test (org.junit.Test)6 QTIResultManager (org.olat.ims.qti.QTIResultManager)6 QTIExportItemFormatConfig (org.olat.ims.qti.export.QTIExportItemFormatConfig)6 QTIStatisticSearchParams (org.olat.ims.qti.statistics.QTIStatisticSearchParams)6 StatisticsItem (org.olat.ims.qti.statistics.model.StatisticsItem)6 QTIExportEssayItemFormatConfig (org.olat.ims.qti.export.QTIExportEssayItemFormatConfig)4 QTIExportFIBItemFormatConfig (org.olat.ims.qti.export.QTIExportFIBItemFormatConfig)4 QTIExportFormatter (org.olat.ims.qti.export.QTIExportFormatter)4 QTIExportFormatterCSVType1 (org.olat.ims.qti.export.QTIExportFormatterCSVType1)4 QTIExportFormatterCSVType3 (org.olat.ims.qti.export.QTIExportFormatterCSVType3)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 InputStream (java.io.InputStream)2 ArrayList (java.util.ArrayList)2