Search in sources :

Example 26 with TextAssessmentEvent

use of de.tum.in.www1.artemis.domain.analytics.TextAssessmentEvent in project Artemis by ls1intum.

the class TutorEffortIntegrationTest method testCalculateTutorEffortsDistance5Minutes.

/**
 * Tests the TutorEffortResource.calculateTutorEffort method with a scenario involving a distance
 * between timestamps of 5 minutes.
 * @throws Exception
 */
@Test
@WithMockUser(username = "instructor", roles = "INSTRUCTOR")
public void testCalculateTutorEffortsDistance5Minutes() throws Exception {
    List<TextAssessmentEvent> events = createTextAssessmentEventsInIntervals(6, 5);
    textAssessmentEventRepository.saveAll(events);
    List<TutorEffort> tutorEfforts = request.getList("/api/courses/" + course.getId() + "/exercises/" + exercise.getId() + "/tutor-effort", HttpStatus.OK, TutorEffort.class);
    TutorEffort effortExpected = createTutorEffortObject(25);
    assertThat(tutorEfforts).isNotNull().hasSize(1);
    assertThat(tutorEfforts.get(0)).usingRecursiveComparison().isEqualTo(effortExpected);
}
Also used : TutorEffort(de.tum.in.www1.artemis.domain.statistics.tutor.effort.TutorEffort) TextAssessmentEvent(de.tum.in.www1.artemis.domain.analytics.TextAssessmentEvent) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.jupiter.api.Test)

Aggregations

TextAssessmentEvent (de.tum.in.www1.artemis.domain.analytics.TextAssessmentEvent)22 WithMockUser (org.springframework.security.test.context.support.WithMockUser)14 TutorEffort (de.tum.in.www1.artemis.domain.statistics.tutor.effort.TutorEffort)10 Test (org.junit.jupiter.api.Test)6 Exercise (de.tum.in.www1.artemis.domain.Exercise)2 TextSubmission (de.tum.in.www1.artemis.domain.TextSubmission)2 Instant (java.time.Instant)2 List (java.util.List)2