SEBSERV-240 implementation and fixes

This commit is contained in:
anhefti 2022-03-24 15:33:11 +01:00
parent 5b3648bcee
commit 1cd6fb1888
3 changed files with 29 additions and 18 deletions

View file

@ -147,15 +147,19 @@ public class FinishedExam implements TemplateComposer {
.withDefaultAction(t -> actionBuilder .withDefaultAction(t -> actionBuilder
.newAction(ActionDefinition.VIEW_FINISHED_EXAM_CLIENT_CONNECTION) .newAction(ActionDefinition.VIEW_FINISHED_EXAM_CLIENT_CONNECTION)
.withParentEntityKey(examKey) .withParentEntityKey(examKey)
.create()); .create())
.withSelectionListener(this.pageService.getSelectionPublisher(
pageContext,
ActionDefinition.VIEW_FINISHED_EXAM_CLIENT_CONNECTION));
indicators.stream().forEach(indicator -> { indicators.stream().forEach(indicator -> {
if (indicator.type != IndicatorType.LAST_PING) { if (indicator.type == IndicatorType.LAST_PING || indicator.type == IndicatorType.NONE) {
tableBuilder.withColumn(new ColumnDefinition<>( return;
indicator.name,
new LocTextKey(indicator.name),
indicatorValueFunction(indicator)));
} }
tableBuilder.withColumn(new ColumnDefinition<>(
indicator.name,
new LocTextKey(indicator.name),
indicatorValueFunction(indicator)));
}); });
final EntityTable<ClientConnectionData> table = tableBuilder.compose(pageContext.copyOf(content)); final EntityTable<ClientConnectionData> table = tableBuilder.compose(pageContext.copyOf(content));

View file

@ -23,6 +23,7 @@ import ch.ethz.seb.sebserver.gbl.model.Domain;
import ch.ethz.seb.sebserver.gbl.model.EntityKey; import ch.ethz.seb.sebserver.gbl.model.EntityKey;
import ch.ethz.seb.sebserver.gbl.model.exam.Exam; import ch.ethz.seb.sebserver.gbl.model.exam.Exam;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator; import ch.ethz.seb.sebserver.gbl.model.exam.Indicator;
import ch.ethz.seb.sebserver.gbl.model.exam.Indicator.IndicatorType;
import ch.ethz.seb.sebserver.gbl.model.exam.QuizData; import ch.ethz.seb.sebserver.gbl.model.exam.QuizData;
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.ClientConnectionData; import ch.ethz.seb.sebserver.gbl.model.session.ClientConnectionData;
@ -170,18 +171,23 @@ public class FinishedExamClientConnection implements TemplateComposer {
.asColorBox()) .asColorBox())
.addEmptyCell(); .addEmptyCell();
indicators.forEach(indicator -> formBuilder.addField(FormBuilder.text( indicators.forEach(indicator -> {
indicator.name, if (indicator.type == IndicatorType.LAST_PING || indicator.type == IndicatorType.NONE) {
new LocTextKey(indicator.name), return;
connectionData.indicatorValues }
.stream() formBuilder.addField(FormBuilder.text(
.filter(indicatorValue -> indicatorValue.getIndicatorId().equals(indicator.id)) indicator.name,
.findFirst() new LocTextKey(indicator.name),
.map(iv -> IndicatorValue.getDisplayValue(iv, indicator.type)) connectionData.indicatorValues
.orElse(Constants.EMPTY_NOTE)) .stream()
.asColorBox() .filter(indicatorValue -> indicatorValue.getIndicatorId().equals(indicator.id))
.withDefaultLabel(indicator.name)) .findFirst()
.addEmptyCell()); .map(iv -> IndicatorValue.getDisplayValue(iv, indicator.type))
.orElse(Constants.EMPTY_NOTE))
.asColorBox()
.withDefaultLabel(indicator.name))
.addEmptyCell();
});
formBuilder.build(); formBuilder.build();

View file

@ -1894,6 +1894,7 @@ sebserver.finished.exam.connections.name=Session or User Name
sebserver.finished.exam.connections.info=Connection Info sebserver.finished.exam.connections.info=Connection Info
sebserver.finished.exam.connections.status=Status sebserver.finished.exam.connections.status=Status
sebserver.finished.exam.connection.emptySelection=At first please select a Connection from the list sebserver.finished.exam.connection.emptySelection=At first please select a Connection from the list
sebserver.finished.exam.connection.action.view=View Details
sebserver.finished.exam.connection.title=SEB Client Connection sebserver.finished.exam.connection.title=SEB Client Connection
sebserver.finished.connection.form.id=User Name or Session sebserver.finished.connection.form.id=User Name or Session