/// <summary> /// 我的课程讲师端学员端列表(加入考试成绩) /// </summary> /// <param name="totalCount"></param> /// <param name="CourseId"></param> /// <param name="TeacherId"></param> /// <param name="startIndex"></param> /// <param name="pageLength"></param> /// <returns></returns> public List <Cl_CourseOrder> GetTeacherOnLineTest(out int totalCount, int CourseId, int TeacherId, int startIndex = 0, int pageLength = int.MaxValue) { //return _courseOrderDB.GetTeacherOnLineTest(out totalCount, CourseId, TeacherId, startIndex, pageLength); var list = _courseOrderDB.GetTeacherOnLineTest(out totalCount, CourseId, TeacherId, startIndex, pageLength); for (int i = 0; i < list.Count; i++) { tbExamSendStudent exam = _ExamDB.GetExamSendStudentBySQL2005(list[i].CourseId.Value, list[i].UserId, list[i].CoPaperID, list[i].PaperId); var exampaper = _paperDB.GetExampaper(list[i].PaperId); list[i].LevelScoreStr = Convert.ToInt32(list[i].LevelScore * 0.01 * (exampaper == null ? 0 : exampaper.ExampaperScore)); if (exam != null) { list[i].tbExamstudentId = exam._id; list[i].DoExamStatus = exam.DoExamStatus; //list[i].GetexamScore = (exam.StudentAnswerList.Sum(pa => pa.GetScore) / exampaper.ExampaperScore) * 100; list[i].GetexamScore = exam.StudentAnswerList.Sum(pa => pa.GetScore); list[i].ExamTestTimes = exam.TestTimes; //记录考试次数,考了几次 } else { list[i].GetexamScore = 0; list[i].tbExamstudentId = 0; } } return(list); }