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); }
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); }
private void UpdateCourse(Course course) { if (!courses.ContainsKey(course.Id)) { return; } exerciseStudentZipsCache.DeleteCourseZips(course.Id); ExerciseCheckerZipsCache.DeleteCourseZips(course.Id); courses[course.Id] = course; }
private MemoryStream GetZipForChecker(string code) { var codeFile = GetCodeFile(code); return(ExerciseCheckerZipsCache.GetZip(this, codeFile.Path, codeFile.Data)); }
private byte[] GetZipBytesForChecker(string code) { var codeFile = GetCodeFile(code); return(ExerciseCheckerZipsCache.GetZip(this, codeFile.Path, codeFile.Data)); }