diff --git a/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientInstruction.java b/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientInstruction.java index e9ca8908..fc6ad26c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientInstruction.java +++ b/src/main/java/ch/ethz/seb/sebserver/gbl/model/session/ClientInstruction.java @@ -36,6 +36,18 @@ public final class ClientInstruction { LEAVE } + public static enum ProctoringRoomType { + COLLECTING_ROOM("proctoring"), + TOWNHALL("townhall"), + BREAKOUT_ROOM("breakout"); + + public final String roomTypeName; + + ProctoringRoomType(final String roomTypeName) { + this.roomTypeName = roomTypeName; + } + } + public interface SEB_INSTRUCTION_ATTRIBUTES { public interface SEB_PROCTORING { public static final String SERVICE_TYPE = "service-type"; @@ -60,6 +72,8 @@ public final class ClientInstruction { public static final String ZOOM_RECEIVE_AUDIO = "zoomReceiveAudio"; public static final String ZOOM_RECEIVE_VIDEO = "zoomReceiveVideo"; public static final String ZOOM_ALLOW_CHAT = "zoomFeatureFlagChat"; + + public static final String PROCTORING_ROOM_TYPE = "roomType"; } public interface SEB_RECONFIGURE_SETTINGS { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ExamProctoringRoomServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ExamProctoringRoomServiceImpl.java index 9f3a5db0..8e733862 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ExamProctoringRoomServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ExamProctoringRoomServiceImpl.java @@ -31,7 +31,9 @@ import ch.ethz.seb.sebserver.gbl.model.exam.ProctoringRoomConnection; import ch.ethz.seb.sebserver.gbl.model.exam.ProctoringServiceSettings; import ch.ethz.seb.sebserver.gbl.model.session.ClientConnection; import ch.ethz.seb.sebserver.gbl.model.session.ClientConnectionData; +import ch.ethz.seb.sebserver.gbl.model.session.ClientInstruction; import ch.ethz.seb.sebserver.gbl.model.session.ClientInstruction.InstructionType; +import ch.ethz.seb.sebserver.gbl.model.session.ClientInstruction.ProctoringRoomType; import ch.ethz.seb.sebserver.gbl.model.session.RemoteProctoringRoom; import ch.ethz.seb.sebserver.gbl.profile.WebServiceProfile; import ch.ethz.seb.sebserver.gbl.util.Result; @@ -669,7 +671,8 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService examId, connectionToken, roomConnection, - examProctoringService); + examProctoringService, + ProctoringRoomType.TOWNHALL); } catch (final Exception e) { log.error("Failed to send join for town-hall room assignment to connection: {}", cc); this.clientConnectionDAO @@ -725,7 +728,8 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService proctoringSettings.examId, connectionToken, proctoringConnection, - examProctoringService); + examProctoringService, + ProctoringRoomType.BREAKOUT_ROOM); } } catch (final Exception e) { log.error("Failed to send join to break-out room: {} connection: {}", @@ -790,7 +794,8 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService proctoringSettings.examId, clientConnection.clientConnection.connectionToken, proctoringConnection, - examProctoringService); + examProctoringService, + ProctoringRoomType.COLLECTING_ROOM); } catch (final Exception e) { log.error("Failed to send proctoring room join instruction to client: {}", connectionToken, e); @@ -802,7 +807,8 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService final Long examId, final String connectionToken, final ProctoringRoomConnection proctoringConnection, - final ExamProctoringService examProctoringService) { + final ExamProctoringService examProctoringService, + final ProctoringRoomType roomType) { if (log.isDebugEnabled()) { log.debug("Register proctoring join instruction for connection: {}, room: {}", @@ -813,6 +819,12 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService final Map attributes = examProctoringService .createJoinInstructionAttributes(proctoringConnection); + if (roomType != null) { + attributes.put( + ClientInstruction.SEB_INSTRUCTION_ATTRIBUTES.SEB_PROCTORING.PROCTORING_ROOM_TYPE, + roomType.roomTypeName); + } + this.sebInstructionService .registerInstruction( examId,