use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class OLATUpgrade_11_0_0 method processAssessmentPropertyForGTA.
private void processAssessmentPropertyForGTA(Identity assessedIdentity, AssessmentEntryImpl entry, GTACourseNode cNode, RepositoryEntry courseEntry) {
List<Task> tasks = gtaManager.getTasks(assessedIdentity, courseEntry, cNode);
if (tasks != null && tasks.size() > 0) {
Task task = tasks.get(0);
AssessmentEntryStatus status = gtaManager.convertToAssessmentEntrystatus(task, cNode);
entry.setStatus(status.name());
String details = gtaManager.getDetails(assessedIdentity, courseEntry, cNode);
entry.setDetails(details);
}
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project OpenOLAT by OpenOLAT.
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 BinderAssessmentController method loadModel.
private void loadModel() {
List<AssessmentSection> aSections = portfolioService.getAssessmentSections(binder, null);
Map<Section, AssessmentSection> aSectionsMap = new HashMap<>();
for (AssessmentSection aSection : aSections) {
aSectionsMap.put(aSection.getSection(), aSection);
}
// binder done only is an owner is present
// and all owners have done the binder
boolean binderDone = false;
List<Identity> assessedIdentities = portfolioService.getMembers(binder, PortfolioRoles.owner.name());
int countDone = 0;
for (Identity assessedIdentity : assessedIdentities) {
AssessmentEntryStatus status = portfolioService.getAssessmentStatus(assessedIdentity, binder);
if (status == AssessmentEntryStatus.done) {
countDone++;
}
}
binderDone = (countDone > 0 && countDone == assessedIdentities.size());
boolean allClosed = true;
List<Section> sections = portfolioService.getSections(binder);
List<AssessmentSectionWrapper> rows = new ArrayList<>();
Map<Section, AssessmentSectionWrapper> sectionToRows = new HashMap<>();
for (Section section : sections) {
AssessmentSection assessmentSection = aSectionsMap.get(section);
AssessmentSectionWrapper row = new AssessmentSectionWrapper(section, assessmentSection);
sectionToRows.put(section, row);
if (secCallback.canViewAssess(section) || secCallback.canAssess(section)) {
rows.add(row);
}
allClosed &= section.getSectionStatus() == SectionStatus.closed;
}
List<Page> pages = portfolioService.getPages(binder, null);
for (Page page : pages) {
AssessmentSectionWrapper row = sectionToRows.get(page.getSection());
if (row != null) {
row.setNumOfPages(row.getNumOfPages() + 1);
}
}
boolean allowedToAssess = false;
boolean allowedToAssessBinder = secCallback.canAssess(binder);
for (AssessmentSectionWrapper row : rows) {
boolean canAssess = secCallback.canAssess(row.getSection());
if (canAssess && !binderDone) {
forgeAssessmentSection(row);
allowedToAssess = true;
}
}
reopenLink.setVisible(allowedToAssessBinder && binderDone);
saveAndDoneLink.setVisible(allowedToAssessBinder && !binderDone && allClosed);
saveButton.setVisible(allowedToAssess);
cancelButton.setVisible(allowedToAssess);
model.setObjects(rows);
tableEl.reset();
tableEl.reloadData();
}
use of org.olat.modules.assessment.model.AssessmentEntryStatus in project openolat by klemens.
the class OLATUpgrade_11_0_0 method processAssessmentPropertyForGTA.
private void processAssessmentPropertyForGTA(Identity assessedIdentity, AssessmentEntryImpl entry, GTACourseNode cNode, RepositoryEntry courseEntry) {
List<Task> tasks = gtaManager.getTasks(assessedIdentity, courseEntry, cNode);
if (tasks != null && tasks.size() > 0) {
Task task = tasks.get(0);
AssessmentEntryStatus status = gtaManager.convertToAssessmentEntrystatus(task, cNode);
entry.setStatus(status.name());
String details = gtaManager.getDetails(assessedIdentity, courseEntry, cNode);
entry.setDetails(details);
}
}
Aggregations