use of de.tum.in.www1.artemis.domain.Team in project ArTEMiS by ls1intum.
the class LearningGoalIntegrationTest method getLearningGoalCourseProgressIndividualTest_asInstructorOne.
@Test
@WithMockUser(username = "instructor1", roles = "INSTRUCTOR")
public void getLearningGoalCourseProgressIndividualTest_asInstructorOne() throws Exception {
cleanUpInitialParticipations();
User student1 = userRepository.findOneByLogin("student1").get();
User student2 = userRepository.findOneByLogin("student2").get();
User student3 = userRepository.findOneByLogin("student3").get();
User student4 = userRepository.findOneByLogin("student4").get();
User instructor1 = userRepository.findOneByLogin("instructor1").get();
// will be ignored in favor of last submission from team
createParticipationSubmissionAndResult(idOfTextExercise, student1, 10.0, 0.0, 100, true);
createParticipationSubmissionAndResult(idOfTextExercise, student1, 10.0, 0.0, 50, false);
// will be ignored in favor of last submission from student
createParticipationSubmissionAndResult(idOfTextExercise, student2, 10.0, 0.0, 100, true);
createParticipationSubmissionAndResult(idOfTextExercise, student2, 10.0, 0.0, 10, false);
createParticipationSubmissionAndResult(idOfTextExercise, student3, 10.0, 0.0, 10, true);
createParticipationSubmissionAndResult(idOfTextExercise, student4, 10.0, 0.0, 50, true);
// will be ignored as not a student
createParticipationSubmissionAndResult(idOfTextExercise, instructor1, 10.0, 0.0, 100, true);
CourseLearningGoalProgress courseLearningGoalProgress = request.get("/api/courses/" + idOfCourse + "/goals/" + idOfLearningGoal + "/course-progress", HttpStatus.OK, CourseLearningGoalProgress.class);
assertThat(courseLearningGoalProgress.totalPointsAchievableByStudentsInLearningGoal).isEqualTo(30.0);
assertThat(courseLearningGoalProgress.averagePointsAchievedByStudentInLearningGoal).isEqualTo(3.0);
assertThatSpecificCourseLectureUnitProgressExists(courseLearningGoalProgress, 20.0, 4, 30.0);
}
use of de.tum.in.www1.artemis.domain.Team in project ArTEMiS by ls1intum.
the class TeamImportIntegrationTest method testImportTeamsIntoExerciseWithTeamShortNameConflictsUsingCreateOnlyStrategy.
private void testImportTeamsIntoExerciseWithTeamShortNameConflictsUsingCreateOnlyStrategy(ImportType type, List<Team> body, List<Team> teamsWithoutConflict) throws Exception {
TeamImportStrategyType strategyType = TeamImportStrategyType.CREATE_ONLY;
List<Team> destinationTeamsBefore = database.addTeamsForExercise(destinationExercise, "sameShortName", 3, tutor);
// destination teams before + conflict-free source teams = destination teams after
testImportTeamsIntoExercise(type, strategyType, body, addLists(destinationTeamsBefore, teamsWithoutConflict));
}
use of de.tum.in.www1.artemis.domain.Team in project ArTEMiS by ls1intum.
the class TeamImportIntegrationTest method testImportTeamsIntoExerciseWithNoConflictsUsingCreateOnlyStrategy.
private void testImportTeamsIntoExerciseWithNoConflictsUsingCreateOnlyStrategy(ImportType type, List<Team> body, List<Team> addedTeams) throws Exception {
TeamImportStrategyType strategyType = TeamImportStrategyType.CREATE_ONLY;
List<Team> destinationTeamsBefore = database.addTeamsForExercise(destinationExercise, 1, tutor);
// destination teams before + source teams = destination teams after
testImportTeamsIntoExercise(type, strategyType, body, addLists(destinationTeamsBefore, addedTeams));
}
use of de.tum.in.www1.artemis.domain.Team in project ArTEMiS by ls1intum.
the class TeamImportIntegrationTest method testImportTeamsIntoExerciseWithConflictsUsingPurgeExistingStrategy.
private void testImportTeamsIntoExerciseWithConflictsUsingPurgeExistingStrategy(ImportType type, List<Team> body, List<Team> addedTeams) throws Exception {
TeamImportStrategyType strategyType = TeamImportStrategyType.PURGE_EXISTING;
database.addTeamsForExercise(destinationExercise, "sameShortName", 2, tutor);
// imported source teams = destination teams after
testImportTeamsIntoExercise(type, strategyType, body, addedTeams);
}
use of de.tum.in.www1.artemis.domain.Team in project ArTEMiS by ls1intum.
the class TeamImportIntegrationTest method testImportTeamsIntoExerciseWithNoConflictsUsingPurgeExistingStrategy.
private void testImportTeamsIntoExerciseWithNoConflictsUsingPurgeExistingStrategy(ImportType type, List<Team> body, List<Team> addedTeams) throws Exception {
TeamImportStrategyType strategyType = TeamImportStrategyType.PURGE_EXISTING;
database.addTeamsForExercise(destinationExercise, 4, tutor);
testImportTeamsIntoExercise(type, strategyType, body, addedTeams);
}
Aggregations