public void CreateStudnetPaperDeatil() { var paperJson = JsonConvert.DeserializeObject <PaperJson>(this.PaperFormJson); foreach (var questionJson in paperJson.PaperQuestionJsons) { var paperDetail = new StudentPaperDetailEntity() { DeleteStatus = false, QuestionId = questionJson.PaperQuestion.QuestionId, QuestionJson = JsonConvert.SerializeObject(questionJson), QuestionType = questionJson.PaperQuestion.QuestionType, Score = questionJson.PaperQuestion._QuestionStrategyScore, Status = 10, StudentAnswerText = "", }; StudentPaperDetails.Add(paperDetail); } }
/// <summary> /// 创建答题记录 /// </summary> /// <param name="studentPaperId"></param> /// <param name="studentPaperDetail"></param> /// <returns></returns> public static StudentPaperDetailEntity CreateStudentPaperDetailFromDetail(Guid studentPaperId, StudentPaperDetailEntity studentPaperDetail) { return(new StudentPaperDetailEntity() { StudentPaperDetailId = Guid.NewGuid(), DeleteStatus = studentPaperDetail.DeleteStatus, QuestionId = studentPaperDetail.QuestionId, QuestionJson = studentPaperDetail.QuestionJson, QuestionType = studentPaperDetail.QuestionType, Score = studentPaperDetail.Score, Status = studentPaperDetail.Status, StudentPaperId = studentPaperId, CreatedDate = DateTime.Now }); }