Пример #1
0
        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
        //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
        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
 //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
        //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);
                }
            }
        }