use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.
the class CheckListRunController method exposeUserDataToVC.
private void exposeUserDataToVC(UserRequest ureq, FormLayoutContainer layoutCont) {
AssessmentEntry scoreEval = courseNode.getUserAssessmentEntry(userCourseEnv);
if (scoreEval == null) {
layoutCont.contextPut("score", null);
layoutCont.contextPut("hasPassedValue", Boolean.FALSE);
layoutCont.contextPut("passed", null);
layoutCont.contextPut("comment", null);
layoutCont.contextPut("docs", null);
} else {
boolean resultsVisible = scoreEval.getUserVisibility() == null || scoreEval.getUserVisibility().booleanValue();
layoutCont.contextPut("resultsVisible", resultsVisible);
layoutCont.contextPut("score", AssessmentHelper.getRoundedScore(scoreEval.getScore()));
layoutCont.contextPut("hasPassedValue", (scoreEval.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
layoutCont.contextPut("passed", scoreEval.getPassed());
if (resultsVisible) {
if (courseNode.hasCommentConfigured()) {
StringBuilder comment = Formatter.stripTabsAndReturns(scoreEval.getComment());
layoutCont.contextPut("comment", StringHelper.xssScan(comment));
layoutCont.contextPut("in-comment", isPanelOpen(ureq, "comment", true));
}
if (courseNode.hasIndividualAsssessmentDocuments()) {
List<File> docs = courseNode.getIndividualAssessmentDocuments(userCourseEnv);
String mapperUri = registerCacheableMapper(ureq, null, new DocumentsMapper(docs));
layoutCont.contextPut("docsMapperUri", mapperUri);
layoutCont.contextPut("docs", docs);
layoutCont.contextPut("in-assessmentDocuments", isPanelOpen(ureq, "assessmentDocuments", true));
}
} else {
layoutCont.contextPut("comment", null);
layoutCont.contextPut("docs", null);
}
}
UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
layoutCont.contextPut("log", am.getUserNodeLog(courseNode, userCourseEnv.getIdentityEnvironment().getIdentity()));
}
use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.
the class IQRunController method exposeUserTestDataToVC.
private void exposeUserTestDataToVC(UserRequest ureq) {
// config : show score info
Object enableScoreInfoObject = modConfig.get(IQEditController.CONFIG_KEY_ENABLESCOREINFO);
if (enableScoreInfoObject != null) {
myContent.contextPut("enableScoreInfo", enableScoreInfoObject);
} else {
myContent.contextPut("enableScoreInfo", Boolean.TRUE);
}
// configuration data
myContent.contextPut("attemptsConfig", modConfig.get(IQEditController.CONFIG_KEY_ATTEMPTS));
// user data
Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
if (courseNode instanceof PersistentAssessableCourseNode) {
PersistentAssessableCourseNode acn = (PersistentAssessableCourseNode) courseNode;
AssessmentEntry assessmentEntry = acn.getUserAssessmentEntry(userCourseEnv);
if (assessmentEntry == null) {
myContent.contextPut("blockAfterSuccess", Boolean.FALSE);
myContent.contextPut("score", null);
myContent.contextPut("hasPassedValue", Boolean.FALSE);
myContent.contextPut("passed", Boolean.FALSE);
myContent.contextPut("comment", null);
myContent.contextPut("docs", null);
myContent.contextPut("attempts", 0);
} else {
// block if test passed (and config set to check it)
Boolean blockAfterSuccess = modConfig.getBooleanEntry(IQEditController.CONFIG_KEY_BLOCK_AFTER_SUCCESS);
Boolean blocked = Boolean.FALSE;
if (blockAfterSuccess != null && blockAfterSuccess.booleanValue()) {
Boolean passed = assessmentEntry.getPassed();
if (passed != null && passed.booleanValue()) {
blocked = Boolean.TRUE;
}
}
myContent.contextPut("blockAfterSuccess", blocked);
boolean resultsVisible = assessmentEntry.getUserVisibility() == null || assessmentEntry.getUserVisibility().booleanValue();
myContent.contextPut("resultsVisible", resultsVisible);
myContent.contextPut("score", AssessmentHelper.getRoundedScore(assessmentEntry.getScore()));
myContent.contextPut("hasPassedValue", (assessmentEntry.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
myContent.contextPut("passed", assessmentEntry.getPassed());
if (resultsVisible) {
if (acn.hasCommentConfigured()) {
StringBuilder comment = Formatter.stripTabsAndReturns(assessmentEntry.getComment());
myContent.contextPut("comment", StringHelper.xssScan(comment));
myContent.contextPut("in-comment", isPanelOpen(ureq, "comment", true));
}
if (acn.hasIndividualAsssessmentDocuments()) {
List<File> docs = acn.getIndividualAssessmentDocuments(userCourseEnv);
String mapperUri = registerCacheableMapper(ureq, null, new DocumentsMapper(docs));
myContent.contextPut("docsMapperUri", mapperUri);
myContent.contextPut("docs", docs);
myContent.contextPut("in-assessmentDocuments", isPanelOpen(ureq, "assessmentDocuments", true));
}
}
myContent.contextPut("attempts", assessmentEntry.getAttempts() == null ? 0 : assessmentEntry.getAttempts());
}
}
UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
myContent.contextPut("log", am.getUserNodeLog(courseNode, identity));
exposeResults(ureq);
}
use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.
the class MSCourseNodeRunController method exposeUserDataToVC.
private void exposeUserDataToVC(UserRequest ureq) {
AssessmentEntry assessmentEntry = courseNode.getUserAssessmentEntry(userCourseEnv);
if (assessmentEntry == null) {
myContent.contextPut("hasPassedValue", Boolean.FALSE);
myContent.contextPut("passed", Boolean.FALSE);
hasPassed = hasScore = hasComment = false;
} else {
String rawComment = assessmentEntry.getComment();
hasPassed = assessmentEntry.getPassed() != null;
hasScore = assessmentEntry.getScore() != null;
hasComment = courseNode.hasCommentConfigured() && StringHelper.containsNonWhitespace(rawComment);
boolean resultsVisible = overrideUserResultsVisiblity || assessmentEntry.getUserVisibility() == null || assessmentEntry.getUserVisibility().booleanValue();
myContent.contextPut("resultsVisible", resultsVisible);
myContent.contextPut("score", AssessmentHelper.getRoundedScore(assessmentEntry.getScore()));
myContent.contextPut("hasPassedValue", (assessmentEntry.getPassed() == null ? Boolean.FALSE : Boolean.TRUE));
myContent.contextPut("passed", assessmentEntry.getPassed());
if (resultsVisible) {
if (hasComment) {
StringBuilder comment = Formatter.stripTabsAndReturns(rawComment);
myContent.contextPut("comment", StringHelper.xssScan(comment));
myContent.contextPut("in-comment", isPanelOpen(ureq, "comment", true));
}
if (courseNode.hasIndividualAsssessmentDocuments()) {
List<File> docs = courseNode.getIndividualAssessmentDocuments(userCourseEnv);
mapperUri = registerCacheableMapper(ureq, null, new DocumentsMapper(docs));
myContent.contextPut("docsMapperUri", mapperUri);
myContent.contextPut("docs", docs);
myContent.contextPut("in-assessmentDocuments", isPanelOpen(ureq, "assessmentDocuments", true));
if (download == null) {
download = new DisplayOrDownloadComponent("", null);
myContent.put("download", download);
}
}
}
}
if (showLog) {
UserNodeAuditManager am = userCourseEnv.getCourseEnvironment().getAuditManager();
myContent.contextPut("log", am.getUserNodeLog(courseNode, userCourseEnv.getIdentityEnvironment().getIdentity()));
}
}
use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.
the class ProjectBrokerCourseNode method getUserLog.
/**
* @see org.olat.course.nodes.AssessableCourseNode#getUserLog(org.olat.course.run.userview.UserCourseEnvironment)
*/
@Override
public String getUserLog(UserCourseEnvironment userCourseEnvironment) {
UserNodeAuditManager am = userCourseEnvironment.getCourseEnvironment().getAuditManager();
String logValue = am.getUserNodeLog(this, userCourseEnvironment.getIdentityEnvironment().getIdentity());
return logValue;
}
use of org.olat.course.auditing.UserNodeAuditManager in project openolat by klemens.
the class ScormCourseNode method getUserLog.
/**
* @see org.olat.course.nodes.AssessableCourseNode#getUserLog(org.olat.course.run.userview.UserCourseEnvironment)
*/
@Override
public String getUserLog(UserCourseEnvironment userCourseEnvironment) {
UserNodeAuditManager am = userCourseEnvironment.getCourseEnvironment().getAuditManager();
Identity mySelf = userCourseEnvironment.getIdentityEnvironment().getIdentity();
String logValue = am.getUserNodeLog(this, mySelf);
return logValue;
}
Aggregations