Search in sources :

Example 6 with SyntheticUserRequest

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);
}
Also used : SyntheticUserRequest(org.olat.core.gui.util.SyntheticUserRequest) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 7 with SyntheticUserRequest

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);
}
Also used : SyntheticUserRequest(org.olat.core.gui.util.SyntheticUserRequest) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 8 with SyntheticUserRequest

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);
                }
            }
        }
    }
}
Also used : SyntheticUserRequest(org.olat.core.gui.util.SyntheticUserRequest) Buddy(org.olat.instantMessaging.model.Buddy)

Example 9 with SyntheticUserRequest

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);
    }
}
Also used : SyntheticUserRequest(org.olat.core.gui.util.SyntheticUserRequest) SyntheticUserRequest(org.olat.core.gui.util.SyntheticUserRequest) UserRequest(org.olat.core.gui.UserRequest)

Example 10 with SyntheticUserRequest

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);
}
Also used : SyntheticUserRequest(org.olat.core.gui.util.SyntheticUserRequest) RepositoryEntry(org.olat.repository.RepositoryEntry)

Aggregations

SyntheticUserRequest (org.olat.core.gui.util.SyntheticUserRequest)14 RepositoryEntry (org.olat.repository.RepositoryEntry)8 UserRequest (org.olat.core.gui.UserRequest)2 Component (org.olat.core.gui.components.Component)2 HighScoreRunController (org.olat.course.highscore.ui.HighScoreRunController)2 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)2 Buddy (org.olat.instantMessaging.model.Buddy)2