SEBWIN-474: Implemented workaround to always use kiosk mode Disable Explorer Shell when proctoring is active.

This commit is contained in:
Damian Büchel 2021-03-29 20:05:17 +02:00
parent d4f9a9cc17
commit d309de2050
3 changed files with 51 additions and 0 deletions

View file

@ -90,6 +90,7 @@ namespace SafeExamBrowser.Runtime
sessionOperations.Enqueue(new VirtualMachineOperation(vmDetector, logger, sessionContext));
sessionOperations.Enqueue(new ServiceOperation(logger, runtimeHost, serviceProxy, sessionContext, THIRTY_SECONDS, userInfo));
sessionOperations.Enqueue(new ClientTerminationOperation(logger, processFactory, proxyFactory, runtimeHost, sessionContext, THIRTY_SECONDS));
sessionOperations.Enqueue(new ProctoringWorkaroundOperation(logger, sessionContext));
sessionOperations.Enqueue(new KioskModeOperation(desktopFactory, explorerShell, logger, processFactory, sessionContext));
sessionOperations.Enqueue(new ClientOperation(logger, processFactory, proxyFactory, runtimeHost, sessionContext, THIRTY_SECONDS));
sessionOperations.Enqueue(new SessionActivationOperation(logger, sessionContext));

View file

@ -0,0 +1,49 @@
/*
* Copyright (c) 2021 ETH Zürich, Educational Development and Technology (LET)
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using SafeExamBrowser.Core.Contracts.OperationModel;
using SafeExamBrowser.Core.Contracts.OperationModel.Events;
using SafeExamBrowser.Logging.Contracts;
using SafeExamBrowser.Settings.Security;
namespace SafeExamBrowser.Runtime.Operations
{
internal class ProctoringWorkaroundOperation : SessionOperation
{
private readonly ILogger logger;
public override event ActionRequiredEventHandler ActionRequired { add { } remove { } }
public override event StatusChangedEventHandler StatusChanged { add { } remove { } }
public ProctoringWorkaroundOperation(ILogger logger, SessionContext context) : base(context)
{
this.logger = logger;
}
public override OperationResult Perform()
{
if (Context.Next.Settings.Proctoring.Enabled && Context.Next.Settings.Security.KioskMode == KioskMode.CreateNewDesktop)
{
Context.Next.Settings.Security.KioskMode = KioskMode.DisableExplorerShell;
logger.Info("Switched kiosk mode to Disable Explorer Shell due to remote proctoring being enabled.");
}
return OperationResult.Success;
}
public override OperationResult Repeat()
{
return Perform();
}
public override OperationResult Revert()
{
return OperationResult.Success;
}
}
}

View file

@ -104,6 +104,7 @@
<Compile Include="Operations\Events\ServerFailureEventArgs.cs" />
<Compile Include="Operations\Events\UnexpectedErrorMessageArgs.cs" />
<Compile Include="Operations\KioskModeOperation.cs" />
<Compile Include="Operations\ProctoringWorkaroundOperation.cs" />
<Compile Include="Operations\RemoteSessionOperation.cs" />
<Compile Include="Operations\ServerOperation.cs" />
<Compile Include="Operations\ServiceOperation.cs" />