SEBWIN-451: Implemented dynamic reconfiguration for proctoring.
This commit is contained in:
parent
55603f3221
commit
8d5560d3c4
5 changed files with 16 additions and 12 deletions
|
@ -117,21 +117,25 @@ namespace SafeExamBrowser.Proctoring
|
|||
settings.JitsiMeet.ServerUrl = serverUrl.Replace(Uri.UriSchemeHttps, "").Replace(Uri.UriSchemeHttp, "").Replace(Uri.SchemeDelimiter, "");
|
||||
settings.JitsiMeet.Token = token;
|
||||
|
||||
if (window != default(IProctoringWindow))
|
||||
{
|
||||
StopProctoring();
|
||||
}
|
||||
|
||||
StopProctoring();
|
||||
StartProctoring();
|
||||
}
|
||||
|
||||
private void Server_ProctoringConfigurationReceived(bool enableChat, bool receiveAudio, bool receiveVideo)
|
||||
private void Server_ProctoringConfigurationReceived(bool allowChat, bool receiveAudio, bool receiveVideo)
|
||||
{
|
||||
logger.Info("Proctoring configuration received.");
|
||||
|
||||
// TODO: How to set these things dynamically?!?
|
||||
settings.JitsiMeet.AllowChat = allowChat;
|
||||
settings.JitsiMeet.ReceiveAudio = receiveAudio;
|
||||
settings.JitsiMeet.ReceiveVideo = receiveVideo;
|
||||
|
||||
control.ExecuteScriptAsync("api.executeCommand('toggleChat');");
|
||||
if (allowChat || receiveVideo)
|
||||
{
|
||||
settings.WindowVisibility = WindowVisibility.AllowToHide;
|
||||
}
|
||||
|
||||
StopProctoring();
|
||||
StartProctoring();
|
||||
}
|
||||
|
||||
private void StartProctoring()
|
||||
|
|
|
@ -11,5 +11,5 @@ namespace SafeExamBrowser.Server.Contracts.Events
|
|||
/// <summary>
|
||||
/// Event handler used to indicate that proctoring configuration data has been received.
|
||||
/// </summary>
|
||||
public delegate void ProctoringConfigurationReceivedEventHandler(bool enableChat, bool receiveAudio, bool receiveVideo);
|
||||
public delegate void ProctoringConfigurationReceivedEventHandler(bool allowChat, bool receiveAudio, bool receiveVideo);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace SafeExamBrowser.Server.Data
|
|||
{
|
||||
internal class Attributes
|
||||
{
|
||||
public bool EnableChat { get; set; }
|
||||
public bool AllowChat { get; set; }
|
||||
public bool ReceiveAudio { get; set; }
|
||||
public bool ReceiveVideo { get; set; }
|
||||
public string RoomName { get; set; }
|
||||
|
|
|
@ -169,7 +169,7 @@ namespace SafeExamBrowser.Server
|
|||
attributes.Token = attributesJson["jitsiMeetToken"].Value<string>();
|
||||
break;
|
||||
case Instructions.PROCTORING_RECONFIGURATION:
|
||||
attributes.EnableChat = attributesJson["jitsiMeetFeatureFlagChat"].Value<bool>();
|
||||
attributes.AllowChat = attributesJson["jitsiMeetFeatureFlagChat"].Value<bool>();
|
||||
attributes.ReceiveAudio = attributesJson["jitsiMeetReceiveAudio"].Value<bool>();
|
||||
attributes.ReceiveVideo = attributesJson["jitsiMeetReceiveVideo"].Value<bool>();
|
||||
break;
|
||||
|
|
|
@ -396,7 +396,7 @@ namespace SafeExamBrowser.Server
|
|||
Task.Run(() => ProctoringInstructionReceived?.Invoke(attributes.RoomName, attributes.ServerUrl, attributes.Token));
|
||||
break;
|
||||
case Instructions.PROCTORING_RECONFIGURATION:
|
||||
Task.Run(() => ProctoringConfigurationReceived?.Invoke(attributes.EnableChat, attributes.ReceiveAudio, attributes.ReceiveVideo));
|
||||
Task.Run(() => ProctoringConfigurationReceived?.Invoke(attributes.AllowChat, attributes.ReceiveAudio, attributes.ReceiveVideo));
|
||||
break;
|
||||
case Instructions.QUIT:
|
||||
Task.Run(() => TerminationRequested?.Invoke());
|
||||
|
|
Loading…
Reference in a new issue