use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doUpdateCourseNode.
private void doUpdateCourseNode(List<AssessmentTestSession> testSessionsToComplete, AssessmentTest assessmentTest, AssessmentEntryStatus status) {
if (testSessionsToComplete == null || testSessionsToComplete.isEmpty())
return;
Double cutValue = QtiNodesExtractor.extractCutValue(assessmentTest);
for (AssessmentTestSession testSession : testSessionsToComplete) {
UserCourseEnvironment assessedUserCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(testSession.getIdentity(), getCourseEnvironment());
ScoreEvaluation scoreEval = ((IQTESTCourseNode) courseNode).getUserScoreEvaluation(assessedUserCourseEnv);
BigDecimal finalScore = testSession.getFinalScore();
Float score = finalScore == null ? null : finalScore.floatValue();
Boolean passed = scoreEval.getPassed();
if (testSession.getManualScore() != null && finalScore != null && cutValue != null) {
boolean calculated = finalScore.compareTo(BigDecimal.valueOf(cutValue.doubleValue())) >= 0;
passed = Boolean.valueOf(calculated);
}
AssessmentEntryStatus finalStatus = status == null ? scoreEval.getAssessmentStatus() : status;
ScoreEvaluation manualScoreEval = new ScoreEvaluation(score, passed, finalStatus, scoreEval.getUserVisible(), scoreEval.getFullyAssessed(), scoreEval.getCurrentRunCompletion(), scoreEval.getCurrentRunStatus(), testSession.getKey());
((IQTESTCourseNode) courseNode).updateUserScoreEvaluation(manualScoreEval, assessedUserCourseEnv, getIdentity(), false, Role.coach);
}
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
the class GTAManagerImpl method convertToAssessmentEntrystatus.
@Override
public AssessmentEntryStatus convertToAssessmentEntrystatus(Task task, GTACourseNode cNode) {
TaskProcess status = task.getTaskStatus();
TaskProcess firstStep = firstStep(cNode);
AssessmentEntryStatus assessmentStatus;
if (status == firstStep) {
assessmentStatus = AssessmentEntryStatus.notStarted;
} else if (status == TaskProcess.review || status == TaskProcess.correction || status == TaskProcess.grading) {
assessmentStatus = AssessmentEntryStatus.inReview;
} else if (status == TaskProcess.graded) {
assessmentStatus = AssessmentEntryStatus.done;
} else {
assessmentStatus = AssessmentEntryStatus.inProgress;
}
return assessmentStatus;
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
the class AssessmentEntryOutcomesListener method updateOutcomes.
@Override
public void updateOutcomes(Float updatedScore, Boolean updatedPassed, Double completion) {
AssessmentEntryStatus assessmentStatus = AssessmentEntryStatus.inProgress;
assessmentEntry.setCompletion(completion);
assessmentEntry.setAssessmentStatus(assessmentStatus);
assessmentEntry = assessmentService.updateAssessmentEntry(assessmentEntry);
boolean firstStart = start.getAndSet(false);
if (firstStart && !authorMode) {
ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_START_AS_RESOURCE, getClass());
}
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
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 klemens.
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