use of org.olat.modules.assessment.model.AssessmentEntryStatus in project openolat by klemens.
the class IQTESTCourseNode method pullAssessmentTestSession.
public void pullAssessmentTestSession(AssessmentTestSession session, UserCourseEnvironment assessedUserCourseenv, Identity coachingIdentity, Role by) {
Boolean visibility;
AssessmentEntryStatus assessmentStatus;
if (IQEditController.CORRECTION_MANUAL.equals(getModuleConfiguration().getStringValue(IQEditController.CONFIG_CORRECTION_MODE))) {
assessmentStatus = AssessmentEntryStatus.inReview;
visibility = Boolean.FALSE;
} else {
assessmentStatus = AssessmentEntryStatus.done;
visibility = Boolean.TRUE;
}
ScoreEvaluation sceval = new ScoreEvaluation(session.getScore().floatValue(), session.getPassed(), assessmentStatus, visibility, Boolean.TRUE, 1.0d, AssessmentRunStatus.done, session.getKey());
updateUserScoreEvaluation(sceval, assessedUserCourseenv, coachingIdentity, true, by);
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project openolat by klemens.
the class IdentityListCourseNodeController method getSearchParameters.
protected SearchAssessedIdentityParams getSearchParameters() {
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(courseEntry, courseNode.getIdent(), referenceEntry, assessmentCallback);
List<FlexiTableFilter> filters = tableEl.getSelectedFilters();
List<FlexiTableFilter> extendedFilters = tableEl.getSelectedExtendedFilters();
List<AssessmentEntryStatus> assessmentStatus = null;
if (filters != null && filters.size() > 0) {
assessmentStatus = new ArrayList<>(filters.size());
for (FlexiTableFilter filter : filters) {
if ("passed".equals(filter.getFilter())) {
params.setPassed(true);
} else if ("failed".equals(filter.getFilter())) {
params.setFailed(true);
} else if (AssessmentEntryStatus.isValueOf(filter.getFilter())) {
assessmentStatus.add(AssessmentEntryStatus.valueOf(filter.getFilter()));
}
}
}
params.setAssessmentStatus(assessmentStatus);
List<Long> businessGroupKeys = null;
if (group != null) {
businessGroupKeys = Collections.singletonList(group.getKey());
} else if (extendedFilters != null && extendedFilters.size() > 0) {
businessGroupKeys = new ArrayList<>(extendedFilters.size());
for (FlexiTableFilter extendedFilter : extendedFilters) {
if (StringHelper.isLong(extendedFilter.getFilter())) {
businessGroupKeys.add(Long.parseLong(extendedFilter.getFilter()));
}
}
}
params.setBusinessGroupKeys(businessGroupKeys);
params.setSearchString(tableEl.getQuickSearchString());
return params;
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
the class OLATUpgrade_11_0_0 method processAssessmentPropertyForTA.
/**
* Search first for the status of the task, if not found, see if some documents
* where dropped or returned, in this case, the status is in review, if not
* the status is not started.
*
* @param assessedIdentity
* @param entry
* @param tNode
* @param course
*/
private void processAssessmentPropertyForTA(Identity assessedIdentity, AssessmentEntryImpl entry, TACourseNode tNode, ICourse course) {
List<Property> samples = course.getCourseEnvironment().getCoursePropertyManager().findCourseNodeProperties(tNode, assessedIdentity, null, TaskController.PROP_ASSIGNED);
if (samples.size() > 0) {
String details = samples.get(0).getStringValue();
entry.setDetails(details);
}
Property statusProperty = course.getCourseEnvironment().getCoursePropertyManager().findCourseNodeProperty(tNode, assessedIdentity, null, StatusManager.PROPERTY_KEY_STATUS);
AssessmentEntryStatus assessmentStatus = null;
if (statusProperty != null) {
String status = statusProperty.getStringValue();
if (status != null) {
switch(status) {
case StatusForm.STATUS_VALUE_NOT_OK:
assessmentStatus = AssessmentEntryStatus.inProgress;
break;
case StatusForm.STATUS_VALUE_OK:
assessmentStatus = AssessmentEntryStatus.done;
break;
case StatusForm.STATUS_VALUE_WORKING_ON:
assessmentStatus = AssessmentEntryStatus.inProgress;
break;
case StatusForm.STATUS_VALUE_UNDEFINED:
assessmentStatus = AssessmentEntryStatus.inProgress;
break;
}
}
}
if (assessmentStatus == null) {
String dropbox = DropboxController.getDropboxPathRelToFolderRoot(course.getCourseEnvironment(), tNode) + File.separator + assessedIdentity.getName();
OlatRootFolderImpl dropBox = new OlatRootFolderImpl(dropbox, null);
boolean hasDropped = (dropBox.getBasefile().exists() && dropBox.getBasefile().listFiles(SystemFileFilter.FILES_ONLY).length > 0);
String returnbox = ReturnboxController.getReturnboxPathRelToFolderRoot(course.getCourseEnvironment(), tNode) + File.separator + assessedIdentity.getName();
OlatRootFolderImpl returnBox = new OlatRootFolderImpl(returnbox, null);
boolean hasReturned = (returnBox.getBasefile().exists() && returnBox.getBasefile().listFiles(SystemFileFilter.FILES_ONLY).length > 0);
if (hasReturned || hasDropped) {
assessmentStatus = AssessmentEntryStatus.inReview;
} else {
assessmentStatus = AssessmentEntryStatus.notStarted;
}
}
entry.setAssessmentStatus(assessmentStatus);
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
the class QTI21AssessmentRunController method submit.
@Override
public void submit(Float score, Boolean pass, Double completion, Long assessmentId) {
if (anonym) {
assessmentNotificationsHandler.markPublisherNews(getIdentity(), userCourseEnv.getCourseEnvironment().getCourseResourceableId());
return;
}
if (courseNode instanceof IQTESTCourseNode) {
Boolean visibility;
AssessmentEntryStatus assessmentStatus;
if (IQEditController.CORRECTION_MANUAL.equals(courseNode.getModuleConfiguration().getStringValue(IQEditController.CONFIG_CORRECTION_MODE))) {
assessmentStatus = AssessmentEntryStatus.inReview;
visibility = Boolean.FALSE;
} else {
assessmentStatus = AssessmentEntryStatus.done;
visibility = Boolean.TRUE;
}
ScoreEvaluation sceval = new ScoreEvaluation(score, pass, assessmentStatus, visibility, Boolean.TRUE, completion, AssessmentRunStatus.done, assessmentId);
boolean increment = incrementAttempts.getAndSet(false);
((IQTESTCourseNode) courseNode).updateUserScoreEvaluation(sceval, userCourseEnv, getIdentity(), increment, Role.user);
if (increment) {
ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_CLOSE_IN_COURSE, getClass());
}
coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new CompletionEvent(CompletionEvent.PROGRESS, courseNode.getIdent(), completion, AssessmentRunStatus.done, getIdentity().getKey()), userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
assessmentNotificationsHandler.markPublisherNews(getIdentity(), userCourseEnv.getCourseEnvironment().getCourseResourceableId());
} else if (courseNode instanceof SelfAssessableCourseNode) {
boolean increment = incrementAttempts.getAndSet(false);
if (increment) {
((SelfAssessableCourseNode) courseNode).incrementUserAttempts(userCourseEnv, Role.user);
}
}
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
the class PortfolioServiceImpl method updateAssessmentEntry.
private void updateAssessmentEntry(Identity assessedIdentity, Binder binder, Set<AssessmentSection> assessmentSections, Identity coachingIdentity) {
boolean allPassed = true;
int totalSectionPassed = 0;
int totalSectionClosed = 0;
BigDecimal totalScore = new BigDecimal("0.0");
AssessmentEntryStatus binderStatus = null;
for (AssessmentSection assessmentSection : assessmentSections) {
if (assessmentSection.getScore() != null) {
totalScore = totalScore.add(assessmentSection.getScore());
}
if (assessmentSection.getPassed() != null && assessmentSection.getPassed().booleanValue()) {
allPassed &= true;
totalSectionPassed++;
}
Section section = assessmentSection.getSection();
if (section.getSectionStatus() == SectionStatus.closed) {
totalSectionClosed++;
}
}
Boolean totalPassed = null;
if (totalSectionClosed == assessmentSections.size()) {
totalPassed = new Boolean(allPassed);
} else {
if (assessmentSections.size() == totalSectionPassed) {
totalPassed = Boolean.TRUE;
}
binderStatus = AssessmentEntryStatus.inProgress;
}
// order status from the entry / section
RepositoryEntry entry = binder.getEntry();
if ("CourseModule".equals(entry.getOlatResource().getResourceableTypeName())) {
ICourse course = CourseFactory.loadCourse(entry);
CourseNode courseNode = course.getRunStructure().getNode(binder.getSubIdent());
if (courseNode instanceof PortfolioCourseNode) {
PortfolioCourseNode pfNode = (PortfolioCourseNode) courseNode;
ScoreEvaluation scoreEval = new ScoreEvaluation(totalScore.floatValue(), totalPassed, binderStatus, true, true, null, null, binder.getKey());
UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course);
pfNode.updateUserScoreEvaluation(scoreEval, userCourseEnv, coachingIdentity, false, Role.coach);
}
} else {
OLATResource resource = ((BinderImpl) binder.getTemplate()).getOlatResource();
RepositoryEntry referenceEntry = repositoryService.loadByResourceKey(resource.getKey());
AssessmentEntry assessmentEntry = assessmentService.getOrCreateAssessmentEntry(assessedIdentity, null, binder.getEntry(), binder.getSubIdent(), referenceEntry);
assessmentEntry.setScore(totalScore);
assessmentEntry.setPassed(totalPassed);
assessmentEntry.setAssessmentStatus(binderStatus);
assessmentService.updateAssessmentEntry(assessmentEntry);
}
}
Aggregations