-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/programming-exercises/add-groupin…
…g-feature-to-analysis-table
- Loading branch information
Showing
275 changed files
with
7,274 additions
and
3,055 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.idea/runConfigurations/Artemis__Server__LocalVC___Jenkins_.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.idea/runConfigurations/Artemis__Server__LocalVC___LocalCI_.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/java/de/tum/cit/aet/artemis/atlas/api/AbstractAtlasApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package de.tum.cit.aet.artemis.atlas.api; | ||
|
||
import de.tum.cit.aet.artemis.core.api.AbstractApi; | ||
|
||
public abstract class AbstractAtlasApi implements AbstractApi { | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/de/tum/cit/aet/artemis/atlas/api/CompetencyApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.tum.cit.aet.artemis.atlas.api; | ||
|
||
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_CORE; | ||
|
||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.stereotype.Controller; | ||
|
||
import de.tum.cit.aet.artemis.atlas.service.competency.CompetencyService; | ||
import de.tum.cit.aet.artemis.lecture.domain.Lecture; | ||
|
||
@Controller | ||
@Profile(PROFILE_CORE) | ||
public class CompetencyApi extends AbstractAtlasApi { | ||
|
||
private final CompetencyService competencyService; | ||
|
||
public CompetencyApi(CompetencyService competencyService) { | ||
this.competencyService = competencyService; | ||
} | ||
|
||
public void addCompetencyLinksToExerciseUnits(Lecture lecture) { | ||
competencyService.addCompetencyLinksToExerciseUnits(lecture); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
src/main/java/de/tum/cit/aet/artemis/atlas/api/CompetencyProgressApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package de.tum.cit.aet.artemis.atlas.api; | ||
|
||
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_CORE; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.stereotype.Controller; | ||
|
||
import de.tum.cit.aet.artemis.atlas.domain.LearningObject; | ||
import de.tum.cit.aet.artemis.atlas.domain.competency.Competency; | ||
import de.tum.cit.aet.artemis.atlas.domain.competency.CourseCompetency; | ||
import de.tum.cit.aet.artemis.atlas.repository.CompetencyRepository; | ||
import de.tum.cit.aet.artemis.atlas.service.competency.CompetencyProgressService; | ||
import de.tum.cit.aet.artemis.core.domain.Course; | ||
import de.tum.cit.aet.artemis.core.domain.User; | ||
import de.tum.cit.aet.artemis.exercise.domain.participation.Participant; | ||
|
||
@Controller | ||
@Profile(PROFILE_CORE) | ||
public class CompetencyProgressApi extends AbstractAtlasApi { | ||
|
||
private final CompetencyProgressService competencyProgressService; | ||
|
||
private final CompetencyRepository competencyRepository; | ||
|
||
public CompetencyProgressApi(CompetencyProgressService competencyProgressService, CompetencyRepository competencyRepository) { | ||
this.competencyProgressService = competencyProgressService; | ||
this.competencyRepository = competencyRepository; | ||
} | ||
|
||
public void updateProgressByLearningObjectForParticipantAsync(LearningObject learningObject, Participant participant) { | ||
competencyProgressService.updateProgressByLearningObjectForParticipantAsync(learningObject, participant); | ||
} | ||
|
||
public void updateProgressByLearningObjectAsync(LearningObject learningObject) { | ||
competencyProgressService.updateProgressByLearningObjectAsync(learningObject); | ||
} | ||
|
||
public void updateProgressByCompetencyAsync(CourseCompetency competency) { | ||
competencyProgressService.updateProgressByCompetencyAsync(competency); | ||
} | ||
|
||
public void updateProgressForUpdatedLearningObjectAsync(LearningObject originalLearningObject, Optional<LearningObject> updatedLearningObject) { | ||
competencyProgressService.updateProgressForUpdatedLearningObjectAsync(originalLearningObject, updatedLearningObject); | ||
} | ||
|
||
public void updateProgressByLearningObjectSync(LearningObject learningObject, Set<User> users) { | ||
competencyProgressService.updateProgressByLearningObjectSync(learningObject, users); | ||
} | ||
|
||
public long countByCourse(Course course) { | ||
return competencyRepository.countByCourse(course); | ||
} | ||
|
||
public void deleteAll(Set<Competency> competencies) { | ||
competencyRepository.deleteAll(competencies); | ||
} | ||
|
||
/** | ||
* Updates the progress for all competencies of the given courses. | ||
* | ||
* @param activeCourses the active courses | ||
*/ | ||
public void updateProgressForCoursesAsync(List<Course> activeCourses) { | ||
activeCourses.forEach(course -> { | ||
List<Competency> competencies = competencyRepository.findByCourseIdOrderById(course.getId()); | ||
// Asynchronously update the progress for each competency | ||
competencies.forEach(competencyProgressService::updateProgressByCompetencyAsync); | ||
}); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/main/java/de/tum/cit/aet/artemis/atlas/api/CompetencyRelationApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package de.tum.cit.aet.artemis.atlas.api; | ||
|
||
import static de.tum.cit.aet.artemis.core.config.Constants.PROFILE_CORE; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.stereotype.Controller; | ||
|
||
import de.tum.cit.aet.artemis.atlas.domain.competency.CompetencyExerciseLink; | ||
import de.tum.cit.aet.artemis.atlas.domain.competency.CompetencyLectureUnitLink; | ||
import de.tum.cit.aet.artemis.atlas.repository.CompetencyExerciseLinkRepository; | ||
import de.tum.cit.aet.artemis.atlas.repository.CompetencyLectureUnitLinkRepository; | ||
import de.tum.cit.aet.artemis.atlas.repository.CompetencyRelationRepository; | ||
|
||
@Controller | ||
@Profile(PROFILE_CORE) | ||
public class CompetencyRelationApi extends AbstractAtlasApi { | ||
|
||
private final CompetencyRelationRepository competencyRelationRepository; | ||
|
||
private final CompetencyExerciseLinkRepository competencyExerciseLinkRepository; | ||
|
||
private final CompetencyLectureUnitLinkRepository lectureUnitLinkRepository; | ||
|
||
public CompetencyRelationApi(CompetencyRelationRepository competencyRelationRepository, CompetencyExerciseLinkRepository competencyExerciseLinkRepository, | ||
CompetencyLectureUnitLinkRepository lectureUnitLinkRepository) { | ||
this.competencyRelationRepository = competencyRelationRepository; | ||
this.competencyExerciseLinkRepository = competencyExerciseLinkRepository; | ||
this.lectureUnitLinkRepository = lectureUnitLinkRepository; | ||
} | ||
|
||
public void deleteAllByCourseId(Long courseId) { | ||
competencyRelationRepository.deleteAllByCourseId(courseId); | ||
} | ||
|
||
public void deleteAllExerciseLinks(Iterable<CompetencyExerciseLink> competencyExerciseLinks) { | ||
competencyExerciseLinkRepository.deleteAll(competencyExerciseLinks); | ||
} | ||
|
||
public List<CompetencyExerciseLink> saveAllExerciseLinks(Iterable<CompetencyExerciseLink> competencyExerciseLinks) { | ||
return competencyExerciseLinkRepository.saveAll(competencyExerciseLinks); | ||
} | ||
|
||
public List<CompetencyLectureUnitLink> saveAllLectureUnitLinks(Iterable<CompetencyLectureUnitLink> lectureUnitLinks) { | ||
return lectureUnitLinkRepository.saveAll(lectureUnitLinks); | ||
} | ||
|
||
public void deleteAllLectureUnitLinks(Iterable<CompetencyLectureUnitLink> lectureUnitLinks) { | ||
lectureUnitLinkRepository.deleteAll(lectureUnitLinks); | ||
} | ||
|
||
public void deleteAllLectureUnitLinksByLectureId(Long lectureId) { | ||
lectureUnitLinkRepository.deleteAllByLectureId(lectureId); | ||
} | ||
} |
Oops, something went wrong.