SEBSERV-210 fixed
This commit is contained in:
parent
086bc5ef3b
commit
885e39d1cc
1 changed files with 31 additions and 25 deletions
|
@ -280,25 +280,11 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService
|
||||||
proctoringRoom.id)
|
proctoringRoom.id)
|
||||||
.getOrThrow();
|
.getOrThrow();
|
||||||
|
|
||||||
final Result<RemoteProctoringRoom> townhallRoomResult = this.remoteProctoringRoomDAO
|
applyProcotringInstruction(
|
||||||
.getTownhallRoom(cc.getExamId());
|
cc.getExamId(),
|
||||||
|
cc.getConnectionToken())
|
||||||
|
.getOrThrow();
|
||||||
|
|
||||||
if (townhallRoomResult.hasValue()) {
|
|
||||||
final RemoteProctoringRoom townhallRoom = townhallRoomResult.get();
|
|
||||||
applyProcotringInstruction(
|
|
||||||
cc.getExamId(),
|
|
||||||
cc.getConnectionToken(),
|
|
||||||
townhallRoom.name,
|
|
||||||
townhallRoom.subject)
|
|
||||||
.getOrThrow();
|
|
||||||
} else {
|
|
||||||
applyProcotringInstruction(
|
|
||||||
cc.getExamId(),
|
|
||||||
cc.getConnectionToken(),
|
|
||||||
proctoringRoom.name,
|
|
||||||
proctoringRoom.subject)
|
|
||||||
.getOrThrow();
|
|
||||||
}
|
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
log.error("Failed to assign connection to collecting room: {}", cc, e);
|
log.error("Failed to assign connection to collecting room: {}", cc, e);
|
||||||
}
|
}
|
||||||
|
@ -601,9 +587,7 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService
|
||||||
|
|
||||||
private Result<Void> applyProcotringInstruction(
|
private Result<Void> applyProcotringInstruction(
|
||||||
final Long examId,
|
final Long examId,
|
||||||
final String connectionToken,
|
final String connectionToken) {
|
||||||
final String roomName,
|
|
||||||
final String subject) {
|
|
||||||
|
|
||||||
return Result.tryCatch(() -> {
|
return Result.tryCatch(() -> {
|
||||||
final ProctoringServiceSettings settings = this.examAdminService
|
final ProctoringServiceSettings settings = this.examAdminService
|
||||||
|
@ -614,10 +598,32 @@ public class ExamProctoringRoomServiceImpl implements ExamProctoringRoomService
|
||||||
.getExamProctoringService(settings.serverType)
|
.getExamProctoringService(settings.serverType)
|
||||||
.getOrThrow();
|
.getOrThrow();
|
||||||
|
|
||||||
sendJoinCollectingRoomInstructions(
|
final Result<RemoteProctoringRoom> townhallRoomResult = this.remoteProctoringRoomDAO
|
||||||
settings,
|
.getTownhallRoom(examId);
|
||||||
Arrays.asList(connectionToken),
|
|
||||||
examProctoringService);
|
if (townhallRoomResult.hasValue()) {
|
||||||
|
|
||||||
|
final RemoteProctoringRoom townhallRoom = townhallRoomResult.get();
|
||||||
|
final ProctoringRoomConnection roomConnection = examProctoringService.getClientRoomConnection(
|
||||||
|
settings,
|
||||||
|
connectionToken,
|
||||||
|
townhallRoom.name,
|
||||||
|
townhallRoom.subject)
|
||||||
|
.getOrThrow();
|
||||||
|
|
||||||
|
sendJoinInstruction(
|
||||||
|
examId,
|
||||||
|
connectionToken,
|
||||||
|
roomConnection,
|
||||||
|
examProctoringService);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
sendJoinCollectingRoomInstructions(
|
||||||
|
settings,
|
||||||
|
Arrays.asList(connectionToken),
|
||||||
|
examProctoringService);
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue