• 笔试考试系统 ____错题查看


    1.今日任务

    学生错题查看以及成绩统计

    错题查看

     控制器代码:错题查看

     1 public ActionResult MyError()
     2         {
     3             var currentuser = Session[CommonFeild.SessionName] as Exam_User;                                   
     4             //获取答题信息 
     5             List<Exam_Answer> list = AnswerService.GetError(currentuser.UserID);
     6             //加载试卷模型
     7             List<ExamPaperBLL> paperbll = new List<ExamPaperBLL>();
     8             foreach (var item in list)
     9             {
    10                 ExamPaperBLL examPaperBLL = new ExamPaperBLL();
    11                 examPaperBLL.Exam_Question = QuestionService.GetdataByID(item.QuestionID);
    12                 examPaperBLL.AnswerOptionID = item.AnswerOptionID;
    13                 paperbll.Add(examPaperBLL);
    14 
    15             }
    16             return View(paperbll);
    17         }

    service层方法

     1    /// <summary>
     2         /// 获取用户错题
     3         /// </summary>
     4         /// <param name="userid"></param>
     5         /// <returns></returns>
     6         public static List<Exam_Answer> GetError(int userid)
     7         {
     8             using (ExamSysDBContext db = new ExamSysDBContext())
     9             {
    10                 var data = db.Exam_Answer.Where(x => x.UserID == userid && x.AnswerOptionID != "" && x.AnswerOptionID != x.OptionID).ToList();
    11                 return data;
    12             }
    13         }

    3.遇到问题

    4.解决方案

  • 相关阅读:
    [APIO 2009] Atm
    Codeforces518 D. Ilya and Escalator
    [POJ2096] Collecting bugs
    [ZOJ3329] One Person Game
    [LightOJ1038] Race to 1 Again
    「NOI2003」逃学的小孩
    [HAOI2006] 旅行
    ☆ [POJ2411] Mondriaan's Dream 「状压DP」
    「POJ3311」Hie with the Pie
    「乘法逆元」 学习笔记
  • 原文地址:https://www.cnblogs.com/zhangdongwei/p/13426866.html
Copyright © 2020-2023  润新知