Skip to content

Commit

Permalink
Merge branch 'develop' into feature/programming-exercises/r-template
Browse files Browse the repository at this point in the history
  • Loading branch information
magaupp authored Sep 27, 2024
2 parents 3dbf437 + 71148af commit c54c46c
Show file tree
Hide file tree
Showing 28 changed files with 911 additions and 501 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ dependencies {
implementation "org.apache.lucene:lucene-queryparser:${lucene_version}"
implementation "org.apache.lucene:lucene-core:${lucene_version}"
implementation "org.apache.lucene:lucene-analyzers-common:${lucene_version}"

implementation "com.google.protobuf:protobuf-java:4.28.2"

// we have to override those values to use the latest version
implementation "org.slf4j:jcl-over-slf4j:${slf4j_version}"
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = {
},
],
},
modulePathIgnorePatterns: [],
modulePathIgnorePatterns: ['<rootDir>/src/main/resources/templates/'],
testTimeout: 3000,
testMatch: [
'<rootDir>/src/test/javascript/spec/component/**/*.spec.ts',
Expand Down
786 changes: 408 additions & 378 deletions package-lock.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
"node_modules"
],
"dependencies": {
"@angular/animations": "18.2.5",
"@angular/cdk": "18.2.4",
"@angular/common": "18.2.5",
"@angular/compiler": "18.2.5",
"@angular/core": "18.2.5",
"@angular/forms": "18.2.5",
"@angular/localize": "18.2.5",
"@angular/material": "18.2.4",
"@angular/platform-browser": "18.2.5",
"@angular/platform-browser-dynamic": "18.2.5",
"@angular/router": "18.2.5",
"@angular/service-worker": "18.2.5",
"@angular/animations": "18.2.6",
"@angular/cdk": "18.2.6",
"@angular/common": "18.2.6",
"@angular/compiler": "18.2.6",
"@angular/core": "18.2.6",
"@angular/forms": "18.2.6",
"@angular/localize": "18.2.6",
"@angular/material": "18.2.6",
"@angular/platform-browser": "18.2.6",
"@angular/platform-browser-dynamic": "18.2.6",
"@angular/router": "18.2.6",
"@angular/service-worker": "18.2.6",
"@ctrl/ngx-emoji-mart": "9.2.0",
"@danielmoncada/angular-datetime-picker": "18.1.0",
"@fingerprintjs/fingerprintjs": "4.5.0",
Expand All @@ -37,7 +37,7 @@
"@ng-bootstrap/ng-bootstrap": "17.0.1",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
"@sentry/angular": "8.30.0",
"@sentry/angular": "8.32.0",
"@swimlane/ngx-charts": "20.5.0",
"@swimlane/ngx-graph": "8.4.0",
"@vscode/codicons": "0.0.36",
Expand All @@ -47,7 +47,7 @@
"crypto-js": "4.2.0",
"dayjs": "1.11.13",
"diff-match-patch-typescript": "1.1.0",
"dompurify": "3.1.6",
"dompurify": "3.1.7",
"export-to-csv": "1.4.0",
"fast-json-patch": "3.1.1",
"franc-min": "6.2.0",
Expand All @@ -63,7 +63,7 @@
"ngx-webstorage": "18.0.0",
"papaparse": "5.4.1",
"pdfjs-dist": "4.6.82",
"posthog-js": "1.161.6",
"posthog-js": "1.165.0",
"rxjs": "7.8.1",
"showdown": "2.1.0",
"showdown-highlight": "3.1.0",
Expand All @@ -88,13 +88,13 @@
"d3-transition": "^3.0.1"
},
"@typescript-eslint/utils": {
"eslint": "^9.10.0"
"eslint": "^9.11.0"
},
"braces": "3.0.3",
"critters": "0.0.24",
"debug": "4.3.7",
"eslint-plugin-deprecation": {
"eslint": "^9.10.0"
"eslint": "^9.11.0"
},
"eslint-plugin-jest": {
"@typescript-eslint/eslint-plugin": "^8.6.0"
Expand All @@ -116,30 +116,30 @@
},
"devDependencies": {
"@angular-builders/jest": "18.0.0",
"@angular-devkit/build-angular": "18.2.4",
"@angular-devkit/build-angular": "18.2.6",
"@angular-eslint/builder": "18.3.1",
"@angular-eslint/eslint-plugin": "18.3.1",
"@angular-eslint/eslint-plugin-template": "18.3.1",
"@angular-eslint/schematics": "18.3.1",
"@angular-eslint/template-parser": "18.3.1",
"@angular/cli": "18.2.4",
"@angular/compiler-cli": "18.2.5",
"@angular/language-service": "18.2.5",
"@sentry/types": "8.30.0",
"@angular/cli": "18.2.6",
"@angular/compiler-cli": "18.2.6",
"@angular/language-service": "18.2.6",
"@sentry/types": "8.32.0",
"@types/crypto-js": "4.2.2",
"@types/d3-shape": "3.1.6",
"@types/dompurify": "3.0.5",
"@types/jest": "29.5.13",
"@types/lodash-es": "4.17.12",
"@types/node": "22.5.5",
"@types/node": "22.7.3",
"@types/papaparse": "5.3.14",
"@types/showdown": "2.0.6",
"@types/smoothscroll-polyfill": "0.3.4",
"@types/sockjs-client": "1.5.4",
"@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "8.6.0",
"@typescript-eslint/parser": "8.6.0",
"eslint": "9.10.0",
"@typescript-eslint/eslint-plugin": "8.7.0",
"@typescript-eslint/parser": "8.7.0",
"eslint": "9.11.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-deprecation": "3.0.0",
"eslint-plugin-jest": "28.8.3",
Expand All @@ -158,7 +158,7 @@
"ng-mocks": "14.13.1",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"sass": "1.79.1",
"sass": "1.79.3",
"ts-jest": "29.2.5",
"typescript": "5.5.4",
"weak-napi": "2.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public Set<Result> findResultsFilteredForStudents(Participation participation) {
boolean isAssessmentOver = getAssessmentDueDate() == null || getAssessmentDueDate().isBefore(ZonedDateTime.now());
if (!isAssessmentOver) {
// This allows the showing of preliminary feedback in case the assessment due date is set before its over.
if (this instanceof TextExercise) {
if (this instanceof TextExercise || this instanceof ModelingExercise) {
return participation.getResults().stream().filter(result -> result.getAssessmentType() == AssessmentType.AUTOMATIC_ATHENA).collect(Collectors.toSet());
}
return Set.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ public List<Result> getManualResults() {
/**
* This method is necessary to ignore Athena results in the assessment view
*
* @return non athena automatic results including null results
* @return non athena automatic results excluding null results
*/
@JsonIgnore
public List<Result> getNonAthenaResults() {
return results.stream().filter(result -> result == null || !result.isAthenaAutomatic()).collect(Collectors.toCollection(ArrayList::new));
return results.stream().filter(result -> result != null && !result.isAthenaAutomatic()).collect(Collectors.toCollection(ArrayList::new));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,16 +715,16 @@ public List<StudentParticipation> findByExerciseAndStudentIdWithEagerSubmissions
}

/**
* Get the text exercise participation with the Latest Submissions and its results
* Retrieves a StudentParticipation with its latest Submission and associated Result.
*
* @param participationId the id of the participation
* @return the participation with latest submission and result
* @throws EntityNotFoundException
* @param participationId The unique identifier of the participation to retrieve.
* @return A StudentParticipation object containing the latest submission and result.
* @throws EntityNotFoundException If no StudentParticipation is found with the given ID.
*/
public StudentParticipation findTextExerciseParticipationWithLatestSubmissionAndResultElseThrow(Long participationId) throws EntityNotFoundException {
public StudentParticipation findExerciseParticipationWithLatestSubmissionAndResultElseThrow(Long participationId) throws EntityNotFoundException {
Optional<Participation> participation = participationRepository.findByIdWithLatestSubmissionAndResult(participationId);
if (participation.isEmpty() || !(participation.get() instanceof StudentParticipation studentParticipation)) {
throw new EntityNotFoundException("No text exercise participation found with id " + participationId);
throw new EntityNotFoundException("No exercise participation found with id " + participationId);
}
return studentParticipation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ private List<SubmissionWithComplaintDTO> getSubmissionsWithComplaintsFromComplai
// add each submission with its complaint to the DTO
submissions.stream().filter(submission -> submission.getResultWithComplaint() != null).forEach(submission -> {
// get the complaint which belongs to the submission
submission.setResults(submission.getNonAthenaResults());
Complaint complaintOfSubmission = complaintMap.get(submission.getResultWithComplaint().getId());
prepareComplaintAndSubmission(complaintOfSubmission, submission);
submissionWithComplaintDTOs.add(new SubmissionWithComplaintDTO(submission, complaintOfSubmission));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected ResponseEntity<List<Submission>> getAllSubmissions(Long exerciseId, bo
submission.getParticipation().setExercise(null);
}
// Important for exercises with Athena results
if (assessedByTutor) {
if (assessedByTutor && !examMode) {
submission.setResults(submission.getNonAthenaResults());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@
import de.tum.cit.aet.artemis.exercise.service.ExerciseDateService;
import de.tum.cit.aet.artemis.exercise.service.ParticipationAuthorizationCheckService;
import de.tum.cit.aet.artemis.exercise.service.ParticipationService;
import de.tum.cit.aet.artemis.fileupload.domain.FileUploadExercise;
import de.tum.cit.aet.artemis.modeling.domain.ModelingExercise;
import de.tum.cit.aet.artemis.modeling.service.ModelingExerciseFeedbackService;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseParticipation;
import de.tum.cit.aet.artemis.programming.domain.ProgrammingExerciseStudentParticipation;
Expand Down Expand Up @@ -167,6 +169,8 @@ public class ParticipationResource {

private final TextExerciseFeedbackService textExerciseFeedbackService;

private final ModelingExerciseFeedbackService modelingExerciseFeedbackService;

public ParticipationResource(ParticipationService participationService, ProgrammingExerciseParticipationService programmingExerciseParticipationService,
CourseRepository courseRepository, QuizExerciseRepository quizExerciseRepository, ExerciseRepository exerciseRepository,
ProgrammingExerciseRepository programmingExerciseRepository, AuthorizationCheckService authCheckService,
Expand All @@ -176,7 +180,8 @@ public ParticipationResource(ParticipationService participationService, Programm
ProgrammingExerciseStudentParticipationRepository programmingExerciseStudentParticipationRepository, SubmissionRepository submissionRepository,
ResultRepository resultRepository, ExerciseDateService exerciseDateService, InstanceMessageSendService instanceMessageSendService, QuizBatchService quizBatchService,
SubmittedAnswerRepository submittedAnswerRepository, QuizSubmissionService quizSubmissionService, GradingScaleService gradingScaleService,
ProgrammingExerciseCodeReviewFeedbackService programmingExerciseCodeReviewFeedbackService, TextExerciseFeedbackService textExerciseFeedbackService) {
ProgrammingExerciseCodeReviewFeedbackService programmingExerciseCodeReviewFeedbackService, TextExerciseFeedbackService textExerciseFeedbackService,
ModelingExerciseFeedbackService modelingExerciseFeedbackService) {
this.participationService = participationService;
this.programmingExerciseParticipationService = programmingExerciseParticipationService;
this.quizExerciseRepository = quizExerciseRepository;
Expand All @@ -203,6 +208,7 @@ public ParticipationResource(ParticipationService participationService, Programm
this.gradingScaleService = gradingScaleService;
this.programmingExerciseCodeReviewFeedbackService = programmingExerciseCodeReviewFeedbackService;
this.textExerciseFeedbackService = textExerciseFeedbackService;
this.modelingExerciseFeedbackService = modelingExerciseFeedbackService;
}

/**
Expand Down Expand Up @@ -363,7 +369,7 @@ public ResponseEntity<StudentParticipation> requestFeedback(@PathVariable Long e

Exercise exercise = exerciseRepository.findByIdElseThrow(exerciseId);

if (!(exercise instanceof TextExercise) && !(exercise instanceof ProgrammingExercise)) {
if (exercise instanceof QuizExercise || exercise instanceof FileUploadExercise) {
throw new BadRequestAlertException("Unsupported exercise type", "participation", "unsupported type");
}

Expand Down Expand Up @@ -393,7 +399,7 @@ private ResponseEntity<StudentParticipation> handleExerciseFeedbackRequest(Exerc
participation = studentParticipationRepository.findByIdWithResultsElseThrow(participation.getId());

// Check submission requirements
if (exercise instanceof TextExercise) {
if (exercise instanceof TextExercise || exercise instanceof ModelingExercise) {
if (submissionRepository.findAllByParticipationId(participation.getId()).isEmpty()) {
throw new BadRequestAlertException("You need to submit at least once", "participation", "preconditions not met");
}
Expand All @@ -416,6 +422,9 @@ else if (exercise instanceof ProgrammingExercise) {
if (exercise instanceof TextExercise) {
updatedParticipation = textExerciseFeedbackService.handleNonGradedFeedbackRequest(exercise.getId(), participation, (TextExercise) exercise);
}
else if (exercise instanceof ModelingExercise) {
updatedParticipation = modelingExerciseFeedbackService.handleNonGradedFeedbackRequest(participation, (ModelingExercise) exercise);
}
else {
updatedParticipation = programmingExerciseCodeReviewFeedbackService.handleNonGradedFeedbackRequest(exercise.getId(),
(ProgrammingExerciseStudentParticipation) participation, (ProgrammingExercise) exercise);
Expand Down
Loading

0 comments on commit c54c46c

Please sign in to comment.