diff --git a/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java b/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java index 7bd4e0b8a51c9d239498bb6f1ff138dc61098fff..25b95e9b3f8a3eed5a9e296d5d2894e4cb24e60a 100644 --- a/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java +++ b/src/main/java/org/olat/ims/qti21/resultexport/QTI21ResultsExportMediaResource.java @@ -63,7 +63,6 @@ import org.olat.core.gui.util.SyntheticUserRequest; import org.olat.core.gui.util.WindowControlMocker; import org.olat.core.id.Identity; import org.olat.core.id.Roles; -import org.olat.core.id.UserConstants; import org.olat.core.logging.Tracing; import org.olat.core.util.FileUtils; import org.olat.core.util.Formatter; @@ -284,12 +283,24 @@ public class QTI21ResultsExportMediaResource implements MediaResource { if(identity == null || identity.getStatus() == null || identity.getStatus().equals(Identity.STATUS_DELETED)) { continue; } - String lastNameOrAnoymous = identity.getUser().getLastName(); - if(!StringHelper.containsNonWhitespace(lastNameOrAnoymous)) { - lastNameOrAnoymous = "anonym"; + String nickname = identity.getUser().getNickName(); + String firstName = identity.getUser().getFirstName(); + String lastNameOrAnonymous = identity.getUser().getLastName(); + if(!StringHelper.containsNonWhitespace(lastNameOrAnonymous)) { + lastNameOrAnonymous = "anonym"; } - String lastname = StringHelper.transformDisplayNameToFileSystemName(lastNameOrAnoymous); - String idDir = exportFolderName + "/" + DATA + lastname + "_" + identity.getKey(); + String nameOrAnonymous = lastNameOrAnonymous; + if(StringHelper.containsNonWhitespace(firstName)) { + nameOrAnonymous += "_" + firstName; + } + if(StringHelper.containsNonWhitespace(nickname)) { + nameOrAnonymous += "_" + nickname; + } else { + nameOrAnonymous += "_" + identity.getKey(); + } + + String names = StringHelper.transformDisplayNameToFileSystemName(nameOrAnonymous); + String idDir = exportFolderName + "/" + DATA + names; idDir = idDir.endsWith(SEP) ? idDir : idDir + SEP; createZipDirectory(zout, idDir); @@ -307,8 +318,7 @@ public class QTI21ResultsExportMediaResource implements MediaResource { String linkToUser = idDir.replace(exportFolderName + "/", "") + "index.html"; String memberEmail = userManager.getUserDisplayEmail(identity, ureq.getLocale()); - AssessedMember member = new AssessedMember(identity.getUser().getProperty(UserConstants.NICKNAME, null), - lastNameOrAnoymous, identity.getUser().getFirstName(), + AssessedMember member = new AssessedMember(nickname, lastNameOrAnonymous, firstName, memberEmail, assessments.size(), passed, score, linkToUser); String singleUserInfoHTML = createResultListingHTML(assessments, assessmentDocuments, member); diff --git a/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiListing.html b/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiListing.html index ffeffa5b9c1c3d5114735cd9596b39d472c51d3e..ec085c0cccc04b7f8091311683ed2205ba8eafc2 100644 --- a/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiListing.html +++ b/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiListing.html @@ -21,13 +21,13 @@ <table id='oneUser' class='table table-striped table-hover'> <thead> <tr> - <th>$t.translate("table.all.username")</th> - <th>$t.translate("table.all.lastname")</th> - <th>$t.translate("table.all.firstname")</th> - <th>$t.translate("table.user.email")</th> - <th>$t.translate("table.all.node.score")</th> - <th>$t.translate("table.all.node.passed")</th> - <th>$t.translate("table.all.tries")</th> + <th scope="col">$t.translate("table.all.username")</th> + <th scope="col">$t.translate("table.all.lastname")</th> + <th scope="col">$t.translate("table.all.firstname")</th> + <th scope="col">$t.translate("table.user.email")</th> + <th scope="col">$t.translate("table.all.node.score")</th> + <th scope="col">$t.translate("table.all.node.passed")</th> + <th scope="col">$t.translate("table.all.tries")</th> </tr> </thead> <tbody> @@ -48,17 +48,17 @@ <table id='results' class='table table-striped table-hover'> <thead> <tr> - <th colspan="8">$t.translate("table.test.sessions")</th> + <th colspan="8" scope="col">$t.translate("table.test.sessions")</th> </tr> <tr> - <th>$t.translate("table.user.id")</th> - <th>$t.translate("table.user.date")</th> - <th>$t.translate("table.user.duration")</th> - <th>$t.translate("table.user.score")</th> - <th>$t.translate("table.user.manualScore")</th> - <th>$t.translate("table.user.finalScore")</th> - <th>$t.translate("table.all.passed")</th> - <th>$t.translate("button.show")</th> + <th scope="col">$t.translate("table.user.id")</th> + <th scope="col">$t.translate("table.user.date")</th> + <th scope="col">$t.translate("table.user.duration")</th> + <th scope="col">$t.translate("table.user.score")</th> + <th scope="col">$t.translate("table.user.manualScore")</th> + <th scope="col">$t.translate("table.user.finalScore")</th> + <th scope="col">$t.translate("table.all.passed")</th> + <th scope="col">$t.translate("button.show")</th> </tr> </thead> <tbody> @@ -84,7 +84,7 @@ <table id='assessmentDocuments' class='table table-striped table-hover'> <thead> <tr> - <th>$t.translate("assessment.docs")</th> + <th scope="col">$t.translate("assessment.docs")</th> </tr> </thead> <tbody> diff --git a/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiUserlisting.html b/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiUserlisting.html index bf87ab2ad0238e573010ebd3017368cc26ccc3e3..7a0ba6e2d4ae4a617c464395e13ad2605ff4e6c5 100644 --- a/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiUserlisting.html +++ b/src/main/java/org/olat/ims/qti21/resultexport/_content/qtiUserlisting.html @@ -11,12 +11,12 @@ <table id='allUsers' class='table table-striped table-hover'> <thead> <tr> - <th>$t.translate("table.all.username")</th> - <th>$t.translate("table.all.lastname")</th> - <th>$t.translate("table.all.firstname")</th> - <th>$t.translate("table.all.score")</th> - <th>$t.translate("table.all.passed")</th> - <th>$t.translate("table.all.tries")</th> + <th scope="col">$t.translate("table.all.username")</th> + <th scope="col">$t.translate("table.all.lastname")</th> + <th scope="col">$t.translate("table.all.firstname")</th> + <th scope="col">$t.translate("table.all.score")</th> + <th scope="col">$t.translate("table.all.passed")</th> + <th scope="col">$t.translate("table.all.tries")</th> </tr> </thead> <tbody>