From 05db975785f01fa1f2b0d760719b6f98b2426819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 21 Oct 2021 11:17:27 +0200 Subject: [PATCH] SEBWIN-516: Added missing data mapping for raise hand feature and ensured that message panel is closed upon server confirmation. --- .../DataMapping/ProctoringDataMapper.cs | 22 +++++++++++++++++++ .../ConfigurationData/Keys.cs | 2 ++ .../ActionCenter/RaiseHandControl.xaml.cs | 1 + .../Controls/Taskbar/RaiseHandControl.xaml.cs | 1 + .../ActionCenter/RaiseHandControl.xaml.cs | 1 + .../Controls/Taskbar/RaiseHandControl.xaml.cs | 1 + 6 files changed, 28 insertions(+) diff --git a/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs b/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs index 77f600f2..1159bac6 100644 --- a/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs +++ b/SafeExamBrowser.Configuration/ConfigurationData/DataMapping/ProctoringDataMapper.cs @@ -17,6 +17,9 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping { switch (key) { + case Keys.Proctoring.ForceRaiseHandMessage: + MapForceRaiseHandMessage(settings, value); + break; case Keys.Proctoring.JitsiMeet.AllowChat: MapJitsiMeetAllowChat(settings, value); break; @@ -71,6 +74,9 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping case Keys.Proctoring.JitsiMeet.VideoMuted: MapJitsiMeetVideoMuted(settings, value); break; + case Keys.Proctoring.ShowRaiseHand: + MapShowRaiseHand(settings, value); + break; case Keys.Proctoring.ShowTaskbarNotification: MapShowTaskbarNotification(settings, value); break; @@ -128,6 +134,14 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping } } + private void MapForceRaiseHandMessage(AppSettings settings, object value) + { + if (value is bool force) + { + settings.Proctoring.ForceRaiseHandMessage = force; + } + } + private void MapJitsiMeetAllowChat(AppSettings settings, object value) { if (value is bool allow) @@ -272,6 +286,14 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping } } + private void MapShowRaiseHand(AppSettings settings, object value) + { + if (value is bool show) + { + settings.Proctoring.ShowRaiseHandNotification = show; + } + } + private void MapShowTaskbarNotification(AppSettings settings, object value) { if (value is bool show) diff --git a/SafeExamBrowser.Configuration/ConfigurationData/Keys.cs b/SafeExamBrowser.Configuration/ConfigurationData/Keys.cs index 0ba58f86..a27fb8cc 100644 --- a/SafeExamBrowser.Configuration/ConfigurationData/Keys.cs +++ b/SafeExamBrowser.Configuration/ConfigurationData/Keys.cs @@ -225,6 +225,8 @@ namespace SafeExamBrowser.Configuration.ConfigurationData internal static class Proctoring { + internal const string ForceRaiseHandMessage = "raiseHandButtonAlwaysPromptMessage"; + internal const string ShowRaiseHand = "raiseHandButtonShow"; internal const string ShowTaskbarNotification = "showProctoringViewButton"; internal const string WindowVisibility = "remoteProctoringViewShow"; diff --git a/SafeExamBrowser.UserInterface.Desktop/Controls/ActionCenter/RaiseHandControl.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Controls/ActionCenter/RaiseHandControl.xaml.cs index d3afa543..375d10ab 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Controls/ActionCenter/RaiseHandControl.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Controls/ActionCenter/RaiseHandControl.xaml.cs @@ -117,6 +117,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter Icon.Content = IconResourceLoader.Load(LoweredIcon); Message.IsEnabled = true; NotificationButton.ToolTip = text.Get(TextKey.Notification_ProctoringHandLowered); + Popup.IsOpen = false; Text.Text = text.Get(TextKey.Notification_ProctoringHandLowered); } diff --git a/SafeExamBrowser.UserInterface.Desktop/Controls/Taskbar/RaiseHandControl.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Controls/Taskbar/RaiseHandControl.xaml.cs index 8bd48d0e..f29aa9e5 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Controls/Taskbar/RaiseHandControl.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Controls/Taskbar/RaiseHandControl.xaml.cs @@ -123,6 +123,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Controls.Taskbar Icon.Content = IconResourceLoader.Load(LoweredIcon); Message.IsEnabled = true; NotificationButton.ToolTip = text.Get(TextKey.Notification_ProctoringHandLowered); + Popup.IsOpen = false; } private void ShowRaised() diff --git a/SafeExamBrowser.UserInterface.Mobile/Controls/ActionCenter/RaiseHandControl.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Controls/ActionCenter/RaiseHandControl.xaml.cs index 9bbb7108..cb64a3d7 100644 --- a/SafeExamBrowser.UserInterface.Mobile/Controls/ActionCenter/RaiseHandControl.xaml.cs +++ b/SafeExamBrowser.UserInterface.Mobile/Controls/ActionCenter/RaiseHandControl.xaml.cs @@ -117,6 +117,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.ActionCenter Icon.Content = IconResourceLoader.Load(LoweredIcon); Message.IsEnabled = true; NotificationButton.ToolTip = text.Get(TextKey.Notification_ProctoringHandLowered); + Popup.IsOpen = false; Text.Text = text.Get(TextKey.Notification_ProctoringHandLowered); } diff --git a/SafeExamBrowser.UserInterface.Mobile/Controls/Taskbar/RaiseHandControl.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Controls/Taskbar/RaiseHandControl.xaml.cs index a74f9e9c..a8ec68c1 100644 --- a/SafeExamBrowser.UserInterface.Mobile/Controls/Taskbar/RaiseHandControl.xaml.cs +++ b/SafeExamBrowser.UserInterface.Mobile/Controls/Taskbar/RaiseHandControl.xaml.cs @@ -124,6 +124,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Controls.Taskbar Icon.Content = IconResourceLoader.Load(LoweredIcon); Message.IsEnabled = true; NotificationButton.ToolTip = text.Get(TextKey.Notification_ProctoringHandLowered); + Popup.IsOpen = false; } private void ShowRaised()