diff --git a/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs b/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs index 5bf05afa..f5de851c 100644 --- a/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs +++ b/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs @@ -6,8 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -using System; -using System.Collections.Generic; using SafeExamBrowser.Settings; using SafeExamBrowser.Settings.Proctoring; @@ -19,6 +17,9 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping { switch (key) { + case Keys.Proctoring.JitsiMeet.Enabled: + MapJitsiMeetEnabled(settings, value); + break; case Keys.Proctoring.JitsiMeet.RoomName: MapJitsiMeetRoomName(settings, value); break; @@ -37,20 +38,18 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping case Keys.Proctoring.WindowVisibility: MapWindowVisibility(settings, value); break; + case Keys.Proctoring.Zoom.Enabled: + MapZoomEnabled(settings, value); + break; } } - internal override void MapGlobal(IDictionary rawData, AppSettings settings) + private void MapJitsiMeetEnabled(AppSettings settings, object value) { - MapProctoringEnabled(rawData, settings); - } - - private void MapProctoringEnabled(IDictionary rawData, AppSettings settings) - { - var jitsiEnabled = rawData.TryGetValue(Keys.Proctoring.JitsiMeet.Enabled, out var v) && v is bool b && b; - var zoomEnabled = rawData.TryGetValue(Keys.Proctoring.Zoom.Enabled, out v) && v is bool b2 && b2; - - settings.Proctoring.Enabled = jitsiEnabled || zoomEnabled; + if (value is bool enabled) + { + settings.Proctoring.JitsiMeet.Enabled = enabled; + } } private void MapJitsiMeetRoomName(AppSettings settings, object value) @@ -119,5 +118,13 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping } } } + + private void MapZoomEnabled(AppSettings settings, object value) + { + if (value is bool enabled) + { + settings.Proctoring.Zoom.Enabled = enabled; + } + } } } diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/ProctoringWindow.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/ProctoringWindow.xaml.cs index 5594de78..1a554407 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/ProctoringWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/ProctoringWindow.xaml.cs @@ -61,7 +61,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows public void SetTitle(string title) { - Dispatcher.Invoke(() => Title = title); + Dispatcher.Invoke(() => Title = title ?? ""); } public new void Show()