Example #1
0
        public static int GetMark(pBaseEntities GlobalEntities, KettellAnswers KettellAnswers, List <int> AnswersNums, EnumKettellType KType)
        {
            int        m = 0;
            testsparam t;

            if (KType == EnumKettellType.CForm)
            {
                t = GlobalEntities.testsparams.First(tp => tp.idt == (int)EnumPTests.KettellC);
            }
            else
            {
                t = GlobalEntities.testsparams.First(tp => tp.idt == (int)EnumPTests.KettellA);
            }
            t.answersparams.Load();
            for (int i = 0; i < AnswersNums.Count; i++)
            {
                answersparam a = t.answersparams.First(ap => ap.num == AnswersNums[i]);
                a.cellsparams.Load();
                if (KettellAnswers[(int)a.num - 1].SelectedCellDescription.Trim() != "")
                {
                    cellsparam c = a.cellsparams.First(cp => cp.description.Trim() == KettellAnswers[(int)a.num - 1].SelectedCellDescription.Trim());
                    m += c.mark.Value;
                }
            }
            return(m);
        }
Example #2
0
 public KettellATestLoader(pBaseEntities GlobalEntities, ThreeButtonsControl Control)
 {
     _ge      = GlobalEntities;
     _ktc     = Control;
     _answers = new KettellAnswers(_ge);
     arg      = new TestDoneEventArgs();
 }
Example #3
0
        public void ResultsToBase()
        {
            KettellAnswers Answers = tkf.ktl.Answers;

            XmlSerializer mySerializer = new XmlSerializer(typeof(KettellAnswers));

            StringWriter myWriter = new StringWriter();

            mySerializer.Serialize(myWriter, Answers);

            human h = _fe.humans.First(hh => hh.idh == _humanid);

            h.testresults.Load();
            testresult t = testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.KettellA, myWriter.ToString(), "auto");

            _fe.testresults.AddObject(t);
            _fe.SaveChanges();
            myWriter.Close();
        }
Example #4
0
        public testresult ResultsToBase(Answers Answers)
        {
            KettellAnswers _answersforbase = new KettellAnswers(_ge);

            for (int i = 0, count = Answers.Count; i < count; i++)
            {
                _answersforbase.Add(Answers[i].SelectedCellIndex(), Answers[i].ContentDescription, "", Answers[i].Id, "");
            }

            XmlSerializer mySerializer = new XmlSerializer(typeof(KettellAnswers));

            StringWriter myWriter = new StringWriter();

            mySerializer.Serialize(myWriter, _answersforbase);

            testresult t = testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.KettellA, myWriter.ToString(), "manual");

            _fe.testresults.AddObject(t);
            _fe.SaveChanges();

            myWriter.Close();
            return(t);
        }
Example #5
0
 public KettellScaleQ1(KettellAnswers KettellAnswers, pBaseEntities GlobalEntities, EnumKettellType KType)
 {
     _answers = KettellAnswers;
     _ge      = GlobalEntities;
     _ktype   = KType;
 }