use of org.olat.modules.assessment.model.AssessmentRunStatus in project OpenOLAT by OpenOLAT.
the class AssessmentEvaluation method toAssessmentEvalutation.
public static final AssessmentEvaluation toAssessmentEvalutation(AssessmentEntry entry, AssessableCourseNode node) {
if (entry == null) {
return AssessmentEvaluation.EMPTY_EVAL;
}
Integer attempts = null;
if (node.hasAttemptsConfigured()) {
attempts = entry.getAttempts();
}
Float score = null;
if (node.hasScoreConfigured()) {
score = entry.getScore() == null ? null : entry.getScore().floatValue();
}
Boolean passed = null;
if (node.hasPassedConfigured()) {
passed = entry.getPassed();
}
String comment = null;
if (node.hasCommentConfigured()) {
comment = entry.getComment();
}
Double currentRunCompletion = null;
AssessmentRunStatus runStatus = null;
if (node.hasCompletion()) {
currentRunCompletion = entry.getCurrentRunCompletion();
runStatus = entry.getCurrentRunStatus();
}
return new AssessmentEvaluation(score, passed, attempts, entry.getAssessmentStatus(), entry.getUserVisibility(), entry.getFullyAssessed(), currentRunCompletion, runStatus, entry.getAssessmentId(), comment, entry.getCoachComment(), entry.getNumberOfAssessmentDocuments(), entry.getLastModified(), entry.getLastUserModified(), entry.getLastCoachModified());
}
use of org.olat.modules.assessment.model.AssessmentRunStatus in project OpenOLAT by OpenOLAT.
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.model.AssessmentRunStatus 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.model.AssessmentRunStatus in project openolat by klemens.
the class AssessmentEvaluation method toAssessmentEvalutation.
public static final AssessmentEvaluation toAssessmentEvalutation(AssessmentEntry entry, AssessableCourseNode node) {
if (entry == null) {
return AssessmentEvaluation.EMPTY_EVAL;
}
Integer attempts = null;
if (node.hasAttemptsConfigured()) {
attempts = entry.getAttempts();
}
Float score = null;
if (node.hasScoreConfigured()) {
score = entry.getScore() == null ? null : entry.getScore().floatValue();
}
Boolean passed = null;
if (node.hasPassedConfigured()) {
passed = entry.getPassed();
}
String comment = null;
if (node.hasCommentConfigured()) {
comment = entry.getComment();
}
Double currentRunCompletion = null;
AssessmentRunStatus runStatus = null;
if (node.hasCompletion()) {
currentRunCompletion = entry.getCurrentRunCompletion();
runStatus = entry.getCurrentRunStatus();
}
return new AssessmentEvaluation(score, passed, attempts, entry.getAssessmentStatus(), entry.getUserVisibility(), entry.getFullyAssessed(), currentRunCompletion, runStatus, entry.getAssessmentId(), comment, entry.getCoachComment(), entry.getNumberOfAssessmentDocuments(), entry.getLastModified(), entry.getLastUserModified(), entry.getLastCoachModified());
}
Aggregations