diff --git a/SafeExamBrowser.Client/ClientContext.cs b/SafeExamBrowser.Client/ClientContext.cs index 1eff24ed..a8cd77c6 100644 --- a/SafeExamBrowser.Client/ClientContext.cs +++ b/SafeExamBrowser.Client/ClientContext.cs @@ -12,6 +12,7 @@ using SafeExamBrowser.Applications.Contracts; using SafeExamBrowser.Browser.Contracts; using SafeExamBrowser.Communication.Contracts.Hosts; using SafeExamBrowser.Configuration.Contracts; +using SafeExamBrowser.Proctoring.Contracts; using SafeExamBrowser.Server.Contracts; using SafeExamBrowser.Settings; using SafeExamBrowser.UserInterface.Contracts.Shell; @@ -49,7 +50,12 @@ namespace SafeExamBrowser.Client internal IClientHost ClientHost { get; set; } /// - /// The server proxy (if the current session mode is ). + /// The proctoring controller to be used if the current session runs with remote proctoring. + /// + internal IProctoringController ProctoringController { get; set; } + + /// + /// The server proxy to be used if the current session mode is . /// internal IServerProxy Server { get; set; } diff --git a/SafeExamBrowser.Client/CompositionRoot.cs b/SafeExamBrowser.Client/CompositionRoot.cs index c1cf5488..2a2fb805 100644 --- a/SafeExamBrowser.Client/CompositionRoot.cs +++ b/SafeExamBrowser.Client/CompositionRoot.cs @@ -31,6 +31,7 @@ using SafeExamBrowser.Monitoring.Display; using SafeExamBrowser.Monitoring.Keyboard; using SafeExamBrowser.Monitoring.Mouse; using SafeExamBrowser.Monitoring.System; +using SafeExamBrowser.Proctoring; using SafeExamBrowser.Server; using SafeExamBrowser.Settings.Logging; using SafeExamBrowser.Settings.UserInterface; @@ -126,6 +127,7 @@ namespace SafeExamBrowser.Client operations.Enqueue(new LazyInitializationOperation(BuildShellOperation)); operations.Enqueue(new LazyInitializationOperation(BuildBrowserOperation)); operations.Enqueue(new LazyInitializationOperation(BuildServerOperation)); + operations.Enqueue(new LazyInitializationOperation(BuildProctoringOperation)); operations.Enqueue(new ClipboardOperation(context, logger, nativeMethods)); var sequence = new OperationSequence(logger, operations); @@ -245,6 +247,16 @@ namespace SafeExamBrowser.Client return operation; } + private IOperation BuildProctoringOperation() + { + var controller = new ProctoringController(); + var operation = new ProctoringOperation(context, logger, controller); + + context.ProctoringController = controller; + + return operation; + } + private IOperation BuildServerOperation() { var server = new ServerProxy(context.AppConfig, ModuleLogger(nameof(ServerProxy)), powerSupply, wirelessAdapter); diff --git a/SafeExamBrowser.Client/Operations/ProctoringOperation.cs b/SafeExamBrowser.Client/Operations/ProctoringOperation.cs new file mode 100644 index 00000000..22077917 --- /dev/null +++ b/SafeExamBrowser.Client/Operations/ProctoringOperation.cs @@ -0,0 +1,40 @@ +/* + * 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.Proctoring.Contracts; + +namespace SafeExamBrowser.Client.Operations +{ + internal class ProctoringOperation : ClientOperation + { + private readonly ILogger logger; + private readonly IProctoringController controller; + + public override event ActionRequiredEventHandler ActionRequired; + public override event StatusChangedEventHandler StatusChanged; + + public ProctoringOperation(ClientContext context, ILogger logger, IProctoringController controller) : base(context) + { + this.controller = controller; + this.logger = logger; + } + + public override OperationResult Perform() + { + return OperationResult.Success; + } + + public override OperationResult Revert() + { + return OperationResult.Success; + } + } +} diff --git a/SafeExamBrowser.Client/SafeExamBrowser.Client.csproj b/SafeExamBrowser.Client/SafeExamBrowser.Client.csproj index 00a9545e..15372e38 100644 --- a/SafeExamBrowser.Client/SafeExamBrowser.Client.csproj +++ b/SafeExamBrowser.Client/SafeExamBrowser.Client.csproj @@ -81,6 +81,7 @@ + @@ -194,6 +195,14 @@ {EF563531-4EB5-44B9-A5EC-D6D6F204469B} SafeExamBrowser.Monitoring + + {8e52bd1c-0540-4f16-b181-6665d43f7a7b} + SafeExamBrowser.Proctoring.Contracts + + + {3f1f262e-a07c-4513-83c6-d7ef2f203ebf} + SafeExamBrowser.Proctoring + {db701e6f-bddc-4cec-b662-335a9dc11809} SafeExamBrowser.Server.Contracts diff --git a/SafeExamBrowser.Proctoring.Contracts/IProctoringController.cs b/SafeExamBrowser.Proctoring.Contracts/IProctoringController.cs new file mode 100644 index 00000000..ca771634 --- /dev/null +++ b/SafeExamBrowser.Proctoring.Contracts/IProctoringController.cs @@ -0,0 +1,18 @@ +/* + * 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/. + */ + +namespace SafeExamBrowser.Proctoring.Contracts +{ + /// + /// Defines the remote proctoring functionality. + /// + public interface IProctoringController + { + + } +} diff --git a/SafeExamBrowser.Proctoring.Contracts/Properties/AssemblyInfo.cs b/SafeExamBrowser.Proctoring.Contracts/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..ae7c495b --- /dev/null +++ b/SafeExamBrowser.Proctoring.Contracts/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SafeExamBrowser.Proctoring.Contracts")] +[assembly: AssemblyDescription("Safe Exam Browser")] +[assembly: AssemblyCompany("ETH Zürich")] +[assembly: AssemblyProduct("SafeExamBrowser.Proctoring.Contracts")] +[assembly: AssemblyCopyright("Copyright © 2021 ETH Zürich, Educational Development and Technology (LET)")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8e52bd1c-0540-4f16-b181-6665d43f7a7b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyInformationalVersion("1.0.0.0")] diff --git a/SafeExamBrowser.Proctoring.Contracts/SafeExamBrowser.Proctoring.Contracts.csproj b/SafeExamBrowser.Proctoring.Contracts/SafeExamBrowser.Proctoring.Contracts.csproj new file mode 100644 index 00000000..f4f0ef87 --- /dev/null +++ b/SafeExamBrowser.Proctoring.Contracts/SafeExamBrowser.Proctoring.Contracts.csproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + {8E52BD1C-0540-4F16-B181-6665D43F7A7B} + Library + Properties + SafeExamBrowser.Proctoring.Contracts + SafeExamBrowser.Proctoring.Contracts + v4.7.2 + 512 + true + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + + + + + + + + + + + \ No newline at end of file diff --git a/SafeExamBrowser.Proctoring/ProctoringController.cs b/SafeExamBrowser.Proctoring/ProctoringController.cs new file mode 100644 index 00000000..f5213743 --- /dev/null +++ b/SafeExamBrowser.Proctoring/ProctoringController.cs @@ -0,0 +1,17 @@ +/* + * 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.Proctoring.Contracts; + +namespace SafeExamBrowser.Proctoring +{ + public class ProctoringController : IProctoringController + { + + } +} diff --git a/SafeExamBrowser.Proctoring/Properties/AssemblyInfo.cs b/SafeExamBrowser.Proctoring/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..4b371efa --- /dev/null +++ b/SafeExamBrowser.Proctoring/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SafeExamBrowser.Proctoring")] +[assembly: AssemblyDescription("Safe Exam Browser")] +[assembly: AssemblyCompany("ETH Zürich")] +[assembly: AssemblyProduct("SafeExamBrowser.Proctoring")] +[assembly: AssemblyCopyright("Copyright © 2021 ETH Zürich, Educational Development and Technology (LET)")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3f1f262e-a07c-4513-83c6-d7ef2f203ebf")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyInformationalVersion("1.0.0.0")] diff --git a/SafeExamBrowser.Proctoring/SafeExamBrowser.Proctoring.csproj b/SafeExamBrowser.Proctoring/SafeExamBrowser.Proctoring.csproj new file mode 100644 index 00000000..f1c5af53 --- /dev/null +++ b/SafeExamBrowser.Proctoring/SafeExamBrowser.Proctoring.csproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF} + Library + Properties + SafeExamBrowser.Proctoring + SafeExamBrowser.Proctoring + v4.7.2 + 512 + true + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + + + + + + + + + + + + {64ea30fb-11d4-436a-9c2b-88566285363e} + SafeExamBrowser.Logging.Contracts + + + {8e52bd1c-0540-4f16-b181-6665d43f7a7b} + SafeExamBrowser.Proctoring.Contracts + + + + \ No newline at end of file diff --git a/SafeExamBrowser.sln b/SafeExamBrowser.sln index 664a75ae..4164ceec 100644 --- a/SafeExamBrowser.sln +++ b/SafeExamBrowser.sln @@ -108,6 +108,10 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup", "Setup\Setup.wixpro EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SetupBundle", "SetupBundle\SetupBundle.wixproj", "{95B68CBF-C483-4824-BB39-663E840519A0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SafeExamBrowser.Proctoring", "SafeExamBrowser.Proctoring\SafeExamBrowser.Proctoring.csproj", "{3F1F262E-A07C-4513-83C6-D7EF2F203EBF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SafeExamBrowser.Proctoring.Contracts", "SafeExamBrowser.Proctoring.Contracts\SafeExamBrowser.Proctoring.Contracts.csproj", "{8E52BD1C-0540-4F16-B181-6665D43F7A7B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -314,17 +318,6 @@ Global {BEF73897-0D04-4F40-AD89-62E24D260CD0}.Release|x64.Build.0 = Release|x64 {BEF73897-0D04-4F40-AD89-62E24D260CD0}.Release|x86.ActiveCfg = Release|x86 {BEF73897-0D04-4F40-AD89-62E24D260CD0}.Release|x86.Build.0 = Release|x86 - {0E14D163-557E-469E-9112-96936AF43A7B}.Debug|x64.ActiveCfg = Debug|x64 - {0E14D163-557E-469E-9112-96936AF43A7B}.Debug|x86.ActiveCfg = Debug|x86 - {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x64.ActiveCfg = Release|x64 - {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x64.Build.0 = Release|x64 - {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x86.ActiveCfg = Release|x86 - {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x86.Build.0 = Release|x86 - {95B68CBF-C483-4824-BB39-663E840519A0}.Debug|x64.ActiveCfg = Debug|x64 - {95B68CBF-C483-4824-BB39-663E840519A0}.Debug|x86.ActiveCfg = Debug|x86 - {95B68CBF-C483-4824-BB39-663E840519A0}.Release|x64.ActiveCfg = Release|x64 - {95B68CBF-C483-4824-BB39-663E840519A0}.Release|x86.ActiveCfg = Release|x86 - {95B68CBF-C483-4824-BB39-663E840519A0}.Release|x86.Build.0 = Release|x86 {5FB5273D-277C-41DD-8593-A25CE1AFF2E9}.Debug|x64.ActiveCfg = Debug|x64 {5FB5273D-277C-41DD-8593-A25CE1AFF2E9}.Debug|x64.Build.0 = Debug|x64 {5FB5273D-277C-41DD-8593-A25CE1AFF2E9}.Debug|x86.ActiveCfg = Debug|x86 @@ -467,6 +460,33 @@ Global {DB701E6F-BDDC-4CEC-B662-335A9DC11809}.Release|x64.Build.0 = Release|x64 {DB701E6F-BDDC-4CEC-B662-335A9DC11809}.Release|x86.ActiveCfg = Release|x86 {DB701E6F-BDDC-4CEC-B662-335A9DC11809}.Release|x86.Build.0 = Release|x86 + {0E14D163-557E-469E-9112-96936AF43A7B}.Debug|x64.ActiveCfg = Debug|x64 + {0E14D163-557E-469E-9112-96936AF43A7B}.Debug|x86.ActiveCfg = Debug|x86 + {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x64.ActiveCfg = Release|x64 + {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x64.Build.0 = Release|x64 + {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x86.ActiveCfg = Release|x86 + {0E14D163-557E-469E-9112-96936AF43A7B}.Release|x86.Build.0 = Release|x86 + {95B68CBF-C483-4824-BB39-663E840519A0}.Debug|x64.ActiveCfg = Debug|x64 + {95B68CBF-C483-4824-BB39-663E840519A0}.Debug|x86.ActiveCfg = Debug|x86 + {95B68CBF-C483-4824-BB39-663E840519A0}.Release|x64.ActiveCfg = Release|x64 + {95B68CBF-C483-4824-BB39-663E840519A0}.Release|x86.ActiveCfg = Release|x86 + {95B68CBF-C483-4824-BB39-663E840519A0}.Release|x86.Build.0 = Release|x86 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Debug|x64.ActiveCfg = Debug|x64 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Debug|x64.Build.0 = Debug|x64 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Debug|x86.ActiveCfg = Debug|x86 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Debug|x86.Build.0 = Debug|x86 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Release|x64.ActiveCfg = Release|x64 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Release|x64.Build.0 = Release|x64 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Release|x86.ActiveCfg = Release|x86 + {3F1F262E-A07C-4513-83C6-D7EF2F203EBF}.Release|x86.Build.0 = Release|x86 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Debug|x64.ActiveCfg = Debug|x64 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Debug|x64.Build.0 = Debug|x64 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Debug|x86.ActiveCfg = Debug|x86 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Debug|x86.Build.0 = Debug|x86 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Release|x64.ActiveCfg = Release|x64 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Release|x64.Build.0 = Release|x64 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Release|x86.ActiveCfg = Release|x86 + {8E52BD1C-0540-4F16-B181-6665D43F7A7B}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE