SEBWIN-449: Added scaffolding for remote proctoring feature.

This commit is contained in:
Damian Büchel 2021-02-10 23:21:48 +01:00
parent b3e5863538
commit 584951752a
11 changed files with 330 additions and 12 deletions

View file

@ -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; }
/// <summary>
/// The server proxy (if the current session mode is <see cref="SessionMode.Server"/>).
/// The proctoring controller to be used if the current session runs with remote proctoring.
/// </summary>
internal IProctoringController ProctoringController { get; set; }
/// <summary>
/// The server proxy to be used if the current session mode is <see cref="SessionMode.Server"/>.
/// </summary>
internal IServerProxy Server { get; set; }

View file

@ -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);

View file

@ -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;
}
}
}

View file

@ -81,6 +81,7 @@
<Compile Include="Operations\Events\ApplicationInitializationFailedEventArgs.cs" />
<Compile Include="Operations\Events\ApplicationTerminationEventArgs.cs" />
<Compile Include="Operations\Events\ApplicationTerminationFailedEventArgs.cs" />
<Compile Include="Operations\ProctoringOperation.cs" />
<Compile Include="Operations\RuntimeConnectionOperation.cs" />
<Compile Include="Communication\ClientHost.cs" />
<Compile Include="CompositionRoot.cs" />
@ -194,6 +195,14 @@
<Project>{EF563531-4EB5-44B9-A5EC-D6D6F204469B}</Project>
<Name>SafeExamBrowser.Monitoring</Name>
</ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.Proctoring.Contracts\SafeExamBrowser.Proctoring.Contracts.csproj">
<Project>{8e52bd1c-0540-4f16-b181-6665d43f7a7b}</Project>
<Name>SafeExamBrowser.Proctoring.Contracts</Name>
</ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.Proctoring\SafeExamBrowser.Proctoring.csproj">
<Project>{3f1f262e-a07c-4513-83c6-d7ef2f203ebf}</Project>
<Name>SafeExamBrowser.Proctoring</Name>
</ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.Server.Contracts\SafeExamBrowser.Server.Contracts.csproj">
<Project>{db701e6f-bddc-4cec-b662-335a9dc11809}</Project>
<Name>SafeExamBrowser.Server.Contracts</Name>

View file

@ -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
{
/// <summary>
/// Defines the remote proctoring functionality.
/// </summary>
public interface IProctoringController
{
}
}

View file

@ -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")]

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8E52BD1C-0540-4F16-B181-6665D43F7A7B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SafeExamBrowser.Proctoring.Contracts</RootNamespace>
<AssemblyName>SafeExamBrowser.Proctoring.Contracts</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="IProctoringController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -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
{
}
}

View file

@ -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")]

View file

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3F1F262E-A07C-4513-83C6-D7EF2F203EBF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SafeExamBrowser.Proctoring</RootNamespace>
<AssemblyName>SafeExamBrowser.Proctoring</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="ProctoringController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SafeExamBrowser.Logging.Contracts\SafeExamBrowser.Logging.Contracts.csproj">
<Project>{64ea30fb-11d4-436a-9c2b-88566285363e}</Project>
<Name>SafeExamBrowser.Logging.Contracts</Name>
</ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.Proctoring.Contracts\SafeExamBrowser.Proctoring.Contracts.csproj">
<Project>{8e52bd1c-0540-4f16-b181-6665d43f7a7b}</Project>
<Name>SafeExamBrowser.Proctoring.Contracts</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -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