use of org.olat.course.assessment.AssessmentManager in project OpenOLAT by OpenOLAT.
the class GTACourseNode method getUserAssessmentEntry.
@Override
public AssessmentEntry getUserAssessmentEntry(UserCourseEnvironment userCourseEnv) {
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
Identity mySelf = userCourseEnv.getIdentityEnvironment().getIdentity();
return am.getAssessmentEntry(this, mySelf);
}
use of org.olat.course.assessment.AssessmentManager in project OpenOLAT by OpenOLAT.
the class GTACourseNode method getUserAttempts.
@Override
public Integer getUserAttempts(UserCourseEnvironment userCourseEnv) {
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
Identity assessedIdentity = userCourseEnv.getIdentityEnvironment().getIdentity();
return am.getNodeAttempts(this, assessedIdentity);
}
use of org.olat.course.assessment.AssessmentManager in project OpenOLAT by OpenOLAT.
the class PortfolioCourseNodeRunController method updateAssessmentInfos.
private void updateAssessmentInfos(UserRequest ureq, Date returnDate) {
if (returnDate != null || copyBinder != null) {
String rDate = formatter.formatDateAndTime(returnDate);
uifactory.addStaticTextElement("map.returnDate", rDate, infosContainer);
// Fetch all score and passed and calculate score accounting for the entire course
ScoreAccounting scoreAccounting = userCourseEnv.getScoreAccounting();
scoreAccounting.evaluateAll();
ScoreEvaluation scoreEval = scoreAccounting.evalCourseNode(courseNode);
boolean resultsVisible = scoreEval.getUserVisible() == null || scoreEval.getUserVisible().booleanValue();
assessmentInfosContainer.contextPut("resultsVisible", resultsVisible);
// score
assessmentInfosContainer.contextPut("hasScoreField", new Boolean(courseNode.hasScoreConfigured()));
if (courseNode.hasScoreConfigured()) {
Float score = scoreEval.getScore();
Float minScore = courseNode.getMinScoreConfiguration();
Float maxScore = courseNode.getMaxScoreConfiguration();
assessmentInfosContainer.contextPut("scoreMin", AssessmentHelper.getRoundedScore(minScore));
assessmentInfosContainer.contextPut("scoreMax", AssessmentHelper.getRoundedScore(maxScore));
assessmentInfosContainer.contextPut("score", AssessmentHelper.getRoundedScore(score));
}
// passed
assessmentInfosContainer.contextPut("hasPassedField", new Boolean(courseNode.hasPassedConfigured()));
if (courseNode.hasPassedConfigured()) {
Boolean passed = scoreEval.getPassed();
assessmentInfosContainer.contextPut("passed", passed);
assessmentInfosContainer.contextPut("hasPassedValue", new Boolean(passed != null));
Float cutValue = courseNode.getCutValueConfiguration();
assessmentInfosContainer.contextPut("passedCutValue", AssessmentHelper.getRoundedScore(cutValue));
}
// get comment
if (resultsVisible) {
if (courseNode.hasCommentConfigured()) {
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
String comment = am.getNodeComment(courseNode, getIdentity());
assessmentInfosContainer.contextPut("comment", comment);
assessmentInfosContainer.contextPut("in-comment", isPanelOpen(ureq, "comment", true));
}
if (courseNode.hasIndividualAsssessmentDocuments()) {
List<File> docs = courseNode.getIndividualAssessmentDocuments(userCourseEnv);
String mapperUri = registerCacheableMapper(ureq, null, new DocumentsMapper(docs));
assessmentInfosContainer.contextPut("docsMapperUri", mapperUri);
assessmentInfosContainer.contextPut("docs", docs);
assessmentInfosContainer.contextPut("in-assessmentDocuments", isPanelOpen(ureq, "assessmentDocuments", true));
}
}
assessmentInfosContainer.setVisible(true);
} else {
assessmentInfosContainer.setVisible(false);
}
}
use of org.olat.course.assessment.AssessmentManager in project OpenOLAT by OpenOLAT.
the class IQRunController method submitAssessment.
@Override
public void submitAssessment(AssessmentInstance ai) {
if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_ASSESS)) {
AssessmentContext ac = ai.getAssessmentContext();
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
Boolean fullyAssed = am.getNodeFullyAssessed(courseNode, getIdentity());
String correctionMode = courseNode.getModuleConfiguration().getStringValue(IQEditController.CONFIG_CORRECTION_MODE);
Boolean userVisibility;
AssessmentEntryStatus assessmentStatus;
if (IQEditController.CORRECTION_MANUAL.equals(correctionMode)) {
assessmentStatus = AssessmentEntryStatus.inReview;
userVisibility = Boolean.FALSE;
} else {
assessmentStatus = AssessmentEntryStatus.done;
userVisibility = Boolean.TRUE;
}
ScoreEvaluation sceval = new ScoreEvaluation(ac.getScore(), ac.isPassed(), assessmentStatus, userVisibility, fullyAssed, null, null, ai.getAssessID());
// assessment nodes are assessable
AssessableCourseNode acn = (AssessableCourseNode) courseNode;
acn.updateUserScoreEvaluation(sceval, userCourseEnv, getIdentity(), true, Role.user);
// Mark publisher for notifications
Long courseId = userCourseEnv.getCourseEnvironment().getCourseResourceableId();
assessmentNotificationsHandler.markPublisherNews(getIdentity(), courseId);
if (!assessmentStopped) {
assessmentStopped = true;
AssessmentEvent assessmentStoppedEvent = new AssessmentEvent(AssessmentEvent.TYPE.STOPPED, userSession);
singleUserEventCenter.deregisterFor(this, assessmentInstanceOres);
singleUserEventCenter.fireEventToListenersOf(assessmentStoppedEvent, assessmentEventOres);
}
} else if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY)) {
// save number of attempts
// although this is not an assessable node we still use the assessment
// manager since this one uses caching
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
am.incrementNodeAttempts(courseNode, getIdentity(), userCourseEnv, Role.user);
} else if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_SELF)) {
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
am.incrementNodeAttempts(courseNode, getIdentity(), userCourseEnv, Role.user);
}
}
use of org.olat.course.assessment.AssessmentManager in project OpenOLAT by OpenOLAT.
the class IQRunController method exposeUserQuestionnaireDataToVC.
private void exposeUserQuestionnaireDataToVC() {
AssessmentManager am = userCourseEnv.getCourseEnvironment().getAssessmentManager();
Identity identity = userCourseEnv.getIdentityEnvironment().getIdentity();
// although this is not an assessable node we still use the assessment
// manager since this one uses caching
myContent.contextPut("attempts", am.getNodeAttempts(courseNode, identity));
}
Aggregations