SEBWIN-775: Removed Zoom proctoring implementation.
This commit is contained in:
parent
75016158c5
commit
8c3d9a31d7
5 changed files with 28 additions and 241 deletions
|
@ -76,17 +76,12 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
||||||
|
|
||||||
private void InitializeProctoringSettings(AppSettings settings)
|
private void InitializeProctoringSettings(AppSettings settings)
|
||||||
{
|
{
|
||||||
settings.Proctoring.Enabled = settings.Proctoring.JitsiMeet.Enabled || settings.Proctoring.Zoom.Enabled;
|
settings.Proctoring.Enabled = settings.Proctoring.JitsiMeet.Enabled;
|
||||||
|
|
||||||
if (settings.Proctoring.JitsiMeet.Enabled && !settings.Proctoring.JitsiMeet.ReceiveVideo)
|
if (settings.Proctoring.JitsiMeet.Enabled && !settings.Proctoring.JitsiMeet.ReceiveVideo)
|
||||||
{
|
{
|
||||||
settings.Proctoring.WindowVisibility = WindowVisibility.Hidden;
|
settings.Proctoring.WindowVisibility = WindowVisibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.Proctoring.Zoom.Enabled && !settings.Proctoring.Zoom.ReceiveVideo)
|
|
||||||
{
|
|
||||||
settings.Proctoring.WindowVisibility = WindowVisibility.Hidden;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveLegacyBrowsers(AppSettings settings)
|
private void RemoveLegacyBrowsers(AppSettings settings)
|
||||||
|
|
|
@ -94,14 +94,6 @@ namespace SafeExamBrowser.Proctoring
|
||||||
credentials.Add(new JProperty("subject", settings.JitsiMeet.ShowMeetingName ? settings.JitsiMeet.Subject : ""));
|
credentials.Add(new JProperty("subject", settings.JitsiMeet.ShowMeetingName ? settings.JitsiMeet.Subject : ""));
|
||||||
credentials.Add(new JProperty("token", settings.JitsiMeet.Token));
|
credentials.Add(new JProperty("token", settings.JitsiMeet.Token));
|
||||||
}
|
}
|
||||||
else if (settings.Zoom.Enabled)
|
|
||||||
{
|
|
||||||
credentials.Add(new JProperty("meetingNumber", settings.Zoom.MeetingNumber));
|
|
||||||
credentials.Add(new JProperty("password", settings.Zoom.Password));
|
|
||||||
credentials.Add(new JProperty("sdkKey", settings.Zoom.SdkKey));
|
|
||||||
credentials.Add(new JProperty("signature", settings.Zoom.Signature));
|
|
||||||
credentials.Add(new JProperty("userName", settings.Zoom.UserName));
|
|
||||||
}
|
|
||||||
|
|
||||||
message.Add("credentials", credentials);
|
message.Add("credentials", credentials);
|
||||||
logger.Debug("Sending credentials to proctoring client.");
|
logger.Debug("Sending credentials to proctoring client.");
|
||||||
|
|
|
@ -101,12 +101,6 @@ namespace SafeExamBrowser.Proctoring
|
||||||
start = !string.IsNullOrWhiteSpace(settings.JitsiMeet.RoomName);
|
start = !string.IsNullOrWhiteSpace(settings.JitsiMeet.RoomName);
|
||||||
start &= !string.IsNullOrWhiteSpace(settings.JitsiMeet.ServerUrl);
|
start &= !string.IsNullOrWhiteSpace(settings.JitsiMeet.ServerUrl);
|
||||||
}
|
}
|
||||||
else if (settings.Zoom.Enabled)
|
|
||||||
{
|
|
||||||
start = !string.IsNullOrWhiteSpace(settings.Zoom.SdkKey) && !string.IsNullOrWhiteSpace(settings.Zoom.Signature);
|
|
||||||
start &= !string.IsNullOrWhiteSpace(settings.Zoom.MeetingNumber);
|
|
||||||
start &= !string.IsNullOrWhiteSpace(settings.Zoom.UserName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (start)
|
if (start)
|
||||||
{
|
{
|
||||||
|
@ -167,13 +161,6 @@ namespace SafeExamBrowser.Proctoring
|
||||||
settings.JitsiMeet.ServerUrl = args.JitsiMeetServerUrl;
|
settings.JitsiMeet.ServerUrl = args.JitsiMeetServerUrl;
|
||||||
settings.JitsiMeet.Token = args.JitsiMeetToken;
|
settings.JitsiMeet.Token = args.JitsiMeetToken;
|
||||||
|
|
||||||
settings.Zoom.MeetingNumber = args.ZoomMeetingNumber;
|
|
||||||
settings.Zoom.Password = args.ZoomPassword;
|
|
||||||
settings.Zoom.SdkKey = args.ZoomSdkKey;
|
|
||||||
settings.Zoom.Signature = args.ZoomSignature;
|
|
||||||
settings.Zoom.Subject = args.ZoomSubject;
|
|
||||||
settings.Zoom.UserName = args.ZoomUserName;
|
|
||||||
|
|
||||||
StopProctoring();
|
StopProctoring();
|
||||||
StartProctoring();
|
StartProctoring();
|
||||||
}
|
}
|
||||||
|
@ -186,10 +173,6 @@ namespace SafeExamBrowser.Proctoring
|
||||||
settings.JitsiMeet.ReceiveAudio = receiveAudio;
|
settings.JitsiMeet.ReceiveAudio = receiveAudio;
|
||||||
settings.JitsiMeet.ReceiveVideo = receiveVideo;
|
settings.JitsiMeet.ReceiveVideo = receiveVideo;
|
||||||
|
|
||||||
settings.Zoom.AllowChat = allowChat;
|
|
||||||
settings.Zoom.ReceiveAudio = receiveAudio;
|
|
||||||
settings.Zoom.ReceiveVideo = receiveVideo;
|
|
||||||
|
|
||||||
if (allowChat || receiveVideo)
|
if (allowChat || receiveVideo)
|
||||||
{
|
{
|
||||||
settings.WindowVisibility = WindowVisibility.AllowToHide;
|
settings.WindowVisibility = WindowVisibility.AllowToHide;
|
||||||
|
@ -225,26 +208,19 @@ namespace SafeExamBrowser.Proctoring
|
||||||
});
|
});
|
||||||
|
|
||||||
window = uiFactory.CreateProctoringWindow(control);
|
window = uiFactory.CreateProctoringWindow(control);
|
||||||
window.SetTitle(settings.JitsiMeet.Enabled ? settings.JitsiMeet.Subject : settings.Zoom.Subject);
|
window.SetTitle(settings.JitsiMeet.Enabled ? settings.JitsiMeet.Subject : "");
|
||||||
window.Show();
|
window.Show();
|
||||||
|
|
||||||
if (settings.WindowVisibility == WindowVisibility.AllowToShow || settings.WindowVisibility == WindowVisibility.Hidden)
|
if (settings.WindowVisibility == WindowVisibility.AllowToShow || settings.WindowVisibility == WindowVisibility.Hidden)
|
||||||
{
|
|
||||||
if (settings.Zoom.Enabled)
|
|
||||||
{
|
|
||||||
window.HideWithDelay();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
window.Hide();
|
window.Hide();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
IconResource = new XamlIconResource { Uri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Desktop;component/Images/ProctoringNotification_Active.xaml") };
|
IconResource = new XamlIconResource { Uri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Desktop;component/Images/ProctoringNotification_Active.xaml") };
|
||||||
Tooltip = text.Get(TextKey.Notification_ProctoringActiveTooltip);
|
Tooltip = text.Get(TextKey.Notification_ProctoringActiveTooltip);
|
||||||
NotificationChanged?.Invoke();
|
NotificationChanged?.Invoke();
|
||||||
|
|
||||||
logger.Info($"Started proctoring with {(settings.JitsiMeet.Enabled ? "Jitsi Meet" : "Zoom")}.");
|
logger.Info($"Started proctoring with {(settings.JitsiMeet.Enabled ? "Jitsi Meet" : "")}.");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -263,10 +239,6 @@ namespace SafeExamBrowser.Proctoring
|
||||||
{
|
{
|
||||||
control.ExecuteScriptAsync("api.executeCommand('hangup'); api.dispose();");
|
control.ExecuteScriptAsync("api.executeCommand('hangup'); api.dispose();");
|
||||||
}
|
}
|
||||||
else if (settings.Zoom.Enabled)
|
|
||||||
{
|
|
||||||
control.ExecuteScriptAsync("ZoomMtg.leaveMeeting({});");
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
|
|
||||||
|
@ -282,9 +254,10 @@ namespace SafeExamBrowser.Proctoring
|
||||||
|
|
||||||
private string LoadContent(ProctoringSettings settings)
|
private string LoadContent(ProctoringSettings settings)
|
||||||
{
|
{
|
||||||
var provider = settings.JitsiMeet.Enabled ? "JitsiMeet" : "Zoom";
|
if (settings.JitsiMeet.Enabled)
|
||||||
|
{
|
||||||
var assembly = Assembly.GetAssembly(typeof(ProctoringController));
|
var assembly = Assembly.GetAssembly(typeof(ProctoringController));
|
||||||
var path = $"{typeof(ProctoringController).Namespace}.{provider}.index.html";
|
var path = $"{typeof(ProctoringController).Namespace}.JitsiMeet.index.html";
|
||||||
|
|
||||||
using (var stream = assembly.GetManifestResourceStream(path))
|
using (var stream = assembly.GetManifestResourceStream(path))
|
||||||
using (var reader = new StreamReader(stream))
|
using (var reader = new StreamReader(stream))
|
||||||
|
@ -302,18 +275,15 @@ namespace SafeExamBrowser.Proctoring
|
||||||
html = html.Replace("'%_AUDIO_ONLY_%'", settings.JitsiMeet.AudioOnly ? "true" : "false");
|
html = html.Replace("'%_AUDIO_ONLY_%'", settings.JitsiMeet.AudioOnly ? "true" : "false");
|
||||||
html = html.Replace("'%_VIDEO_MUTED_%'", settings.JitsiMeet.VideoMuted && settings.WindowVisibility != WindowVisibility.Hidden ? "true" : "false");
|
html = html.Replace("'%_VIDEO_MUTED_%'", settings.JitsiMeet.VideoMuted && settings.WindowVisibility != WindowVisibility.Hidden ? "true" : "false");
|
||||||
}
|
}
|
||||||
else if (settings.Zoom.Enabled)
|
|
||||||
{
|
|
||||||
html = html.Replace("'%_ALLOW_CHAT_%'", settings.Zoom.AllowChat ? "true" : "false");
|
|
||||||
html = html.Replace("'%_ALLOW_CLOSED_CAPTIONS_%'", settings.Zoom.AllowClosedCaptions ? "true" : "false");
|
|
||||||
html = html.Replace("'%_ALLOW_RAISE_HAND_%'", settings.Zoom.AllowRaiseHand ? "true" : "false");
|
|
||||||
html = html.Replace("'%_AUDIO_MUTED_%'", settings.Zoom.AudioMuted && settings.WindowVisibility != WindowVisibility.Hidden ? "true" : "false");
|
|
||||||
html = html.Replace("'%_VIDEO_MUTED_%'", settings.Zoom.VideoMuted && settings.WindowVisibility != WindowVisibility.Hidden ? "true" : "false");
|
|
||||||
}
|
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string Sanitize(string serverUrl)
|
private string Sanitize(string serverUrl)
|
||||||
{
|
{
|
||||||
|
|
|
@ -117,7 +117,6 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="JitsiMeet\index.html" />
|
<EmbeddedResource Include="JitsiMeet\index.html" />
|
||||||
<EmbeddedResource Include="Zoom\index.html" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
|
|
@ -1,169 +0,0 @@
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/2.10.1/css/bootstrap.css" />
|
|
||||||
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/2.10.1/css/react-select.css" />
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta http-equiv="origin-trial" content="" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script src="https://source.zoom.us/2.10.1/lib/vendor/react.min.js"></script>
|
|
||||||
<script src="https://source.zoom.us/2.10.1/lib/vendor/react-dom.min.js"></script>
|
|
||||||
<script src="https://source.zoom.us/2.10.1/lib/vendor/redux.min.js"></script>
|
|
||||||
<script src="https://source.zoom.us/2.10.1/lib/vendor/redux-thunk.min.js"></script>
|
|
||||||
<script src="https://source.zoom.us/2.10.1/lib/vendor/lodash.min.js"></script>
|
|
||||||
<script src="https://source.zoom.us/zoom-meeting-2.10.1.min.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var audioJoin = 0;
|
|
||||||
var videoJoin = 0;
|
|
||||||
var join = 0;
|
|
||||||
|
|
||||||
function controlUserInterface(_) {
|
|
||||||
var audioButton = document.getElementsByClassName('join-audio-container__btn')[0];
|
|
||||||
var audioContainer = audioButton ? audioButton.parentElement : null;
|
|
||||||
var chat = document.querySelector("div[feature-type='chat']");
|
|
||||||
var fullScreenButton = document.getElementsByClassName('full-screen-icon')[0];
|
|
||||||
var info = document.getElementsByClassName('meeting-info-container')[0];
|
|
||||||
var joinAudioButton = document.getElementsByClassName('join-audio-by-voip__join-btn')[0];
|
|
||||||
var joinButton = document.getElementsByClassName('joinWindowBtn')[0];
|
|
||||||
var leave = document.getElementsByClassName('footer__leave-btn-container')[0];
|
|
||||||
var more = document.querySelector("div[feature-type='more']");
|
|
||||||
var participants = document.querySelector("div[feature-type='participants']");
|
|
||||||
var reaction = document.querySelector("div[feature-type='reaction']");
|
|
||||||
var settings = document.querySelector("div[feature-type='settings']");
|
|
||||||
var sharing = document.querySelector("div[feature-type='sharing']");
|
|
||||||
var videoButton = document.getElementsByClassName('send-video-container__btn')[0];
|
|
||||||
var videoContainer = videoButton ? videoButton.parentElement : null;
|
|
||||||
|
|
||||||
if (audioContainer && !'%_AUDIO_MUTED_%') {
|
|
||||||
audioContainer.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (chat && !'%_ALLOW_CHAT_%') {
|
|
||||||
chat.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fullScreenButton) {
|
|
||||||
fullScreenButton.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (info) {
|
|
||||||
info.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (joinAudioButton && !'%_AUDIO_MUTED_%' && audioJoin < 500) {
|
|
||||||
joinAudioButton.click();
|
|
||||||
audioJoin++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (joinButton && join < 500) {
|
|
||||||
joinButton.click();
|
|
||||||
join++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (leave) {
|
|
||||||
leave.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (more) {
|
|
||||||
more.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (participants) {
|
|
||||||
participants.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reaction) {
|
|
||||||
reaction.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings) {
|
|
||||||
settings.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sharing) {
|
|
||||||
sharing.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (videoButton && !'%_VIDEO_MUTED_%' && videoJoin < 500) {
|
|
||||||
videoButton.click();
|
|
||||||
videoJoin++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (videoContainer && !'%_VIDEO_MUTED_%') {
|
|
||||||
videoContainer.style.visibility = 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
requestAnimationFrame(controlUserInterface);
|
|
||||||
}
|
|
||||||
|
|
||||||
function startMeeting(credentials) {
|
|
||||||
var error = function (res) {
|
|
||||||
alert(`Failed to initialize meeting: ${JSON.stringify(res)}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
var success = function () {
|
|
||||||
requestAnimationFrame(controlUserInterface);
|
|
||||||
|
|
||||||
ZoomMtg.join({
|
|
||||||
meetingNumber: new Number(credentials.meetingNumber),
|
|
||||||
passWord: credentials.password,
|
|
||||||
sdkKey: credentials.sdkKey,
|
|
||||||
signature: credentials.signature,
|
|
||||||
userName: credentials.userName,
|
|
||||||
error: function (res) {
|
|
||||||
alert(`Failed to join meeting: ${JSON.stringify(res)}`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var params = {
|
|
||||||
audioPanelAlwaysOpen: false,
|
|
||||||
disableCallOut: true,
|
|
||||||
disableInvite: true,
|
|
||||||
disableJoinAudio: false,
|
|
||||||
disableRecord: true,
|
|
||||||
disableReport: true,
|
|
||||||
disableVoIP: false,
|
|
||||||
leaveUrl: 'doesnotexist',
|
|
||||||
isLockBottom: true,
|
|
||||||
isShowJoiningErrorDialog: true,
|
|
||||||
isSupportAV: true,
|
|
||||||
isSupportBreakout: false,
|
|
||||||
isSupportChat: '%_ALLOW_CHAT_%',
|
|
||||||
isSupportCC: '%_ALLOW_CLOSED_CAPTIONS_%',
|
|
||||||
isSupportPolling: false,
|
|
||||||
isSupportQA: false,
|
|
||||||
isSupportNonverbal: false,
|
|
||||||
screenShare: false,
|
|
||||||
sharingMode: 'both',
|
|
||||||
showMeetingHeader: true,
|
|
||||||
showPureSharingContent: false,
|
|
||||||
videoDrag: true,
|
|
||||||
videoHeader: true,
|
|
||||||
meetingInfo: ['topic', 'host', 'participant'],
|
|
||||||
error: error,
|
|
||||||
success: success
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!ZoomMtg.checkSystemRequirements()) {
|
|
||||||
alert('This system does not meet the necessary requirements for Zoom!');
|
|
||||||
}
|
|
||||||
|
|
||||||
ZoomMtg.setZoomJSLib('https://source.zoom.us/2.10.1/lib', '/av');
|
|
||||||
ZoomMtg.preLoadWasm();
|
|
||||||
ZoomMtg.prepareWebSDK();
|
|
||||||
ZoomMtg.init(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
function webMessageReceived(args) {
|
|
||||||
if ('credentials' in args.data) {
|
|
||||||
startMeeting(args.data.credentials);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('unload', () => ZoomMtg.leaveMeeting({}));
|
|
||||||
window.chrome.webview.addEventListener('message', webMessageReceived);
|
|
||||||
window.chrome.webview.postMessage('credentials');
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Add table
Reference in a new issue