diff --git a/src/main/java/org/olat/ims/qti/export/QTIExportFormatterCSVType1.java b/src/main/java/org/olat/ims/qti/export/QTIExportFormatterCSVType1.java index 24ea87f11e1298b5bf059bb835107cb6715ef2c3..3154ae23194d075ea1d5024d5d60b3a3e24efaa6 100644 --- a/src/main/java/org/olat/ims/qti/export/QTIExportFormatterCSVType1.java +++ b/src/main/java/org/olat/ims/qti/export/QTIExportFormatterCSVType1.java @@ -233,11 +233,11 @@ public class QTIExportFormatterCSVType1 extends QTIExportFormatter { boolean isPassed = set.getIsPassed(); sb.append(isPassed); sb.append(sep); - sb.append(set.getIp()); - sb.append(sep); - // datatime if (!isAnonymous) { + sb.append(set.getIp()); + sb.append(sep); + // datatime Date date = set.getLastModified(); sb.append(Formatter.formatDatetime(date)); sb.append(sep); @@ -478,9 +478,9 @@ public class QTIExportFormatterCSVType1 extends QTIExportFormatter { } hr1Intro.append(sep); hr1Intro.append(sep); - hr1Intro.append(sep); if (!isAnonymous) { - hr1Intro.append(sep); + hr1Intro.append(sep);// header ip address + hr1Intro.append(sep);// header date } hr1Intro.append(sep); return hr1Intro.toString();// + sep + sep + sep + sep + sep + sep + sep + sep + sep; @@ -526,10 +526,10 @@ public class QTIExportFormatterCSVType1 extends QTIExportFormatter { String passed = translator.translate("column.header.passed"); hr2Intro.append(passed); hr2Intro.append(sep); - String ipAddress = translator.translate("column.header.ipaddress"); - hr2Intro.append(ipAddress); - hr2Intro.append(sep); if (!isAnonymous) { + String ipAddress = translator.translate("column.header.ipaddress"); + hr2Intro.append(ipAddress); + hr2Intro.append(sep); String date = translator.translate("column.header.date"); hr2Intro.append(date); hr2Intro.append(sep); diff --git a/src/main/java/org/olat/ims/qti21/manager/archive/QTI21ArchiveFormat.java b/src/main/java/org/olat/ims/qti21/manager/archive/QTI21ArchiveFormat.java index e04f420329a200beda118a8ed7123c5129d8dcdc..4d66ec6e6fd518fe3d376e8c413c7a89495e7dd7 100644 --- a/src/main/java/org/olat/ims/qti21/manager/archive/QTI21ArchiveFormat.java +++ b/src/main/java/org/olat/ims/qti21/manager/archive/QTI21ArchiveFormat.java @@ -290,7 +290,7 @@ public class QTI21ArchiveFormat { Row header1Row = exportSheet.newRow(); int col = 1; if(anonymizerCallback != null) { - col += 5;// anonymized name -> test duration + col += 4;// anonymized name -> test duration } else { for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) { if (userPropertyHandler != null) { @@ -319,7 +319,7 @@ public class QTI21ArchiveFormat { col++; } if (exportConfig.hasTimeCols()) { - col += 2; + col += anonymizerCallback != null ? 1 : 2; } } } @@ -349,7 +349,9 @@ public class QTI21ArchiveFormat { header2Row.addCell(col++, translator.translate("column.header.assesspoints"), headerStyle); header2Row.addCell(col++, translator.translate("column.header.passed"), headerStyle); - header2Row.addCell(col++, translator.translate("column.header.date"), headerStyle); + if (anonymizerCallback == null){ + header2Row.addCell(col++, translator.translate("column.header.date"), headerStyle); + } header2Row.addCell(col++, translator.translate("column.header.duration"), headerStyle); List<ItemInfos> infos = getItemInfos(); @@ -367,7 +369,9 @@ public class QTI21ArchiveFormat { header2Row.addCell(col++, translator.translate("item.score"), headerStyle); } if (exportConfig.hasTimeCols()) { - header2Row.addCell(col++, translator.translate("item.start"), headerStyle); + if (anonymizerCallback == null){ + header2Row.addCell(col++, translator.translate("item.start"), headerStyle); + } header2Row.addCell(col++, translator.translate("item.duration"), headerStyle); } } @@ -450,7 +454,9 @@ public class QTI21ArchiveFormat { } else { col++; } - dataRow.addCell(col++, testSession.getCreationDate(), workbook.getStyles().getDateStyle()); + if (anonymizerCallback == null){ + dataRow.addCell(col++, testSession.getCreationDate(), workbook.getStyles().getDateStyle()); + } dataRow.addCell(col++, toDurationInMilliseconds(testSession.getDuration()), null); List<ItemInfos> infos = getItemInfos(); @@ -477,14 +483,16 @@ public class QTI21ArchiveFormat { col++; } if (exportConfig.hasTimeCols()) { - col += 2; + col += anonymizerCallback != null ? 1 : 2; } } else { if (exportConfig.hasPointCol()) { dataRow.addCell(col++, itemSession.getScore(), null); } if (exportConfig.hasTimeCols()) { - dataRow.addCell(col++, itemSession.getCreationDate(), workbook.getStyles().getTimeStyle()); + if (anonymizerCallback == null){ + dataRow.addCell(col++, itemSession.getCreationDate(), workbook.getStyles().getTimeStyle()); + } dataRow.addCell(col++, toDurationInMilliseconds(itemSession.getDuration()), null); } }