Search in sources :

Example 1 with IndividualLearningGoalProgress

use of de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress in project ArTEMiS by ls1intum.

the class LearningGoalIntegrationTest method getLearningGoalProgress_asTeam1Student1_shouldReturnProgressTenOutOfThirty.

@Test
@WithMockUser(username = "team1student1", roles = "USER")
public void getLearningGoalProgress_asTeam1Student1_shouldReturnProgressTenOutOfThirty() throws Exception {
    IndividualLearningGoalProgress individualLearningGoalProgress = request.get("/api/courses/" + idOfCourse + "/goals/" + idOfLearningGoal + "/individual-progress", HttpStatus.OK, IndividualLearningGoalProgress.class);
    assertThat(individualLearningGoalProgress.totalPointsAchievableByStudentsInLearningGoal).isEqualTo(30.0);
    assertThat(individualLearningGoalProgress.pointsAchievedByStudentInLearningGoal).isEqualTo(5.0);
}
Also used : IndividualLearningGoalProgress(de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.jupiter.api.Test)

Example 2 with IndividualLearningGoalProgress

use of de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress in project Artemis by ls1intum.

the class LearningGoalIntegrationTest method getLearningGoalProgress_asTeam1Student1_usingParticipantScores_shouldReturnProgressTenOutOfThirty.

@Test
@WithMockUser(username = "team1student1", roles = "USER")
public void getLearningGoalProgress_asTeam1Student1_usingParticipantScores_shouldReturnProgressTenOutOfThirty() throws Exception {
    IndividualLearningGoalProgress individualLearningGoalProgress = request.get("/api/courses/" + idOfCourse + "/goals/" + idOfLearningGoal + "/individual-progress?useParticipantScoreTable=true", HttpStatus.OK, IndividualLearningGoalProgress.class);
    assertThat(individualLearningGoalProgress.totalPointsAchievableByStudentsInLearningGoal).isEqualTo(30.0);
    assertThat(individualLearningGoalProgress.pointsAchievedByStudentInLearningGoal).isEqualTo(5.0);
}
Also used : IndividualLearningGoalProgress(de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.jupiter.api.Test)

Example 3 with IndividualLearningGoalProgress

use of de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress in project Artemis by ls1intum.

the class LearningGoalIntegrationTest method getLearningGoalProgress_asStudent1_usingParticipantScores_shouldReturnProgressTenOutOfTwenty.

@Test
@WithMockUser(username = "student1", roles = "USER")
public void getLearningGoalProgress_asStudent1_usingParticipantScores_shouldReturnProgressTenOutOfTwenty() throws Exception {
    IndividualLearningGoalProgress individualLearningGoalProgress = request.get("/api/courses/" + idOfCourse + "/goals/" + idOfLearningGoal + "/individual-progress?useParticipantScoreTable=true", HttpStatus.OK, IndividualLearningGoalProgress.class);
    assertThat(individualLearningGoalProgress.totalPointsAchievableByStudentsInLearningGoal).isEqualTo(30.0);
    assertThat(individualLearningGoalProgress.pointsAchievedByStudentInLearningGoal).isEqualTo(10.0);
}
Also used : IndividualLearningGoalProgress(de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.jupiter.api.Test)

Example 4 with IndividualLearningGoalProgress

use of de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress in project Artemis by ls1intum.

the class LearningGoalIntegrationTest method getLearningGoalProgress_asTeam1Student1_shouldReturnProgressTenOutOfThirty.

@Test
@WithMockUser(username = "team1student1", roles = "USER")
public void getLearningGoalProgress_asTeam1Student1_shouldReturnProgressTenOutOfThirty() throws Exception {
    IndividualLearningGoalProgress individualLearningGoalProgress = request.get("/api/courses/" + idOfCourse + "/goals/" + idOfLearningGoal + "/individual-progress", HttpStatus.OK, IndividualLearningGoalProgress.class);
    assertThat(individualLearningGoalProgress.totalPointsAchievableByStudentsInLearningGoal).isEqualTo(30.0);
    assertThat(individualLearningGoalProgress.pointsAchievedByStudentInLearningGoal).isEqualTo(5.0);
}
Also used : IndividualLearningGoalProgress(de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.jupiter.api.Test)

Example 5 with IndividualLearningGoalProgress

use of de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress in project ArTEMiS by ls1intum.

the class LearningGoalIntegrationTest method getLearningGoalProgress_asStudent1_usingParticipantScores_shouldReturnProgressTenOutOfTwenty.

@Test
@WithMockUser(username = "student1", roles = "USER")
public void getLearningGoalProgress_asStudent1_usingParticipantScores_shouldReturnProgressTenOutOfTwenty() throws Exception {
    IndividualLearningGoalProgress individualLearningGoalProgress = request.get("/api/courses/" + idOfCourse + "/goals/" + idOfLearningGoal + "/individual-progress?useParticipantScoreTable=true", HttpStatus.OK, IndividualLearningGoalProgress.class);
    assertThat(individualLearningGoalProgress.totalPointsAchievableByStudentsInLearningGoal).isEqualTo(30.0);
    assertThat(individualLearningGoalProgress.pointsAchievedByStudentInLearningGoal).isEqualTo(10.0);
}
Also used : IndividualLearningGoalProgress(de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.jupiter.api.Test)

Aggregations

IndividualLearningGoalProgress (de.tum.in.www1.artemis.web.rest.dto.IndividualLearningGoalProgress)10 Test (org.junit.jupiter.api.Test)8 WithMockUser (org.springframework.security.test.context.support.WithMockUser)8 de.tum.in.www1.artemis.domain (de.tum.in.www1.artemis.domain)2 ExerciseUnit (de.tum.in.www1.artemis.domain.lecture.ExerciseUnit)2 LectureUnit (de.tum.in.www1.artemis.domain.lecture.LectureUnit)2 StudentParticipation (de.tum.in.www1.artemis.domain.participation.StudentParticipation)2 ParticipantScore (de.tum.in.www1.artemis.domain.scores.ParticipantScore)2 StudentScore (de.tum.in.www1.artemis.domain.scores.StudentScore)2 TeamScore (de.tum.in.www1.artemis.domain.scores.TeamScore)2 de.tum.in.www1.artemis.repository (de.tum.in.www1.artemis.repository)2 CourseExerciseStatisticsDTO (de.tum.in.www1.artemis.web.rest.dto.CourseExerciseStatisticsDTO)2 CourseLearningGoalProgress (de.tum.in.www1.artemis.web.rest.dto.CourseLearningGoalProgress)2 java.util (java.util)2 Collectors (java.util.stream.Collectors)2 Stream (java.util.stream.Stream)2 Service (org.springframework.stereotype.Service)2