示例#1
0
        private Course ReloadCourseFromDirectory(DirectoryInfo directory)
        {
            var course = LoadCourseFromDirectory(directory);

            courses[course.Id] = course;
            log.Info($"Курс {course.Id} загружен из {directory.FullName} и сохранён в памяти");
            exerciseStudentZipsCache.DeleteCourseZips(course.Id);
            ExerciseCheckerZipsCache.DeleteCourseZips(course.Id);
            return(course);
        }
示例#2
0
        private Course ReloadCourseFromZip(FileInfo zipFile, Encoding encoding = null)
        {
            encoding = encoding == null ? Cp866 : Utf8;
            var course = LoadCourseFromZip(zipFile, encoding);

            courses[course.Id] = course;
            log.Info($"Курс {course.Id} загружен из {zipFile.FullName} и сохранён в памяти");
            exerciseStudentZipsCache.DeleteCourseZips(course.Id);
            ExerciseCheckerZipsCache.DeleteCourseZips(course.Id);
            return(course);
        }
示例#3
0
        private void UpdateCourse(Course course)
        {
            if (!courses.ContainsKey(course.Id))
            {
                return;
            }

            exerciseStudentZipsCache.DeleteCourseZips(course.Id);
            ExerciseCheckerZipsCache.DeleteCourseZips(course.Id);

            courses[course.Id] = course;
        }
示例#4
0
        private MemoryStream GetZipForChecker(string code)
        {
            var codeFile = GetCodeFile(code);

            return(ExerciseCheckerZipsCache.GetZip(this, codeFile.Path, codeFile.Data));
        }
示例#5
0
        private byte[] GetZipBytesForChecker(string code)
        {
            var codeFile = GetCodeFile(code);

            return(ExerciseCheckerZipsCache.GetZip(this, codeFile.Path, codeFile.Data));
        }