Exemple #1
0
 protected override void InitPageTemplate(HttpContext context)
 {
     Song.Entities.TestResults result = Business.Do <ITestPaper>().ResultsSingle(trid);
     if (result == null)
     {
         return;
     }
     this.Document.Variables.SetValue("result", result);
     //试卷
     Song.Entities.TestPaper tp = Business.Do <ITestPaper>().PagerSingle((int)result.Tp_Id);
     this.Document.Variables.SetValue("pager", tp);
     //考生
     Song.Entities.Accounts st = Business.Do <IAccounts>().AccountsSingle((int)result.Ac_ID);
     this.Document.Variables.SetValue("st", st);
     //加载答题信息
     resXml.LoadXml(result.Tr_Results, false);
     //获取试题项
     Song.Entities.TestPaperItem[] tpi = getTpi(tp);
     this.Document.Variables.SetValue("tpi", tpi);
     //计算得分
     this.Document.RegisterGlobalFunction(this.getTypeName);
     this.Document.RegisterGlobalFunction(this.getTypeNumber);
     this.Document.RegisterGlobalFunction(this.getAnswerCount);
     this.Document.RegisterGlobalFunction(this.getSucessCount);
     this.Document.RegisterGlobalFunction(this.getErrorCount);
     //展示答题状态
     this.Document.RegisterGlobalFunction(this.getQues);
     this.Document.RegisterGlobalFunction(this.getItems);
     //计算答题状态等
     this.Document.RegisterGlobalFunction(this.getAnswerState);
     //获取学员答题内容与正确答案
     this.Document.RegisterGlobalFunction(this.getResult);
     this.Document.RegisterGlobalFunction(this.getSucessAnswer);
     this.Document.RegisterGlobalFunction(this.getQuesScore);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         exr = Business.Do <ITestPaper>().ResultsSingle(trid);
         if (exr == null)
         {
             return;
         }
         st = Business.Do <IAccounts>().AccountsSingle(exr.Ac_ID);
         string resPath = Upload.Get["Student"].Virtual;
         st.Ac_Photo = resPath + st.Ac_Photo;
         //当前试卷
         pager = Business.Do <ITestPaper>().PagerSingle((int)exr.Tp_Id);
     }
 }
        void fill()
        {
            Song.Entities.TestPaper mm = Business.Do <ITestPaper>().PagerSingle(id);
            if (mm == null)
            {
                return;
            }
            //试卷名称
            lbPagerName.Text = mm.Tp_Name;
            //及格分,满分
            lbPassnum.Text = mm.Tp_PassScore.ToString();
            lbScore.Text   = mm.Tp_Total.ToString();
            //及格率
            double pass = Business.Do <ITestPaper>().ResultsPassrate(id);

            pass           = Math.Round(pass * 10000) / 100;
            lbPassPer.Text = pass.ToString();
            //参考人次
            lbPersontime.Text = Business.Do <ITestPaper>().ResultsPersontime(id).ToString();
            //平均分
            double avg = Business.Do <ITestPaper>().ResultsAverage(id);

            avg        = Math.Round(avg * 100) / 100;
            lbAvg.Text = avg.ToString();
            //最高分
            Song.Entities.TestResults trHighest = Business.Do <ITestPaper>().ResultsHighest(id);
            if (trHighest != null)
            {
                lbHeight.Text        = trHighest.Tr_Score.ToString();
                lbHeightStudent.Text = "(" + trHighest.Ac_Name + ")";
            }
            //最低分
            Song.Entities.TestResults trLowest = Business.Do <ITestPaper>().ResultsLowest(id);
            if (trLowest != null)
            {
                lbLower.Text        = trLowest.Tr_Score.ToString();
                lbLowerStudent.Text = "(" + trLowest.Ac_Name + ")";
            }
        }