Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/programming-exercises/ad…
Browse files Browse the repository at this point in the history
…d-affected-students-to-analysis-table' into feature/programming-exercises/add-affected-students-to-analysis-table
  • Loading branch information
az108 committed Nov 14, 2024
2 parents 4594289 + 3dee150 commit 6fa20f9
Show file tree
Hide file tree
Showing 59 changed files with 670 additions and 412 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ dependencies {

implementation "tech.jhipster:jhipster-framework:${jhipster_dependencies_version}"
implementation "org.springframework.boot:spring-boot-starter-cache:${spring_boot_version}"
implementation "io.micrometer:micrometer-registry-prometheus:1.13.6"
implementation "io.micrometer:micrometer-registry-prometheus:1.14.0"
implementation "net.logstash.logback:logstash-logback-encoder:8.0"

// Defines low-level streaming API, and includes JSON-specific implementations
Expand Down Expand Up @@ -414,8 +414,8 @@ dependencies {
implementation "org.springframework.cloud:spring-cloud-starter-config:4.1.3"
implementation "org.springframework.cloud:spring-cloud-commons:4.1.4"

implementation "io.netty:netty-all:4.1.114.Final"
implementation "io.projectreactor.netty:reactor-netty:1.1.23"
implementation "io.netty:netty-all:4.1.115.Final"
implementation "io.projectreactor.netty:reactor-netty:1.2.0"
implementation "org.springframework:spring-messaging:6.1.14"
implementation "org.springframework.retry:spring-retry:2.0.10"

Expand Down Expand Up @@ -536,10 +536,10 @@ dependencies {
testImplementation "org.mockito:mockito-core:${mockito_version}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockito_version}"

testImplementation "io.github.classgraph:classgraph:4.8.177"
testImplementation "io.github.classgraph:classgraph:4.8.179"
testImplementation "org.awaitility:awaitility:4.2.2"
testImplementation "org.apache.maven.shared:maven-invoker:3.3.0"
testImplementation "org.gradle:gradle-tooling-api:8.10.2"
testImplementation "org.gradle:gradle-tooling-api:8.11"
testImplementation "org.apache.maven.surefire:surefire-report-parser:3.5.2"
testImplementation "com.opencsv:opencsv:5.9"
testImplementation("io.zonky.test:embedded-database-spring-test:2.5.1") {
Expand Down Expand Up @@ -621,7 +621,7 @@ tasks.withType(Test).configureEach {
}

wrapper {
gradleVersion = "8.10.2"
gradleVersion = "8.11"
}

tasks.register("stage") {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jplag_version=5.1.0
# NOTE: we do not need to use the latest version 9.x here as long as Stanford CoreNLP does not reference it
lucene_version=8.11.4
slf4j_version=2.0.16
sentry_version=7.16.0
sentry_version=7.17.0
liquibase_version=4.30.0
docker_java_version=3.4.0
logback_version=1.5.12
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public interface ParticipantScoreRepository extends ArtemisJpaRepository<Partici
""")
List<ParticipantScore> findAllOutdated();

@Override
@EntityGraph(type = LOAD, attributePaths = { "exercise", "lastResult", "lastRatedResult" })
List<ParticipantScore> findAll();

@EntityGraph(type = LOAD, attributePaths = { "exercise", "lastResult", "lastRatedResult" })
List<ParticipantScore> findAllByExercise(Exercise exercise);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ CASE WHEN TYPE(e) = ProgrammingExercise THEN TRUE ELSE FALSE END,
LEFT JOIN TeamScore tS ON tS.exercise = e AND :user MEMBER OF tS.team.students
WHERE c.id = :competencyId
AND e IS NOT NULL
GROUP BY e.id, e.maxPoints, e.difficulty, TYPE(e), sS.lastScore, tS.lastScore, sS.lastPoints, tS.lastPoints, sS.lastModifiedDate, tS.lastModifiedDate
GROUP BY e.id, e.maxPoints, e.difficulty, TYPE(e), el.weight, sS.lastScore, tS.lastScore, sS.lastPoints, tS.lastPoints, sS.lastModifiedDate, tS.lastModifiedDate
""")
Set<CompetencyExerciseMasteryCalculationDTO> findAllExerciseInfoByCompetencyIdAndUser(@Param("competencyId") long competencyId, @Param("user") User user);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public void importStandardizedCompetencyCatalog(StandardizedCompetencyCatalogDTO
*/
public String exportStandardizedCompetencyCatalog() {
List<KnowledgeArea> knowledgeAreas = getAllForTreeView();
// TODO: we should avoid using findAll() here, as it might return a huge amount of data
List<Source> sources = sourceRepository.findAll();
var catalog = StandardizedCompetencyCatalogDTO.of(knowledgeAreas, sources);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package de.tum.cit.aet.artemis.core.dto;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record CourseGroupsDTO(String instructorGroupName, String editorGroupName, String teachingAssistantGroupName, String studentGroupName) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import de.tum.cit.aet.artemis.core.domain.Organization;
import de.tum.cit.aet.artemis.core.domain.User;
import de.tum.cit.aet.artemis.core.dto.CourseForArchiveDTO;
import de.tum.cit.aet.artemis.core.dto.CourseGroupsDTO;
import de.tum.cit.aet.artemis.core.dto.StatisticsEntry;
import de.tum.cit.aet.artemis.core.exception.EntityNotFoundException;
import de.tum.cit.aet.artemis.core.repository.base.ArtemisJpaRepository;
Expand Down Expand Up @@ -323,14 +324,6 @@ GROUP BY SUBSTRING(CAST(s.submissionDate AS string), 1, 10), p.student.login
""")
List<Course> findAllNotEndedCoursesByManagementGroupNames(@Param("now") ZonedDateTime now, @Param("userGroups") List<String> userGroups);

@Query("""
SELECT COUNT(DISTINCT ug.userId)
FROM Course c
JOIN UserGroup ug ON c.studentGroupName = ug.group
WHERE c.id = :courseId
""")
int countCourseStudents(@Param("courseId") long courseId);

/**
* Counts the number of members of a course, i.e. users that are a member of the course's student, tutor, editor or instructor group.
* Users that are part of multiple groups are NOT counted multiple times.
Expand Down Expand Up @@ -569,4 +562,23 @@ SELECT COUNT(c) > 0
Set<CourseForArchiveDTO> findInactiveCoursesForUserRolesWithNonNullSemester(@Param("isAdmin") boolean isAdmin, @Param("groups") Set<String> groups,
@Param("now") ZonedDateTime now);

@Query("""
SELECT new de.tum.cit.aet.artemis.core.dto.CourseGroupsDTO(
c.instructorGroupName,
c.editorGroupName,
c.teachingAssistantGroupName,
c.studentGroupName
) FROM Course c
""")
Set<CourseGroupsDTO> findAllCourseGroups();

@Query("""
SELECT c
FROM Course c
WHERE c.teachingAssistantGroupName IN :userGroups
OR c.editorGroupName IN :userGroups
OR c.instructorGroupName IN :userGroups
OR :isAdmin = TRUE
""")
List<Course> findCoursesForAtLeastTutorWithGroups(@Param("userGroups") Set<String> userGroups, @Param("isAdmin") boolean isAdmin);
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ OR EXISTS (SELECT c FROM Course c WHERE submission.participation.exercise.course
*
* @param startDate the minimum submission date
* @param endDate the maximum submission date
* @return a list of active users
* @return a count of active users
*/
@Query("""
SELECT COUNT(DISTINCT p.student.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ public List<Course> getAllCoursesForManagementOverview(boolean onlyActive) {
var user = userRepository.getUserWithGroupsAndAuthorities();
boolean isAdmin = authCheckService.isAdmin(user);
if (isAdmin && !onlyActive) {
// TODO: we should avoid using findAll() here, as it might return a huge amount of data
return courseRepository.findAll();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ public List<StudentDTO> importUsers(List<StudentDTO> userDtos) {
* @return the users participation vcs access token, or throws an exception if it does not exist
*/
public ParticipationVCSAccessToken getParticipationVcsAccessTokenForUserAndParticipationIdOrElseThrow(User user, Long participationId) {
return participationVCSAccessTokenService.findByUserIdAndParticipationIdOrElseThrow(user.getId(), participationId);
return participationVCSAccessTokenService.findByUserAndParticipationIdOrElseThrow(user, participationId);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.apache.sshd.common.config.keys.AuthorizedKeyEntry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand Down Expand Up @@ -58,9 +57,6 @@ public class AccountResource {

public static final String ENTITY_NAME = "user";

@Value("${jhipster.clientApp.name}")
private String applicationName;

private static final Logger log = LoggerFactory.getLogger(AccountResource.class);

private final UserRepository userRepository;
Expand Down Expand Up @@ -233,7 +229,7 @@ public ResponseEntity<String> getVcsAccessToken(@RequestParam("participationId")
}

/**
* PUT account/participation-vcs-access-token : get the vcsToken for of a user for a participation
* PUT account/participation-vcs-access-token : add a vcsToken for of a user for a participation
*
* @param participationId the participation for which the access token should be fetched
*
Expand Down
Loading

0 comments on commit 6fa20f9

Please sign in to comment.