@@ -20,6 +20,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
2020{
2121 public partial class ProctoringFinalizationDialog : Window , IProctoringFinalizationDialog
2222 {
23+ private readonly bool requiresPassword ;
2324 private readonly IText text ;
2425
2526 private WindowClosedEventHandler closed ;
@@ -42,8 +43,9 @@ event WindowClosingEventHandler IWindow.Closing
4243 remove { closing -= value ; }
4344 }
4445
45- public ProctoringFinalizationDialog ( IText text )
46+ public ProctoringFinalizationDialog ( bool requiresPassword , IText text )
4647 {
48+ this . requiresPassword = requiresPassword ;
4749 this . text = text ;
4850
4951 InitializeComponent ( ) ;
@@ -84,12 +86,15 @@ private void InitializeCancellation()
8486 Button . Click += Button_Click ;
8587 Button . Content = text . Get ( TextKey . ProctoringFinalizationDialog_Abort ) ;
8688
87- PasswordPanel . Visibility = Visibility . Visible ;
88- PasswordLabel . Text = text . Get ( TextKey . ProctoringFinalizationDialog_PasswordMessage ) ;
89- Password . KeyDown += Password_KeyDown ;
90- Password . Focus ( ) ;
89+ if ( requiresPassword )
90+ {
91+ PasswordPanel . Visibility = Visibility . Visible ;
92+ PasswordLabel . Text = text . Get ( TextKey . ProctoringFinalizationDialog_PasswordMessage ) ;
93+ Password . KeyDown += Password_KeyDown ;
94+ Password . Focus ( ) ;
9195
92- Height += PasswordPanel . ActualHeight + PasswordPanel . Margin . Top + PasswordPanel . Margin . Bottom ;
96+ Height += PasswordPanel . ActualHeight + PasswordPanel . Margin . Top + PasswordPanel . Margin . Bottom ;
97+ }
9398 initialized = true ;
9499 }
95100
0 commit comments