Skip to content

Commit 83ac531

Browse files
committed
Development: Deprecate participation<—>results
1 parent 1539df5 commit 83ac531

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

src/main/java/de/tum/cit/aet/artemis/assessment/domain/Result.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,12 @@ public class Result extends DomainObject implements Comparable<Result> {
108108
@JsonView(QuizView.Before.class)
109109
private List<Feedback> feedbacks = new ArrayList<>();
110110

111+
/**
112+
* @deprecated: Will be removed for 8.0, please use submission.participation instead
113+
*/
111114
@ManyToOne
112115
@JsonView(QuizView.Before.class)
116+
@Deprecated(since = "7.7", forRemoval = true)
113117
private Participation participation;
114118

115119
@ManyToOne(fetch = FetchType.LAZY)
@@ -385,15 +389,31 @@ private boolean feedbackTextHasChanged(String existingText, String newText) {
385389
return !Objects.equals(existingText, newText);
386390
}
387391

392+
/**
393+
* @deprecated: Will be removed for 8.0, please use submission.participation instead
394+
* @return the participation
395+
*/
396+
@Deprecated(since = "7.7", forRemoval = true)
388397
public Participation getParticipation() {
389398
return participation;
390399
}
391400

401+
/**
402+
* @deprecated: Will be removed for 8.0, please use submission.participation instead
403+
* @param participation the participation to set
404+
* @return the result
405+
*/
406+
@Deprecated(since = "7.7", forRemoval = true)
392407
public Result participation(Participation participation) {
393408
this.participation = participation;
394409
return this;
395410
}
396411

412+
/**
413+
* @deprecated: Will be removed for 8.0, please use submission.participation instead
414+
* @param participation the participation to set
415+
*/
416+
@Deprecated(since = "7.7", forRemoval = true)
397417
public void setParticipation(Participation participation) {
398418
this.participation = participation;
399419
}

src/main/java/de/tum/cit/aet/artemis/exercise/domain/participation/Participation.java

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,19 @@ public abstract class Participation extends DomainObject implements Participatio
9696
protected Exercise exercise;
9797

9898
/**
99-
* Results are not cascaded through the participation because ideally we want the relationship between participations, submissions and results as follows: each participation
100-
* has multiple submissions. For each submission there can be a result. Therefore, the result is persisted with the submission. Refer to Submission.result for cascading
101-
* settings.
99+
* @deprecated: Will be removed for 8.0, please use submissions.results instead
100+
*
101+
* Results are not cascaded through the participation because ideally we want the relationship between participations, submissions and results as follows: each
102+
* participation
103+
* has multiple submissions. For each submission there can be a result. Therefore, the result is persisted with the submission. Refer to Submission.result for
104+
* cascading
105+
* settings.
102106
*/
103107
@OneToMany(mappedBy = "participation")
104108
@JsonIgnoreProperties(value = "participation", allowSetters = true)
105109
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
106110
@JsonView(QuizView.Before.class)
111+
@Deprecated(since = "7.7", forRemoval = true)
107112
private Set<Result> results = new HashSet<>();
108113

109114
/**
@@ -201,26 +206,52 @@ public void setPracticeMode(boolean practiceMode) {
201206
this.testRun = practiceMode;
202207
}
203208

209+
/**
210+
* @deprecated: Will be removed for 8.0, please use submissions.results instead
211+
* @return the results
212+
*/
213+
@Deprecated(since = "7.7", forRemoval = true)
204214
public Set<Result> getResults() {
205215
return results;
206216
}
207217

218+
/**
219+
* @deprecated: Will be removed for 8.0, please use submissions.results instead
220+
* @param results the results
221+
* @return the results
222+
*/
223+
@Deprecated(since = "7.7", forRemoval = true)
208224
public Participation results(Set<Result> results) {
209225
this.results = results;
210226
return this;
211227
}
212228

229+
/**
230+
* @deprecated: Will be removed for 8.0, please use submissions.results instead
231+
* @param result the result
232+
*/
233+
@Deprecated(since = "7.7", forRemoval = true)
213234
@Override
214235
public void addResult(Result result) {
215236
this.results.add(result);
216237
result.setParticipation(this);
217238
}
218239

240+
/**
241+
* @deprecated: Will be removed for 8.0, please use submissions.results instead
242+
* @param result the result
243+
*/
244+
@Deprecated(since = "7.7", forRemoval = true)
219245
public void removeResult(Result result) {
220246
this.results.remove(result);
221247
result.setParticipation(null);
222248
}
223249

250+
/**
251+
* @deprecated: Will be removed for 8.0, please use submissions.results instead
252+
* @param results the results
253+
*/
254+
@Deprecated(since = "7.7", forRemoval = true)
224255
public void setResults(Set<Result> results) {
225256
this.results = results;
226257
}

src/main/webapp/app/entities/participation/participation.model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export abstract class Participation implements BaseEntity {
3939
public initializationDate?: dayjs.Dayjs;
4040
public individualDueDate?: dayjs.Dayjs;
4141
public presentationScore?: number;
42+
/**
43+
* @deprecated This property will be removed in Artemis 8.0. Use `submissions.results` instead.
44+
*/
4245
public results?: Result[];
4346
public submissions?: Submission[];
4447
public exercise?: Exercise;

src/main/webapp/app/entities/result.model.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export class Result implements BaseEntity {
3030
public submission?: Submission;
3131
public assessor?: User;
3232
public feedbacks?: Feedback[];
33+
/**
34+
* @deprecated This property will be removed in Artemis 8.0. Use `submission.participation` instead.
35+
*/
3336
public participation?: Participation;
3437

3538
// helper attributes

0 commit comments

Comments
 (0)