seb-win-refactoring/SafeExamBrowser.Proctoring/ProctoringFactory.cs

50 lines
1.6 KiB
C#
Raw Normal View History

/*
* Copyright (c) 2023 ETH Zürich, Educational Development and Technology (LET)
*
* 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 System.Collections.Generic;
using SafeExamBrowser.Configuration.Contracts;
using SafeExamBrowser.I18n.Contracts;
using SafeExamBrowser.Logging.Contracts;
using SafeExamBrowser.Proctoring.JitsiMeet;
using SafeExamBrowser.Settings.Proctoring;
using SafeExamBrowser.SystemComponents.Contracts;
using SafeExamBrowser.UserInterface.Contracts;
namespace SafeExamBrowser.Proctoring
{
internal class ProctoringFactory
{
private readonly AppConfig appConfig;
private readonly IFileSystem fileSystem;
private readonly IModuleLogger logger;
private readonly IText text;
private readonly IUserInterfaceFactory uiFactory;
public ProctoringFactory(AppConfig appConfig, IFileSystem fileSystem, IModuleLogger logger, IText text, IUserInterfaceFactory uiFactory)
{
this.appConfig = appConfig;
this.fileSystem = fileSystem;
this.logger = logger;
this.text = text;
this.uiFactory = uiFactory;
}
internal IEnumerable<ProctoringImplementation> CreateAllActive(ProctoringSettings settings)
{
var implementations = new List<ProctoringImplementation>();
if (settings.JitsiMeet.Enabled)
{
implementations.Add(new JitsiMeetImplementation(appConfig, fileSystem, logger.CloneFor(nameof(JitsiMeet)), settings, text, uiFactory));
}
return implementations;
}
}
}