use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method loadModel.
@Override
protected void loadModel(UserRequest ureq) {
super.loadModel(ureq);
if (((IQTESTCourseNode) courseNode).hasQTI21TimeLimit(getReferencedRepositoryEntry())) {
Map<Long, ExtraTimeInfos> extraTimeInfos = getExtraTimes();
List<AssessedIdentityElementRow> rows = usersTableModel.getObjects();
for (AssessedIdentityElementRow row : rows) {
row.setDetails(extraTimeInfos.get(row.getIdentityKey()));
}
}
if (pullButton != null) {
boolean enabled = isTestRunning();
pullButton.setEnabled(enabled);
}
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project openolat by klemens.
the class IdentityListCourseNodeController method getSelectedIdentities.
@Override
public List<IdentityRef> getSelectedIdentities() {
Set<Integer> selections = tableEl.getMultiSelectedIndex();
List<AssessedIdentityElementRow> rows = new ArrayList<>(selections.size());
for (Integer i : selections) {
AssessedIdentityElementRow row = usersTableModel.getObject(i.intValue());
if (row != null && row.getAssessmentStatus() != AssessmentEntryStatus.done) {
rows.add(row);
}
}
if (rows == null || rows.isEmpty()) {
return Collections.emptyList();
}
List<IdentityRef> selectedIdentities = new ArrayList<>();
for (AssessedIdentityElementRow row : rows) {
selectedIdentities.add(new IdentityRefImpl(row.getIdentityKey()));
}
return selectedIdentities;
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project openolat by klemens.
the class IdentityListCourseNodeController method doSetDone.
private void doSetDone(UserRequest ureq) {
Set<Integer> selections = tableEl.getMultiSelectedIndex();
List<AssessedIdentityElementRow> rows = new ArrayList<>(selections.size());
for (Integer i : selections) {
AssessedIdentityElementRow row = usersTableModel.getObject(i.intValue());
if (row != null && row.getAssessmentStatus() != AssessmentEntryStatus.done) {
rows.add(row);
}
}
if (rows == null || rows.isEmpty()) {
showWarning("warning.bulk.done");
} else if (courseNode instanceof AssessableCourseNode) {
ICourse course = CourseFactory.loadCourse(courseEntry);
AssessableCourseNode assessableCourseNode = (AssessableCourseNode) courseNode;
for (AssessedIdentityElementRow row : rows) {
Identity assessedIdentity = securityManager.loadIdentityByKey(row.getIdentityKey());
Roles roles = securityManager.getRoles(assessedIdentity);
IdentityEnvironment identityEnv = new IdentityEnvironment(assessedIdentity, roles);
UserCourseEnvironment assessedUserCourseEnv = new UserCourseEnvironmentImpl(identityEnv, course.getCourseEnvironment(), coachCourseEnv.isCourseReadOnly());
assessedUserCourseEnv.getScoreAccounting().evaluateAll();
ScoreEvaluation scoreEval = assessableCourseNode.getUserScoreEvaluation(assessedUserCourseEnv);
ScoreEvaluation doneEval = new ScoreEvaluation(scoreEval.getScore(), scoreEval.getPassed(), AssessmentEntryStatus.done, null, scoreEval.getFullyAssessed(), scoreEval.getCurrentRunCompletion(), scoreEval.getCurrentRunStatus(), scoreEval.getAssessmentID());
assessableCourseNode.updateUserScoreEvaluation(doneEval, assessedUserCourseEnv, getIdentity(), false, Role.coach);
}
loadModel(ureq);
}
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project openolat by klemens.
the class IdentityListCourseNodeController method doConfirmVisible.
private void doConfirmVisible(UserRequest ureq) {
Set<Integer> selections = tableEl.getMultiSelectedIndex();
List<AssessedIdentityElementRow> rows = new ArrayList<>(selections.size());
for (Integer i : selections) {
AssessedIdentityElementRow row = usersTableModel.getObject(i.intValue());
if (row != null) {
rows.add(row);
}
}
if (rows == null || rows.isEmpty()) {
showWarning("warning.bulk.done");
} else {
changeUserVisibilityCtrl = new ConfirmUserVisibilityController(ureq, getWindowControl(), rows);
listenTo(changeUserVisibilityCtrl);
String title = translate("change.visibility.title");
cmc = new CloseableModalController(getWindowControl(), "close", changeUserVisibilityCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow 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();
}
Aggregations