Exemple #1
0
        private bool RemoveStudentFromAnalysis(RemoveAssignedStudentRQ model)
        {
            if (_analysisRepo.Get(model.TestId).Status >= TestStatus.InProgress)
            {
                return(false);
            }

            var assignment         = _analysisRepo.GetAssignment(model.StudentId, model.TestId);
            var outputTablesDbName = _adminConnectionConf.DbName;

            var dbDeleted              = _microsoftSQLService.DeleteDatabaseIfExists(assignment.InputNameOnServer);
            var studOutTableDeleted    = _microsoftSQLService.DeleteTableIfExists(assignment.StudentOutputNameOnServer, outputTablesDbName);
            var teacherOutTableDeleted = _microsoftSQLService.DeleteTableIfExists(assignment.TeacherOutputNameOnServer, outputTablesDbName);

            if (!dbDeleted || !studOutTableDeleted || !teacherOutTableDeleted)
            {
                return(false);
            }

            return(_studentRepo.RemoveAnalysis(model.StudentId, model.TimeStamp, model.TestId));
        }