Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Jan 8, 2024
2 parents c3d0d3e + 2df4179 commit 1ec50e3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: mvn -B clean package -DskipTests

- name: Save Final JAR
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "JAR File"
path: "target/artemis-score-stats-complete.jar"
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -134,7 +134,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/edu/kit/kastel/sdq/scorestats/cli/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ public void run(String[] args) {
courses.sort(Comparator.comparing(Course::getCourseId));

try (Scanner scanner = new Scanner(System.in)) {

OptionDialogue<Course> courseDialogue = new OptionDialogue<>(scanner, "Please select the course:",
Course course = courses.get(0);
// only prompt if there is more than one course to select from
if (courses.size() > 1) {
OptionDialogue<Course> courseDialogue = new OptionDialogue<>(scanner, "Please select the course:",
courses.stream().collect(Collectors.toMap(Course::getShortName, item -> item, (i1, i2) -> null, LinkedHashMap::new)));
Course course = courseDialogue.prompt();
course = courseDialogue.prompt();
}

List<Exercise> exercises;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -13,6 +14,7 @@
import edu.kit.kastel.sdq.artemis4j.api.artemis.assessment.Feedback;
import edu.kit.kastel.sdq.artemis4j.api.artemis.assessment.Result;
import edu.kit.kastel.sdq.artemis4j.api.artemis.assessment.Submission;
import edu.kit.kastel.sdq.artemis4j.api.client.ISubmissionsArtemisClient;
import edu.kit.kastel.sdq.artemis4j.api.grading.IAnnotation;
import edu.kit.kastel.sdq.artemis4j.client.AssessmentArtemisClient;
import edu.kit.kastel.sdq.artemis4j.client.RestClientManager;
Expand All @@ -26,7 +28,7 @@

/**
* An {@link ArtemisClient} using artemis4j.
*
*
* @author Moritz Hertler
* @version 1.0
*/
Expand All @@ -51,8 +53,13 @@ public List<Course> loadCourses() throws ArtemisClientException {
}

public Assessments<K> loadAssessments(Exercise exercise, ExerciseConfig config) throws ArtemisClientException {
ISubmissionsArtemisClient submissionsClient = this.client.getSubmissionArtemisClient();

List<Submission> submissions = this.client.getSubmissionArtemisClient().getSubmissions(exercise);
Collection<Submission> submissions = new ArrayList<>(submissionsClient.getSubmissions(exercise, 0, false));

if (exercise.hasSecondCorrectionRound()) {
submissions.addAll(submissionsClient.getSubmissions(exercise, 1, false));
}

AnnotationDeserializer deserializer = null;
if (config != null) {
Expand Down

0 comments on commit 1ec50e3

Please sign in to comment.