public bool Save(Exam exam) { try { password = exam.Password; SaverName = exam.Name; ExamFileService fileService = ExamFileService.GetInstance(); fileService.SaveExam(exam, filePath); openedExam = exam; return(true); } catch (Exception ex) { LastExceptionMessage = ex.Message; return(false); } }
public bool SaveResult(ExecutionResult executionResults) { Exam exam = GetExam(); if (exam is null) { return(false); } exam.ExecutionResults.Add(executionResults); try { password = exam.Password; SaverName = exam.Name; ExamFileService fileService = ExamFileService.GetInstance(); fileService.SaveExam(exam, filePath); return(true); } catch (Exception ex) { LastExceptionMessage = ex.Message; return(false); } }