use of org.olat.core.gui.util.SyntheticUserRequest in project openolat by klemens.
the class HourOfDayStatisticUpdateManagerTest method checkStatistics.
private void checkStatistics(ICourse course, CourseNode node, String date) {
RepositoryEntry re = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
StatisticResult updatedResult = hourOfDayStatisticManager.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 klemens.
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 klemens.
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 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);
}
}
}
}
}
Aggregations