fixed proctoring

This commit is contained in:
anhefti 2020-11-17 12:23:39 +01:00
parent e3a331196c
commit 10ef9792bc
No known key found for this signature in database
GPG key ID: E9AD9471B6BC114D
5 changed files with 18 additions and 18 deletions

View file

@ -29,24 +29,26 @@ public class GuiServiceInfo {
private final UriComponentsBuilder externalServerURIBuilder; private final UriComponentsBuilder externalServerURIBuilder;
public GuiServiceInfo( public GuiServiceInfo(
@Value("${sebserver.gui.http.external.scheme:https}") final String externalScheme,
@Value("${server.address}") final String internalServer, @Value("${server.address}") final String internalServer,
@Value("${sebserver.webservice.http.external.servername}") final String webserviceServer,
@Value("${sebserver.webservice.http.external.port}") final String webservicePort,
@Value("${sebserver.gui.http.external.servername}") final String externalServer,
@Value("${server.port}") final String internalPort, @Value("${server.port}") final String internalPort,
@Value("${sebserver.gui.http.external.scheme}") final String externalScheme,
@Value("${sebserver.gui.http.external.servername}") final String externalServer,
@Value("${sebserver.gui.http.external.port}") final String externalPort, @Value("${sebserver.gui.http.external.port}") final String externalPort,
@Value("${sebserver.gui.entrypoint:/gui}") final String entryPoint) { @Value("${sebserver.gui.entrypoint:/gui}") final String entryPoint) {
if (StringUtils.isBlank(externalScheme)) {
throw new RuntimeException("Missing mandatory inital parameter sebserver.gui.http.external.servername");
}
if (StringUtils.isBlank(externalServer)) {
throw new RuntimeException("Missing mandatory inital parameter sebserver.gui.http.external.servername");
}
this.externalScheme = externalScheme; this.externalScheme = externalScheme;
this.internalServer = internalServer; this.internalServer = internalServer;
this.externalServer = StringUtils.isNotBlank(externalServer) this.externalServer = externalServer;
? externalServer
: StringUtils.isNotBlank(webserviceServer)
? webserviceServer
: internalServer;
this.internalPort = internalPort; this.internalPort = internalPort;
this.externalPort = StringUtils.isNotBlank(externalPort) ? externalPort : webservicePort; this.externalPort = externalPort;
this.entryPoint = entryPoint; this.entryPoint = entryPoint;
this.internalServerURIBuilder = UriComponentsBuilder this.internalServerURIBuilder = UriComponentsBuilder
.fromHttpUrl("http://" + this.internalServer); .fromHttpUrl("http://" + this.internalServer);

View file

@ -681,7 +681,7 @@ public class SEBClientConnectionServiceImpl implements SEBClientConnectionServic
return this.clientConnectionDAO.save(new ClientConnection( return this.clientConnectionDAO.save(new ClientConnection(
clientConnection.id, null, null, clientConnection.id, null, null,
status, null, null, null, null, null, null, status, null, null, null, null, null, null,
null)) true))
.getOrThrow(); .getOrThrow();
} }

View file

@ -33,7 +33,6 @@ import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.exam.ProctoringSettings; import ch.ethz.seb.sebserver.gbl.model.exam.ProctoringSettings;
import ch.ethz.seb.sebserver.gbl.model.exam.SEBProctoringConnectionData; import ch.ethz.seb.sebserver.gbl.model.exam.SEBProctoringConnectionData;
import ch.ethz.seb.sebserver.gbl.model.session.ClientConnection; import ch.ethz.seb.sebserver.gbl.model.session.ClientConnection;
import ch.ethz.seb.sebserver.gbl.model.session.ClientConnection.ConnectionStatus;
import ch.ethz.seb.sebserver.gbl.model.session.ClientInstruction; 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.InstructionType;
import ch.ethz.seb.sebserver.gbl.model.session.RemoteProctoringRoom; import ch.ethz.seb.sebserver.gbl.model.session.RemoteProctoringRoom;
@ -427,8 +426,7 @@ public class ExamProctoringController {
// get all active connections for the exam and send the join instruction // get all active connections for the exam and send the join instruction
this.examSessionService.getConnectionData( this.examSessionService.getConnectionData(
examId, examId,
cData -> cData.clientConnection.status == ConnectionStatus.ACTIVE ExamSessionService.ACTIVE_CONNECTION_DATA_FILTER)
|| cData.clientConnection.status == ConnectionStatus.CLOSED)
.getOrThrow() .getOrThrow()
.stream() .stream()
.forEach(cc -> { .forEach(cc -> {

View file

@ -26,7 +26,7 @@ sebserver.webservice.clean-db-on-startup=false
sebserver.init.adminaccount.gen-on-init=false sebserver.init.adminaccount.gen-on-init=false
sebserver.webservice.distributed=false sebserver.webservice.distributed=false
sebserver.webservice.http.external.scheme=http sebserver.webservice.http.external.scheme=http
sebserver.webservice.http.external.servername= sebserver.webservice.http.external.servername=localhost
sebserver.webservice.http.external.port=${server.port} sebserver.webservice.http.external.port=${server.port}
sebserver.webservice.http.redirect.gui=/gui sebserver.webservice.http.redirect.gui=/gui

View file

@ -13,9 +13,9 @@ sebserver.gui.supported.languages=en
sebserver.gui.date.displayformat=de sebserver.gui.date.displayformat=de
# GUI API # GUI API
sebserver.gui.http.external.scheme=https sebserver.gui.http.external.scheme=${sebserver.webservice.http.external.scheme}
sebserver.gui.http.external.servername=localhost sebserver.gui.http.external.servername=${sebserver.webservice.http.external.servername}
sebserver.gui.http.external.port=8080 sebserver.gui.http.external.port=${sebserver.webservice.http.external.port}
sebserver.gui.entrypoint=/gui sebserver.gui.entrypoint=/gui
sebserver.gui.webservice.protocol=http sebserver.gui.webservice.protocol=http
sebserver.gui.webservice.address=localhost sebserver.gui.webservice.address=localhost