use of org.olat.core.gui.util.SyntheticUserRequest in project openolat by klemens.
the class DayOfWeekStatisticUpdateManagerTest method checkStatistics.
private void checkStatistics(ICourse course, CourseNode node, String date) {
RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
StatisticResult updatedResult = dayOfWeekStatisticManager.generateStatisticResult(new SyntheticUserRequest(null, Locale.ENGLISH), course, re.getKey());
Map<String, Integer> updatedRootStats = updatedResult.getStatistics(node);
Integer updated_stats_inMemory = getInMemoryStatistics(re, node, date);
Integer updated_stats_today = updatedRootStats.get(date);
Assert.assertEquals(updated_stats_inMemory, updated_stats_today);
}
use of org.olat.core.gui.util.SyntheticUserRequest in project OpenOLAT by OpenOLAT.
the class WeeklyStatisticUpdateManagerTest method checkStatistics.
private void checkStatistics(ICourse course, CourseNode node, String date) {
RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
StatisticResult updatedResult = weeklyStatisticManager.generateStatisticResult(new SyntheticUserRequest(null, Locale.ENGLISH), course, re.getKey());
Map<String, Integer> updatedRootStats = updatedResult.getStatistics(node);
Assert.assertNotNull(updatedRootStats);
Integer updated_stats_inMemory = getInMemoryStatistics(re, node, date);
Integer updated_stats_today = updatedRootStats.get(date);
Assert.assertEquals(updated_stats_inMemory, updated_stats_today);
}
use of org.olat.core.gui.util.SyntheticUserRequest in project OpenOLAT by OpenOLAT.
the class InstantMessagingMainController method processInstantMessageEvent.
private void processInstantMessageEvent(InstantMessagingEvent imEvent) {
if (imEvent.getCommand().equals("message")) {
// user receives messages from an other user
Long fromId = imEvent.getFromId();
if (!chatMgrCtrl.hasRunningChat(imEvent.getChatResource())) {
// add follow up message to info holder
if (!showNewMessageHolder.contains(fromId)) {
Buddy buddy = imService.getBuddyById(fromId);
if (Presence.available.name().equals(imStatus) && !inAssessment) {
doOpenPrivateChat(new SyntheticUserRequest(getIdentity(), getLocale()), buddy);
} else {
showNewMessageHolder.add(fromId);
createShowNewMessageLink(buddy);
}
}
}
}
}
use of org.olat.core.gui.util.SyntheticUserRequest in project OpenOLAT by OpenOLAT.
the class QTI12EditorController method event.
@Override
public void event(Event event) {
if (event == Event.CHANGED_EVENT) {
UserRequest ureq = new SyntheticUserRequest(getIdentity(), getLocale());
updateQuestionItem(ureq, item);
}
}
use of org.olat.core.gui.util.SyntheticUserRequest in project openolat by klemens.
the class DailyStatisticUpdateManagerTest method checkStatistics.
private void checkStatistics(ICourse course, CourseNode node, String date) {
RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
StatisticResult updatedResult = dailyStatisticManager.generateStatisticResult(new SyntheticUserRequest(null, Locale.ENGLISH), course, re.getKey());
Map<String, Integer> updatedRootStats = updatedResult.getStatistics(node);
Integer updated_stats_inMemory = getInMemoryStatistics(re, node, date);
Integer updated_stats_today = updatedRootStats.get(date);
Assert.assertEquals(updated_stats_inMemory, updated_stats_today);
}
Aggregations