use of org.olat.course.assessment.model.BulkAssessmentFeedback in project openolat by klemens.
the class BulkAssessmentTask method process.
public List<BulkAssessmentFeedback> process() {
List<BulkAssessmentFeedback> feedbacks = new ArrayList<>();
try {
LoggingResourceable infos = LoggingResourceable.wrap(getCourseNode());
ThreadLocalUserActivityLogger.addLoggingResourceInfo(infos);
doProcess(feedbacks);
cleanup();
} catch (Exception e) {
log.error("", e);
feedbacks.add(new BulkAssessmentFeedback("", "bulk.assessment.error"));
} finally {
cleanupUnzip();
}
return feedbacks;
}
use of org.olat.course.assessment.model.BulkAssessmentFeedback in project openolat by klemens.
the class BulkAssessmentTask method renderFeedback.
public static String renderFeedback(List<BulkAssessmentFeedback> feedbacks, Translator translator) {
UserManager userManager = CoreSpringFactory.getImpl(UserManager.class);
StringBuilder sb = new StringBuilder();
for (BulkAssessmentFeedback feedback : feedbacks) {
String errorKey = feedback.getErrorKey();
String msg = translator.translate(errorKey);
String assessedName;
if (feedback.getAssessedIdentity() != null) {
assessedName = userManager.getUserDisplayName(feedback.getAssessedIdentity());
} else {
assessedName = feedback.getAssessedId();
}
sb.append(assessedName).append(": ").append(msg).append("\n");
}
return sb.toString();
}
use of org.olat.course.assessment.model.BulkAssessmentFeedback in project openolat by klemens.
the class BulkAssessmentOverviewController method doUpdateBulkAssessment.
private Feedback doUpdateBulkAssessment(Task task, AssessableCourseNode node, Date scheduledDate, BulkAssessmentDatas datas) {
BulkAssessmentTask runnable = new BulkAssessmentTask(courseEntry.getOlatResource(), node, datas, getIdentity().getKey());
Feedback feedback;
if (scheduledDate == null) {
List<BulkAssessmentFeedback> feedbacks = runnable.process();
feedback = new Feedback(true, feedbacks);
if (task != null) {
taskManager.delete(task);
}
} else {
taskManager.updateAndReturn(task, runnable, getIdentity(), scheduledDate);
feedback = new Feedback(false, null);
}
return feedback;
}
use of org.olat.course.assessment.model.BulkAssessmentFeedback in project openolat by klemens.
the class BulkAssessmentOverviewController method doBulkAssessment.
private Feedback doBulkAssessment(AssessableCourseNode node, Date scheduledDate, BulkAssessmentDatas datas) {
BulkAssessmentTask task = new BulkAssessmentTask(courseEntry.getOlatResource(), node, datas, getIdentity().getKey());
Feedback feedback;
if (scheduledDate == null) {
List<BulkAssessmentFeedback> feedbacks = task.process();
feedback = new Feedback(true, feedbacks);
} else {
taskManager.execute(task, getIdentity(), courseEntry.getOlatResource(), node.getIdent(), scheduledDate);
feedback = new Feedback(false, null);
}
return feedback;
}
Aggregations