use of org.olat.modules.assessment.AssessmentEntry in project openolat by klemens.
the class AssessmentItemEditorController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (tabbedPane == source) {
Controller selectedCtrl = tabbedPane.getSelectedController();
if (selectedCtrl instanceof SyncAssessmentItem) {
((SyncAssessmentItem) selectedCtrl).sync(ureq, itemBuilder);
} else if (selectedCtrl == displayCtrl) {
if (testEntry != null) {
AssessmentEntry assessmentEntry = assessmentService.getOrCreateAssessmentEntry(getIdentity(), null, testEntry, null, testEntry);
displayCtrl = new AssessmentItemPreviewController(ureq, getWindowControl(), resolvedAssessmentItem, itemRef, testEntry, assessmentEntry, rootDirectory, itemFile);
} else {
displayCtrl = new AssessmentItemPreviewController(ureq, getWindowControl(), resolvedAssessmentItem, rootDirectory, itemFile);
}
listenTo(displayCtrl);
tabbedPane.replaceTab(displayTabPosition, displayCtrl);
} else if (selectedCtrl == solutionCtrl) {
solutionCtrl = new AssessmentItemPreviewSolutionController(ureq, getWindowControl(), resolvedAssessmentItem, rootDirectory, itemFile);
listenTo(displayCtrl);
tabbedPane.replaceTab(solutionTabPosition, solutionCtrl);
}
}
}
use of org.olat.modules.assessment.AssessmentEntry in project openolat by klemens.
the class QTI21AssessmentDetailsController method doUpdateEntry.
private void doUpdateEntry(AssessmentTestSession session) {
AssessmentEntry assessmentEntry = assessmentService.loadAssessmentEntry(assessedIdentity, entry, null, entry);
assessmentEntry.setScore(session.getFinalScore());
assessmentEntry.setAssessmentId(session.getKey());
assessmentService.updateAssessmentEntry(assessmentEntry);
}
use of org.olat.modules.assessment.AssessmentEntry in project openolat by klemens.
the class IdentityListCourseNodeController method doUpdateCompletion.
private void doUpdateCompletion(Double completion, AssessmentRunStatus status, AssessedIdentityElementRow row) {
row.getCurrentCompletion().setCompletion(completion);
boolean endedRow = row.getCurrentCompletion().isEnded();
boolean endedEvent = status != null && AssessmentRunStatus.done.equals(status);
row.getCurrentCompletion().setEnded(endedEvent);
if (endedEvent && !endedRow) {
IdentityRef assessedIdentity = new IdentityRefImpl(row.getIdentityKey());
AssessmentEntry assessmentEntry = assessmentToolManager.getAssessmentEntries(assessedIdentity, courseEntry, courseNode.getIdent());
row.setAssessmentEntry(assessmentEntry);
tableEl.getComponent().setDirty(true);
}
}
use of org.olat.modules.assessment.AssessmentEntry in project openolat by klemens.
the class IdentityListCourseNodeController method loadModel.
protected void loadModel(@SuppressWarnings("unused") UserRequest ureq) {
SearchAssessedIdentityParams params = getSearchParameters();
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));
List<AssessedIdentityElementRow> rows = new ArrayList<>(assessedIdentities.size());
for (Identity assessedIdentity : assessedIdentities) {
AssessmentEntry entry = entryMap.get(assessedIdentity.getKey());
CompletionItem currentCompletion = new CompletionItem("current-completion-" + (++counter), getLocale());
if (entry != null) {
currentCompletion.setCompletion(entry.getCurrentRunCompletion());
AssessmentRunStatus status = entry.getCurrentRunStatus();
currentCompletion.setEnded(status != null && AssessmentRunStatus.done.equals(status));
}
FormLink toolsLink = uifactory.addFormLink("tools_" + (++counter), "tools", "", null, null, Link.NONTRANSLATED);
toolsLink.setIconLeftCSS("o_icon o_icon_actions o_icon-lg");
AssessedIdentityElementRow row = new AssessedIdentityElementRow(assessedIdentity, entry, currentCompletion, toolsLink, userPropertyHandlers, getLocale());
toolsLink.setUserObject(row);
rows.add(row);
}
usersTableModel.setObjects(rows);
List<FlexiTableFilter> filters = tableEl.getSelectedFilters();
if (filters != null && filters.size() > 0 && filters.get(0) != null) {
usersTableModel.filter(Collections.singletonList(filters.get(0)));
}
tableEl.reset();
tableEl.reloadData();
}
use of org.olat.modules.assessment.AssessmentEntry in project openolat by klemens.
the class GTACoachedGroupGradingController method loadMembers.
private void loadMembers() {
// load participants, load datas
List<Identity> identities = businessGroupService.getMembers(assessedGroup, GroupRoles.participant.name());
Map<Identity, AssessmentEntry> identityToEntryMap = new HashMap<>();
List<AssessmentEntry> assessmentEntries = assessmentManager.getAssessmentEntries(assessedGroup, gtaNode);
for (AssessmentEntry entry : assessmentEntries) {
identityToEntryMap.put(entry.getIdentity(), entry);
}
List<AssessmentRow> rows = new ArrayList<>(identities.size());
for (Identity identity : identities) {
AssessmentEntry entry = identityToEntryMap.get(identity);
AssessmentRow row = new AssessmentRow(identity, false);
rows.add(row);
if (withScore && entry != null) {
String pointVal = AssessmentHelper.getRoundedScore(entry.getScore());
row.setScore(pointVal);
}
if (withPassed && entry != null) {
row.setPassed(entry.getPassed());
}
if (withComment) {
FormLink commentLink = null;
String comment = null;
if (entry != null && StringHelper.containsNonWhitespace(entry.getComment())) {
comment = entry.getComment();
commentLink = uifactory.addFormLink("comment-" + CodeHelper.getRAMUniqueID(), "comment", "comment", null, flc, Link.LINK);
commentLink.setIconLeftCSS("o_icon o_icon_comments");
commentLink.setUserObject(row);
}
row.setComment(comment);
row.setCommentTooltipLink(commentLink);
}
}
model.setObjects(rows);
table.reset();
}
Aggregations