use of org.olat.modules.assessment.model.AssessmentEntryStatus in project openolat by klemens.
the class GTAManagerImpl method syncAssessmentEntry.
private void syncAssessmentEntry(TaskImpl taskImpl, GTACourseNode cNode, Role by) {
if (taskImpl == null || taskImpl.getTaskStatus() == null || cNode == null)
return;
RepositoryEntry courseRepoEntry = taskImpl.getTaskList().getEntry();
AssessmentEntryStatus assessmentStatus = convertToAssessmentEntrystatus(taskImpl, cNode);
if (GTAType.group.name().equals(cNode.getModuleConfiguration().getStringValue(GTACourseNode.GTASK_TYPE))) {
// update whole group
assessmentService.updateAssessmentEntries(taskImpl.getBusinessGroup(), courseRepoEntry, cNode.getIdent(), null, assessmentStatus);
} else {
Identity assessedIdentity = taskImpl.getIdentity();
assessmentService.updateAssessmentEntry(assessedIdentity, courseRepoEntry, cNode.getIdent(), null, assessmentStatus);
dbInstance.commit();
ICourse course = CourseFactory.loadCourse(courseRepoEntry);
UserCourseEnvironment userCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(assessedIdentity, course);
cNode.updateLastModifications(userCourseEnv, taskImpl.getIdentity(), by);
}
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project openolat by klemens.
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 klemens.
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 klemens.
the class AssessmentEntryOutcomesListener method submit.
@Override
public void submit(Float submittedScore, Boolean submittedPass, Double completion, Long assessmentId) {
AssessmentEntryStatus assessmentStatus;
if (needManualCorrection) {
assessmentStatus = AssessmentEntryStatus.inReview;
} else {
assessmentStatus = AssessmentEntryStatus.done;
}
assessmentEntry.setAssessmentStatus(assessmentStatus);
if (submittedScore == null) {
assessmentEntry.setScore(null);
} else {
assessmentEntry.setScore(new BigDecimal(Float.toString(submittedScore)));
}
assessmentEntry.setPassed(submittedPass);
assessmentEntry.setCompletion(completion);
assessmentEntry.setAssessmentId(assessmentId);
assessmentEntry = assessmentService.updateAssessmentEntry(assessmentEntry);
boolean firstClose = close.getAndSet(false);
if (firstClose && !authorMode) {
ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_CLOSE_AS_RESOURCE, getClass());
}
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project openolat by klemens.
the class AssessedIdentityListController method updateModel.
protected void updateModel(String searchString, List<FlexiTableFilter> filters, List<FlexiTableFilter> extendedFilters) {
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(testEntry, null, testEntry, assessmentCallback);
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 (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(searchString);
List<Identity> assessedIdentities = assessmentToolManager.getAssessedIdentities(getIdentity(), params);
List<AssessmentEntry> assessmentEntries = assessmentToolManager.getAssessmentEntries(getIdentity(), params, null);
Map<Long, AssessmentEntry> entryMap = new HashMap<>();
assessmentEntries.stream().filter((entry) -> entry.getIdentity() != null).forEach((entry) -> entryMap.put(entry.getIdentity().getKey(), entry));
Map<Long, Date> initialLaunchDates = userInfosMgr.getInitialLaunchDates(testEntry.getOlatResource());
List<AssessedIdentityElementRow> rows = new ArrayList<>(assessedIdentities.size());
for (Identity assessedIdentity : assessedIdentities) {
AssessmentEntry entry = entryMap.get(assessedIdentity.getKey());
AssessedIdentityElementRow row = new AssessedIdentityElementRow(assessedIdentity, entry, null, null, userPropertyHandlers, getLocale());
row.setInitialCourseLaunchDate(initialLaunchDates.get(assessedIdentity.getKey()));
rows.add(row);
}
usersTableModel.setObjects(rows);
if (filters != null && filters.size() > 0 && filters.get(0) != null) {
usersTableModel.filter(Collections.singletonList(filters.get(0)));
}
tableEl.reloadData();
searchParams = params;
updateTools(assessedIdentities);
}
Aggregations