7
7
import org .springframework .stereotype .Service ;
8
8
9
9
import de .tum .cit .aet .artemis .communication .service .WebsocketMessagingService ;
10
- import de .tum .cit .aet .artemis .core .domain .User ;
11
10
import de .tum .cit .aet .artemis .exam .domain .Exam ;
12
11
import de .tum .cit .aet .artemis .exam .domain .StudentExam ;
13
12
import de .tum .cit .aet .artemis .exam .domain .event .ExamAttendanceCheckEvent ;
@@ -66,15 +65,13 @@ public ExamLiveEventsService(WebsocketMessagingService websocketMessagingService
66
65
*
67
66
* @param exam the exam to send the announcement to.
68
67
* @param message The message to send.
69
- * @param sentBy The user who sent the message.
70
68
* @return The created event.
71
69
*/
72
- public ExamWideAnnouncementEvent createAndDistributeExamAnnouncementEvent (Exam exam , String message , User sentBy ) {
70
+ public ExamWideAnnouncementEvent createAndDistributeExamAnnouncementEvent (Exam exam , String message ) {
73
71
var event = new ExamWideAnnouncementEvent ();
74
72
75
73
// Common fields
76
74
event .setExamId (exam .getId ());
77
- event .setCreatedBy (sentBy .getName ());
78
75
79
76
// Specific fields
80
77
event .setTextContent (message );
@@ -87,16 +84,14 @@ public ExamWideAnnouncementEvent createAndDistributeExamAnnouncementEvent(Exam e
87
84
*
88
85
* @param studentExam The student exam the where the popup should be shown
89
86
* @param message The message to send.
90
- * @param sentBy The user who sent the message.
91
87
* @return The created event.
92
88
*/
93
- public ExamAttendanceCheckEvent createAndSendExamAttendanceCheckEvent (StudentExam studentExam , String message , User sentBy ) {
89
+ public ExamAttendanceCheckEvent createAndSendExamAttendanceCheckEvent (StudentExam studentExam , String message ) {
94
90
var event = new ExamAttendanceCheckEvent ();
95
91
96
92
// Common fields
97
93
event .setExamId (studentExam .getExam ().getId ());
98
94
event .setStudentExamId (studentExam .getId ());
99
- event .setCreatedBy (sentBy .getName ());
100
95
101
96
// specific fields
102
97
event .setTextContent (message );
@@ -111,15 +106,13 @@ public ExamAttendanceCheckEvent createAndSendExamAttendanceCheckEvent(StudentExa
111
106
* @param newWorkingTime The new working time in seconds
112
107
* @param oldWorkingTime The old working time in seconds
113
108
* @param courseWide set to true if this event is caused by a course wide update that affects all students; false otherwise
114
- * @param sentBy The user who performed the update
115
109
*/
116
- public void createAndSendWorkingTimeUpdateEvent (StudentExam studentExam , int newWorkingTime , int oldWorkingTime , boolean courseWide , User sentBy ) {
110
+ public void createAndSendWorkingTimeUpdateEvent (StudentExam studentExam , int newWorkingTime , int oldWorkingTime , boolean courseWide ) {
117
111
var event = new WorkingTimeUpdateEvent ();
118
112
119
113
// Common fields
120
114
event .setExamId (studentExam .getExam ().getId ());
121
115
event .setStudentExamId (studentExam .getId ());
122
- event .setCreatedBy (sentBy .getName ());
123
116
124
117
// Specific fields
125
118
event .setNewWorkingTime (newWorkingTime );
@@ -132,15 +125,14 @@ public void createAndSendWorkingTimeUpdateEvent(StudentExam studentExam, int new
132
125
/**
133
126
* Send a problem statement update to all affected students.
134
127
*
135
- * @param exercise The exam exercise the problem statement was updated for
136
- * @param message The message to send
137
- * @param instructor The user who performed the update
128
+ * @param exercise The exam exercise the problem statement was updated for
129
+ * @param message The message to send
138
130
*/
139
131
@ Async
140
- public void createAndSendProblemStatementUpdateEvent (Exercise exercise , String message , User instructor ) {
132
+ public void createAndSendProblemStatementUpdateEvent (Exercise exercise , String message ) {
141
133
Exam exam = exercise .getExam ();
142
134
studentExamRepository .findAllWithExercisesByExamId (exam .getId ()).stream ().filter (studentExam -> studentExam .getExercises ().contains (exercise ))
143
- .forEach (studentExam -> this .createAndSendProblemStatementUpdateEvent (studentExam , exercise , message , instructor ));
135
+ .forEach (studentExam -> this .createAndSendProblemStatementUpdateEvent (studentExam , exercise , message ));
144
136
}
145
137
146
138
/**
@@ -149,15 +141,13 @@ public void createAndSendProblemStatementUpdateEvent(Exercise exercise, String m
149
141
* @param studentExam The student exam containing the exercise with updated problem statement
150
142
* @param exercise The updated exercise
151
143
* @param message The message to send
152
- * @param sentBy The user who performed the update
153
144
*/
154
- public void createAndSendProblemStatementUpdateEvent (StudentExam studentExam , Exercise exercise , String message , User sentBy ) {
145
+ public void createAndSendProblemStatementUpdateEvent (StudentExam studentExam , Exercise exercise , String message ) {
155
146
var event = new ProblemStatementUpdateEvent ();
156
147
157
148
// Common fields
158
149
event .setExamId (studentExam .getExam ().getId ());
159
150
event .setStudentExamId (studentExam .getId ());
160
- event .setCreatedBy (sentBy .getName ());
161
151
162
152
// Specific fields
163
153
event .setTextContent (message );
0 commit comments