use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.
the class DropboxController method getConfirmation.
private String getConfirmation(UserRequest ureq, String filename) {
// grab confirmation-text from bb-config
String confirmation = config.getStringValue(TACourseNode.CONF_DROPBOX_CONFIRMATION);
Context c = new VelocityContext();
Identity identity = ureq.getIdentity();
c.put("login", identity.getName());
c.put("first", identity.getUser().getProperty(UserConstants.FIRSTNAME, getLocale()));
c.put("last", identity.getUser().getProperty(UserConstants.LASTNAME, getLocale()));
c.put("email", UserManager.getInstance().getUserDisplayEmail(identity, getLocale()));
c.put("filename", filename);
Date now = new Date();
Formatter f = Formatter.getInstance(ureq.getLocale());
c.put("date", f.formatDate(now));
c.put("time", f.formatTime(now));
// update attempts counter for this user: one file - one attempts
AssessableCourseNode acn = (AssessableCourseNode) node;
acn.incrementUserAttempts(userCourseEnv, Role.user);
// log entry for this file
UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
am.appendToUserNodeLog(node, identity, identity, "FILE UPLOADED: " + filename);
return VelocityHelper.getInstance().evaluateVTL(confirmation, c);
}
Aggregations