Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static ArtemisClient fromUsernamePassword(ArtemisInstance artemis, String

var payload = ArtemisClient.encodeJSON(new AuthenticationDTO(username, password));
var request = new Request.Builder()
.url(artemis.url(List.of("core", "public", "authenticate"), null))
.url(artemis.url(List.of("core", "public", "authenticate"), null, false))
.post(payload)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public record CourseCreateDTO(
@JsonProperty int maxRequestMoreFeedbackTimeDays,
@JsonProperty int maxComplaintTextLimit,
@JsonProperty int maxComplaintResponseTextLimit,
@JsonProperty boolean testCourse,
@JsonProperty @Nullable Integer accuracyOfScores,
@JsonProperty boolean restrictedAthenaModulesAccess,
@JsonProperty @Nullable Boolean enrollmentEnabled,
@JsonProperty boolean unenrollmentEnabled,
@JsonProperty boolean learningPathsEnabled,
Expand All @@ -34,7 +37,7 @@ public record CourseCreateDTO(
*/
public static CourseCreateDTO minimal(String title, String shortName) {
return new CourseCreateDTO(
title, shortName, null, null, null, null, null, null, null, null, 7, 7, 2000, 2000, null, false, false,
false, null, null);
title, shortName, null, null, null, null, null, null, null, null, 7, 7, 2000, 2000, true, 1, false,
null, false, false, false, null, null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ public record ProgrammingExerciseCreateDTO(
@JsonProperty @Nullable ZonedDateTime assessmentDueDate,
@JsonProperty @Nullable String testRepositoryUri,
@JsonProperty @Nullable String solutionRepositoryUri,
@JsonProperty @Nullable Boolean allowOnlineEditor,
@JsonProperty @Nullable Boolean allowOfflineIde,
@JsonProperty boolean allowOnlineIde,
@JsonProperty @Nullable Boolean staticCodeAnalysisEnabled,
@JsonProperty @Nullable Integer maxStaticCodeAnalysisPenalty,
@JsonProperty @Nullable String programmingLanguage,
@JsonProperty @Nullable String packageName,
@JsonProperty boolean showTestNamesToStudents,
@JsonProperty @Nullable String projectType,
Expand All @@ -51,9 +54,12 @@ public ProgrammingExerciseCreateDTO forCourse(long targetCourseId) {
assessmentDueDate,
testRepositoryUri,
solutionRepositoryUri,
allowOnlineEditor,
allowOfflineIde,
allowOnlineIde,
staticCodeAnalysisEnabled,
maxStaticCodeAnalysisPenalty,
programmingLanguage,
packageName,
showTestNamesToStudents,
projectType,
Expand All @@ -80,8 +86,11 @@ public static ProgrammingExerciseCreateDTO minimalCourseExercise(
null,
null,
true,
true,
false,
false,
null,
"JAVA",
packageName,
false,
"PLAIN_MAVEN",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Licensed under EPL-2.0 2024-2025. */
/* Licensed under EPL-2.0 2024-2026. */
package edu.kit.kastel.sdq.artemis4j.grading;

import java.io.IOException;
Expand Down Expand Up @@ -109,6 +109,10 @@ public void close() throws ArtemisClientException {
}

private static void deleteDirectory(Path path) throws IOException {
if (!Files.exists(path)) {
return;
}

try (var dirStream = Files.walk(path)) {
var filesInDirectory = dirStream
.map(Path::toFile)
Expand Down
11 changes: 8 additions & 3 deletions src/test/java/edu/kit/kastel/sdq/artemis4j/End2EndTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -369,7 +370,9 @@ void testAnnotationMerging() throws ArtemisClientException {
feedbackTexts.add(feedbackDTO.detailText());
}

assertEquals(
Collections.sort(feedbackTexts);

List<String> expectedFeedbackTexts = new ArrayList<>(
List.of(
// other feedback is 5 annotations in MergeSort and 5 in Client that should be merged
"[Funktionalität:Custom Penalty] Other Feedback 0 (0P)",
Expand All @@ -386,8 +389,10 @@ void testAnnotationMerging() throws ArtemisClientException {
// feedbacks where only the last has a message:
"[Funktionalität:JavaDoc Leer] JavaDoc ist leer oder nicht vorhanden",
"[Funktionalität:JavaDoc Leer] JavaDoc ist leer oder nicht vorhanden",
"[Funktionalität:JavaDoc Leer] JavaDoc ist leer oder nicht vorhanden\nExplanation: Has used last annotation for message. Weitere Probleme in L12."),
feedbackTexts);
"[Funktionalität:JavaDoc Leer] JavaDoc ist leer oder nicht vorhanden\nExplanation: Has used last annotation for message. Weitere Probleme in L12."));
Collections.sort(expectedFeedbackTexts);

assertEquals(expectedFeedbackTexts, feedbackTexts);
}

@Test
Expand Down
11 changes: 8 additions & 3 deletions src/test/java/edu/kit/kastel/sdq/artemis4j/SubgroupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import edu.kit.kastel.sdq.artemis4j.client.ArtemisInstance;
Expand Down Expand Up @@ -390,7 +391,9 @@ void testSubgroupsAreGroupedCorrectly() throws ArtemisClientException {
feedbackTexts.add(feedbackDTO.detailText());
}

assertEquals(
Collections.sort(feedbackTexts);

List<String> expectedFeedbackTexts = new ArrayList<>(
List.of(
// other feedback is 5 annotations in MergeSort and 5 in Client that should be merged
"[Funktionalität:Sichtbarkeit] Die Sichtbarkeit ist nicht korrekt\nExplanation: Other Feedback 0",
Expand All @@ -407,7 +410,9 @@ void testSubgroupsAreGroupedCorrectly() throws ArtemisClientException {
// feedbacks where only the last has a message:
"[Funktionalität:Unused Element] Das Element wird nicht verwendet",
"[Funktionalität:Unused Element] Das Element wird nicht verwendet",
"[Funktionalität:Unused Element] Das Element wird nicht verwendet\nExplanation: Has used last annotation for message. Weitere Probleme in L12."),
feedbackTexts);
"[Funktionalität:Unused Element] Das Element wird nicht verwendet\nExplanation: Has used last annotation for message. Weitere Probleme in L12."));
Collections.sort(expectedFeedbackTexts);

assertEquals(expectedFeedbackTexts, feedbackTexts);
}
}
Loading