Beispiel #1
0
 /// <summary>
 ///更新答案
 /// </summary>
 /// <param name="Tobj"></param>
 /// <param name="Zt">成绩表状态1,未交卷,2,已交卷</param>
 /// <returns></returns>
 public static int UpdateAnswer(TbObjectiveTopic Tobj, int Zt)
 {
     if (Tobj.Zt == 1)
     {
         return(Tcs.UpdateObjTiveAnswer(Tobj));
     }
     else
     {
         Ts.KgtID = int.Parse(getAnswerCard2(Tobj, Tobj.YhID).Rows[0]["KgtID"].ToString());
         Ts       = NowScore(Tobj);                                           // 重新获得当前分数
         Ts.Zt    = Zt;                                                       //更新成绩表状态
         int upt = TbScoreManager.UpdScore(Ts);                               //更新分数
         return(Tcs.UpdatResultAnswer(Tobj) + Tcs.UpdateObjTiveAnswer(Tobj)); //更新答案
     }
 }
Beispiel #2
0
 /// <summary>
 /// 保存答案到数据库
 /// </summary>
 /// <param name="Tobj">答题卡对象</param>
 /// <param name="CjZt">答题卡对象</param>
 /// <returns></returns>
 public static int inserAnswer(TbObjectiveTopic Tobj, int CjZt)
 {
     if (Tobj.Zt == 1)
     {
         return(Tcs.AddObjAnswer(Tobj));      //教师新增答案到数据库
     }
     else
     {
         Ts         = NowScore(Tobj); //获得当前分数
         Ts.KgtID   = Tcs.AddObjAnswer(Tobj);
         Tobj.KgtID = Ts.KgtID;
         Ts.Zt      = CjZt;
         Ts.CjID    = TbScoreManager.AddScore(Ts); //添加当前成绩
         int i = Tcs.AddResultAnswer(Tobj);        //添加当前答案 客观题/主观题
         return(Ts.KgtID);
     }
 }