2024-01-18 18:02:21 +01:00
|
|
|
|
/*
|
2024-03-05 18:13:14 +01:00
|
|
|
|
* Copyright (c) 2022 ETH Zürich, IT Services
|
2024-01-18 18:02:21 +01:00
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using SafeExamBrowser.Core.Contracts.Notifications;
|
|
|
|
|
using SafeExamBrowser.Core.Contracts.Notifications.Events;
|
|
|
|
|
using SafeExamBrowser.Core.Contracts.Resources.Icons;
|
2024-02-29 21:05:43 +01:00
|
|
|
|
using SafeExamBrowser.Proctoring.Contracts.Events;
|
2024-02-01 17:36:11 +01:00
|
|
|
|
using SafeExamBrowser.Server.Contracts.Events.Proctoring;
|
2024-01-18 18:02:21 +01:00
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.Proctoring
|
|
|
|
|
{
|
|
|
|
|
internal abstract class ProctoringImplementation : INotification
|
|
|
|
|
{
|
|
|
|
|
internal abstract string Name { get; }
|
|
|
|
|
|
2024-02-23 18:32:44 +01:00
|
|
|
|
public bool CanActivate { get; protected set; }
|
2024-02-01 17:36:11 +01:00
|
|
|
|
public string Tooltip { get; protected set; }
|
|
|
|
|
public IconResource IconResource { get; protected set; }
|
2024-01-18 18:02:21 +01:00
|
|
|
|
|
2024-02-29 21:05:43 +01:00
|
|
|
|
internal event RemainingWorkUpdatedEventHandler RemainingWorkUpdated;
|
|
|
|
|
public event NotificationChangedEventHandler NotificationChanged;
|
2024-01-18 18:02:21 +01:00
|
|
|
|
|
2024-02-01 17:36:11 +01:00
|
|
|
|
void INotification.Activate()
|
|
|
|
|
{
|
|
|
|
|
ActivateNotification();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void INotification.Terminate()
|
|
|
|
|
{
|
|
|
|
|
TerminateNotification();
|
|
|
|
|
}
|
2024-01-18 18:02:21 +01:00
|
|
|
|
|
|
|
|
|
internal abstract void Initialize();
|
|
|
|
|
internal abstract void ProctoringConfigurationReceived(bool allowChat, bool receiveAudio, bool receiveVideo);
|
2024-02-01 17:36:11 +01:00
|
|
|
|
internal abstract void ProctoringInstructionReceived(InstructionEventArgs args);
|
|
|
|
|
internal abstract void Start();
|
|
|
|
|
internal abstract void Stop();
|
2024-01-22 10:38:05 +01:00
|
|
|
|
internal abstract void Terminate();
|
2024-02-01 17:36:11 +01:00
|
|
|
|
|
2024-02-29 21:05:43 +01:00
|
|
|
|
internal virtual void ExecuteRemainingWork() { }
|
|
|
|
|
internal virtual bool HasRemainingWork() => false;
|
|
|
|
|
|
2024-02-16 19:42:41 +01:00
|
|
|
|
protected virtual void ActivateNotification() { }
|
|
|
|
|
protected virtual void TerminateNotification() { }
|
2024-02-29 21:05:43 +01:00
|
|
|
|
|
|
|
|
|
protected void InvokeNotificationChanged()
|
|
|
|
|
{
|
|
|
|
|
NotificationChanged?.Invoke();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void InvokeRemainingWorkUpdated(RemainingWorkUpdatedEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
RemainingWorkUpdated?.Invoke(args);
|
|
|
|
|
}
|
2024-01-18 18:02:21 +01:00
|
|
|
|
}
|
|
|
|
|
}
|