SEBWIN-448: Started implementing remote proctoring disclaimer.
This commit is contained in:
parent
d48c333b6e
commit
f4a00beebb
11 changed files with 105 additions and 6 deletions
|
@ -214,6 +214,21 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
|||
}
|
||||
}
|
||||
|
||||
internal static class RemoteProctoring
|
||||
{
|
||||
internal const string Enabled = "jitsiMeetEnable";
|
||||
|
||||
internal static class JitsiMeet
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal static class Zoom
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
internal static class Security
|
||||
{
|
||||
internal const string AdminPasswordHash = "hashedAdminPassword";
|
||||
|
|
|
@ -98,6 +98,8 @@ namespace SafeExamBrowser.I18n.Contracts
|
|||
MessageBox_NotSupportedConfigurationResource,
|
||||
MessageBox_NotSupportedConfigurationResourceTitle,
|
||||
MessageBox_OkButton,
|
||||
MessageBox_ProctoringDisclaimer,
|
||||
MessageBox_ProctoringDisclaimerTitle,
|
||||
MessageBox_Quit,
|
||||
MessageBox_QuitTitle,
|
||||
MessageBox_QuitError,
|
||||
|
|
|
@ -252,6 +252,12 @@
|
|||
<Entry key="MessageBox_OkButton">
|
||||
OK
|
||||
</Entry>
|
||||
<Entry key="MessageBox_ProctoringDisclaimer">
|
||||
The current session will be remote proctored using a live video and audio stream, which is sent to an individually configured server. Ask your examinator about their privacy policy. SEB itself doesn't connect to any centralized SEB proctoring server, your exam provider decides which proctoring service/server to use.
|
||||
</Entry>
|
||||
<Entry key="MessageBox_ProctoringDisclaimerTitle">
|
||||
Starting Remote Proctoring
|
||||
</Entry>
|
||||
<Entry key="MessageBox_Quit">
|
||||
Do you want to quit SEB?
|
||||
</Entry>
|
||||
|
|
|
@ -84,6 +84,7 @@ namespace SafeExamBrowser.Runtime
|
|||
|
||||
sessionOperations.Enqueue(new SessionInitializationOperation(configuration, fileSystem, logger, runtimeHost, sessionContext));
|
||||
sessionOperations.Enqueue(new ConfigurationOperation(args, configuration, new FileSystem(), new HashAlgorithm(), logger, sessionContext));
|
||||
sessionOperations.Enqueue(new DisclaimerOperation(logger, sessionContext));
|
||||
sessionOperations.Enqueue(new ServerOperation(args, configuration, fileSystem, logger, sessionContext, server));
|
||||
sessionOperations.Enqueue(new RemoteSessionOperation(remoteSessionDetector, logger, sessionContext));
|
||||
sessionOperations.Enqueue(new VirtualMachineOperation(vmDetector, logger, sessionContext));
|
||||
|
|
70
SafeExamBrowser.Runtime/Operations/DisclaimerOperation.cs
Normal file
70
SafeExamBrowser.Runtime/Operations/DisclaimerOperation.cs
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* 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.I18n.Contracts;
|
||||
using SafeExamBrowser.Logging.Contracts;
|
||||
using SafeExamBrowser.Runtime.Operations.Events;
|
||||
using SafeExamBrowser.UserInterface.Contracts.MessageBox;
|
||||
|
||||
namespace SafeExamBrowser.Runtime.Operations
|
||||
{
|
||||
internal class DisclaimerOperation : SessionOperation
|
||||
{
|
||||
private readonly ILogger logger;
|
||||
|
||||
public override event ActionRequiredEventHandler ActionRequired;
|
||||
public override event StatusChangedEventHandler StatusChanged;
|
||||
|
||||
public DisclaimerOperation(ILogger logger, SessionContext context) : base(context)
|
||||
{
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public override OperationResult Perform()
|
||||
{
|
||||
return ShowDisclaimer();
|
||||
}
|
||||
|
||||
public override OperationResult Repeat()
|
||||
{
|
||||
return ShowDisclaimer();
|
||||
}
|
||||
|
||||
public override OperationResult Revert()
|
||||
{
|
||||
return OperationResult.Success;
|
||||
}
|
||||
|
||||
private OperationResult ShowDisclaimer()
|
||||
{
|
||||
var args = new MessageEventArgs
|
||||
{
|
||||
Icon = MessageBoxIcon.Question,
|
||||
Message = TextKey.MessageBox_ProctoringDisclaimer,
|
||||
Title = TextKey.MessageBox_ProctoringDisclaimerTitle
|
||||
};
|
||||
|
||||
ActionRequired?.Invoke(args);
|
||||
|
||||
if (args.Result == MessageBoxResult.Ok)
|
||||
{
|
||||
logger.Info("The user confirmed the remote proctoring disclaimer.");
|
||||
|
||||
return OperationResult.Success;
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.Warn("The user did not confirm the remote proctoring disclaimer! Aborting session initialization...");
|
||||
|
||||
return OperationResult.Aborted;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,14 +15,17 @@ namespace SafeExamBrowser.Runtime.Operations.Events
|
|||
{
|
||||
internal class MessageEventArgs : ActionRequiredEventArgs
|
||||
{
|
||||
internal MessageBoxAction Action { get; set; }
|
||||
internal MessageBoxIcon Icon { get; set; }
|
||||
internal TextKey Message { get; set; }
|
||||
internal MessageBoxResult Result { get; set; }
|
||||
internal TextKey Title { get; set; }
|
||||
internal Dictionary<string, string> MessagePlaceholders { get; private set; }
|
||||
internal Dictionary<string, string> TitlePlaceholders { get; private set; }
|
||||
|
||||
public MessageEventArgs()
|
||||
{
|
||||
Action = MessageBoxAction.Confirm;
|
||||
MessagePlaceholders = new Dictionary<string, string>();
|
||||
TitlePlaceholders = new Dictionary<string, string>();
|
||||
}
|
||||
|
|
|
@ -468,11 +468,11 @@ namespace SafeExamBrowser.Runtime
|
|||
|
||||
if (isStartup || isRunningOnDefaultDesktop)
|
||||
{
|
||||
messageBox.Show(message, title, MessageBoxAction.Confirm, args.Icon, runtimeWindow);
|
||||
args.Result = messageBox.Show(message, title, MessageBoxAction.Confirm, args.Icon, runtimeWindow);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowMessageBoxViaClient(message, title, MessageBoxAction.Confirm, args.Icon);
|
||||
args.Result = ShowMessageBoxViaClient(message, title, MessageBoxAction.Confirm, args.Icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
<Compile Include="Operations\ClientTerminationOperation.cs" />
|
||||
<Compile Include="Operations\ConfigurationBaseOperation.cs" />
|
||||
<Compile Include="Operations\ConfigurationOperation.cs" />
|
||||
<Compile Include="Operations\DisclaimerOperation.cs" />
|
||||
<Compile Include="Operations\Events\ClientConfigurationErrorMessageArgs.cs" />
|
||||
<Compile Include="Operations\Events\ConfigurationCompletedEventArgs.cs" />
|
||||
<Compile Include="Operations\Events\ExamSelectionEventArgs.cs" />
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace SafeExamBrowser.UserInterface.Contracts.MessageBox
|
|||
public enum MessageBoxAction
|
||||
{
|
||||
Confirm,
|
||||
ConfirmAbort,
|
||||
YesNo
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,15 +25,15 @@ namespace SafeExamBrowser.UserInterface.Desktop
|
|||
|
||||
public MessageBoxResult Show(string message, string title, MessageBoxAction action = MessageBoxAction.Confirm, MessageBoxIcon icon = MessageBoxIcon.Information, IWindow parent = null)
|
||||
{
|
||||
var result = default(System.Windows.MessageBoxResult);
|
||||
var result = System.Windows.MessageBoxResult.None;
|
||||
|
||||
if (parent is Window window)
|
||||
{
|
||||
result = window.Dispatcher.Invoke(() => System.Windows.MessageBox.Show(window, message, title, ToButton(action), ToImage(icon)));
|
||||
result = window.Dispatcher.Invoke(() => MessageBox.Show(window, message, title, ToButton(action), ToImage(icon)));
|
||||
}
|
||||
else
|
||||
{
|
||||
result = System.Windows.MessageBox.Show(message, title, ToButton(action), ToImage(icon));
|
||||
result = MessageBox.Show(message, title, ToButton(action), ToImage(icon));
|
||||
}
|
||||
|
||||
return ToResult(result);
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace SafeExamBrowser.UserInterface.Mobile
|
|||
|
||||
public MessageBoxResult Show(string message, string title, MessageBoxAction action = MessageBoxAction.Confirm, MessageBoxIcon icon = MessageBoxIcon.Information, IWindow parent = null)
|
||||
{
|
||||
var result = default(MessageBoxResult);
|
||||
var result = MessageBoxResult.None;
|
||||
|
||||
if (parent is Window window)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue