Пример #1
0
 public AuthController(ExtensibleDbContext dbCtx)
 {
     _dbCtx        = dbCtx;
     _config       = SystemConfig.LoadConfig();
     _tokenManager = new TokenManager(_dbCtx, _config);
     _scryptHasher = new ScryptEncoder();
 }
Пример #2
0
 public CourseDataTableManager(ExtensibleDbContext dbCtx, List <DataTableStudent> students = null)
 {
     _dbCtx            = dbCtx;
     _config           = SystemConfig.LoadConfig();
     _canvasDataAccess = new CanvasDataAccess(_config);
     Students          = students;
 }
Пример #3
0
 public CanvasAccessTokenController(ExtensibleDbContext dbCtx)
 {
     _dbCtx              = dbCtx;
     _config             = SystemConfig.LoadConfig();
     _tokenManager       = new TokenManager(_dbCtx, _config);
     _canvasTokenManager = new CanvasTokenManager(_dbCtx);
 }
Пример #4
0
 public CourseTabsController(ExtensibleDbContext dbCtx)
 {
     _dbCtx              = dbCtx;
     _config             = SystemConfig.LoadConfig();
     _tokenManager       = new TokenManager(_dbCtx, _config);
     _canvasTokenManager = new CanvasTokenManager(_dbCtx);
     _canvasDataAccess   = new CanvasDataAccess(_config);
     _tableManager       = new CourseDataTableManager(_dbCtx);
 }
Пример #5
0
        private static void GetCustomDataColumns(ref CourseDataTable table, string accessToken, int courseId,
                                                 ExtensibleDbContext dbCtx)
        {
            var customCols = new List <CourseDataColumn>();
            var config     = SystemConfig.LoadConfig();
            var colManager = new CourseDataTableManager(dbCtx, table.Students);

            table.CustomDataColumns = colManager.GetCustomDataColumns(accessToken, courseId);
        }
Пример #6
0
        public AuthControllerTests()
        {
            _config = SystemConfig.LoadConfig();
            DbContextOptionsBuilder <ExtensibleDbContext> optionsBuilder = new();

            optionsBuilder.UseSqlServer(_config.testDbConnString);
            _dbCtx   = new ExtensibleDbContext(optionsBuilder.Options);
            _encoder = new ScryptEncoder();
            SetupContext();
        }
Пример #7
0
        public UserManagementControllerTests()
        {
            _config = SystemConfig.LoadConfig();
            DbContextOptionsBuilder <ExtensibleDbContext> optionsBuilder = new();

            optionsBuilder.UseSqlServer(_config.testDbConnString);
            _dbCtx    = new ExtensibleDbContext(optionsBuilder.Options);
            _encoder  = new ScryptEncoder();
            _accounts = GenerateUserList();
            SetupContext();
        }
        public CanvasPersonalAccessTokenControllerTests()
        {
            _config = SystemConfig.LoadConfig();
            DbContextOptionsBuilder <ExtensibleDbContext> optionsBuilder = new();

            optionsBuilder.UseSqlServer(_config.testDbConnString);
            _dbCtx             = new ExtensibleDbContext(optionsBuilder.Options);
            _encoder           = new ScryptEncoder();
            _canvasTokenHelper = new CanvasTokenHelper();
            _accounts          = new List <ApplicationUserAccount>();
            SetupContext();
        }
Пример #9
0
 public UserCustomDataManager(ExtensibleDbContext dbCtx)
 {
     _dbCtx            = dbCtx;
     _config           = SystemConfig.LoadConfig();
     _canvasDataAccess = new CanvasDataAccess(_config);
 }
 public CanvasTokenManager(ExtensibleDbContext dbCtx)
 {
     _dbCtx = dbCtx;
 }
Пример #11
0
 public TokenManager(ExtensibleDbContext dbCtx, SystemConfig config)
 {
     _dbCtx  = dbCtx;
     _config = config;
 }
Пример #12
0
        /// <summary>
        /// Creates an instance of and loads the data table and all its related columns and the rows for those columns
        /// </summary>
        /// <param name="courseId">The id of the course for which to retreive the Canvas Gradebook for</param>
        /// <param name="accessToken">The Canvas access token for the user</param>
        /// <param name="dbContext">The database context of the application</param>
        /// <returns>CourseDataTable: A re-representation of the Canvas Gradebook for the purposes of this system</returns>
        public static CourseDataTable LoadDataTable(int courseId, string accessToken, ExtensibleDbContext dbContext)
        {
            var table = new CourseDataTable
            {
                CourseId = courseId
            };

            // Load students
            var students = GetStudents(courseId, accessToken);

            table.Students = students;

            // Load assignment columns and data rows
            var assignmentCols = GetAssignmentColumns(courseId, accessToken);

            table.AssignmentGradeColumns = assignmentCols;
            PopulateAssignmentRows(ref table, accessToken, courseId);

            // Load custom data columns into table with row data
            GetCustomDataColumns(ref table, accessToken, courseId, dbContext);

            // Get derived columns seperately from and after all the other columns have been retreived
            var tableManager = new CourseDataTableManager(dbContext, table.Students);

            table.CustomDataColumns.AddRange(tableManager.GetDerivedColumns(courseId, table));

            return(table);
        }
Пример #13
0
 public UserCustomDataController(ExtensibleDbContext dbCtx)
 {
     _dbCtx        = dbCtx;
     _config       = SystemConfig.LoadConfig();
     _tokenManager = new TokenManager(_dbCtx, _config);
 }