示例#1
0
文件: ExamineeS1.cs 项目: nauhtnn/sQz
        public void MergeC(ExamineeA e)
        {
            if (mPhase == ExamineePhase.Finished)
            {
                return;
            }
            bLog = e.bLog;
            if (mPhase < ExamineePhase.Examing || bLog)
            {
                tComp = e.tComp;
            }
            if (e.mPhase < ExamineePhase.Examing)
            {
                mPhase = ExamineePhase.Examing;
            }
            else
            {
                mPhase = e.mPhase;
            }
            if (mPhase < ExamineePhase.Examing)
            {
                return;
            }
            mAnsSheet         = new AnsSheet();
            mAnsSheet.uQSLvId = e.mAnsSheet.uQSLvId;

            if (mPhase < ExamineePhase.Submitting)
            {
                return;
            }
            mAnsSheet.aAns = e.mAnsSheet.aAns;
        }
示例#2
0
文件: AnsPack.cs 项目: nauhtnn/sQz
        //only Operation1 uses this.
        public bool ReadByte(byte[] buf, ref int offs)
        {
            Sheets.Clear();
            if (buf == null)
            {
                return(true);
            }
            int l = buf.Length - offs;

            if (l < 4)
            {
                return(true);
            }
            int nSh = BitConverter.ToInt32(buf, offs);

            offs += 4;
            l    -= 4;
            if (nSh < 0)
            {
                return(true);
            }
            while (0 < nSh)
            {
                AnsSheet i = new AnsSheet();
                if (i.ReadByte(buf, ref offs) || Sheets.ContainsKey(i.uQSLvId))
                {
                    return(true);
                }
                Sheets.Add(i.uQSLvId, i);
                --nSh;
            }
            return(false);
        }
示例#3
0
文件: AnsPack.cs 项目: nauhtnn/sQz
        public AnsSheet ExtractKey(QuestSheet qs)
        {
            AnsSheet i = new AnsSheet();

            qs.ExtractKey(i);
            if (!Sheets.ContainsKey(i.uQSLvId))
            {
                Sheets.Add(i.uQSLvId, i);
                return(i);
            }
            return(null);
        }
示例#4
0
 void Reset()
 {
     mDt         = DT.INV_H;
     Lv          = Level.A;
     uId         = (int)Level.MAX_COUNT_EACH_LEVEL;
     tName       = null;
     tBirdate    = null;
     tBirthplace = null;
     mPhase      = ExamineePhase.Signing;
     uGrade      = (int)Level.MAX_COUNT_EACH_LEVEL;
     dtTim1      = dtTim2 = DT.INV_;
     tComp       = string.Empty;
     mAnsSheet   = new AnsSheet();
     kDtDuration = new TimeSpan(0, 30, 0);
     tLog        = new StringBuilder();
 }
示例#5
0
文件: AnsPack.cs 项目: nauhtnn/sQz
 //only Operation0 uses this.
 public void ExtractKey(List <QuestSheet> l)
 {
     foreach (QuestSheet qs in l)
     {
         AnsSheet i = new AnsSheet();
         qs.ExtractKey(i);
         if (!Sheets.ContainsKey(i.uQSLvId))
         {
             Sheets.Add(i.uQSLvId, i);
         }
         else
         {
             Sheets[i.uQSLvId] = i;
         }
     }
 }
示例#6
0
文件: QuestSheet.cs 项目: nauhtnn/sQz
        //public void DBAppendQryIns(string prefx, StringBuilder vals)
        //{
        //    int idx = -1;
        //    foreach (MultiChoiceItem q in items)
        //    {
        //        vals.Append(prefx + "'" + eLv.ToString() + "'," +
        //            uId + "," + q.uId + ",'");
        //        foreach (int i in q.POptions)
        //            vals.Append(i.ToString());
        //        vals.Append("'," + ++idx + "),");
        //    }
        //}

        //only Operation0 uses this.
        public void ExtractKey(AnsSheet anssh)
        {
            anssh.uQSLvId = LvId;
            if (0 < Questions.Count)
            {
                anssh.aAns = new byte[Questions.Count * MultiChoiceItem.N_OPTIONS];
            }
            else
            {
                return;
            }
            int i = -1;

            foreach (MultiChoiceItem q in Questions)
            {
                foreach (bool x in q.Keys)
                {
                    anssh.aAns[++i] = Convert.ToByte(x);
                }
            }
        }