use of org.olat.ims.qti.QTIResultManager in project openolat by klemens.
the class QTIExportManager method selectAndExportResults.
/**
* @param locale
* @param olatResource
* @param shortTitle
* @param olatResourceDetail
* @param repositoryRef
* @param type
* @param exportDirectory
* @param anonymizerCallback callback that should be used to anonymize the user names or NULL if row counter
* should be used (only for type 2 and 3)
* @return
*/
public boolean selectAndExportResults(QTIExportFormatter qef, Long courseResId, String shortTitle, String olatResourceDetail, Long testReKey, File exportDirectory, String charset, String fileNameSuffix) {
boolean resultsFoundAndExported = false;
QTIResultManager qrm = QTIResultManager.getInstance();
List<QTIResult> results = qrm.selectResults(courseResId, olatResourceDetail, testReKey, null, qef.getType());
if (results.size() > 0) {
QTIResult res0 = results.get(0);
List<QTIItemObject> qtiItemObjectList = new QTIObjectTreeBuilder().getQTIItemObjectList(new Long(res0.getResultSet().getRepositoryRef()));
qef.setQTIItemObjectList(qtiItemObjectList);
if (results.size() > 0) {
createContentOfExportFile(results, qtiItemObjectList, qef);
writeContentToFile(shortTitle, exportDirectory, charset, qef, fileNameSuffix);
resultsFoundAndExported = true;
}
}
return resultsFoundAndExported;
}
Aggregations