Esempio n. 1
0
 public MDTestLoader(pBaseEntities GlobalEntities, TwoButtonsControl Control)
 {
     _ge = GlobalEntities;
         _ktc = Control;
         _answers = new MDAnswers(_ge);
         arg = new TestDoneEventArgs();
 }
Esempio n. 2
0
 public MDTestLoader(pBaseEntities GlobalEntities, TwoButtonsControl Control)
 {
     _ge      = GlobalEntities;
     _ktc     = Control;
     _answers = new MDAnswers(_ge);
     arg      = new TestDoneEventArgs();
 }
Esempio n. 3
0
        public MDTestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe, bool WithResult)
        {
            _testresult = testresult;
            _human      = human;
            _ge         = ge;
            _fe         = fe;
            _withresult = WithResult;
            _listscales = new List <IScale>();
            int            ages     = (_testresult.testdate.Date - _human.birthday.Value.Date).Days / 365;
            MDAnswers      _answers = GetAnswersFromBase();
            MDScaleAnamnes _anamnes = new MDScaleAnamnes(_answers, _ge);
            MDScaleLie     _lie     = new MDScaleLie(_answers, _ge);
            MDScaleM1_1    _m1_1    = new MDScaleM1_1(_answers, _ge);
            MDScaleM1_2    _m1_2    = new MDScaleM1_2(_answers, _ge);
            MDScaleM1      _m1      = new MDScaleM1(_answers, _ge, _m1_1, _m1_2);

            MDScaleM2   _m2   = new MDScaleM2(_answers, _ge);
            MDScaleM2_1 _m2_1 = new MDScaleM2_1(_answers, _ge);
            MDScaleM2_2 _m2_2 = new MDScaleM2_2(_answers, _ge);
            MDScaleM2_3 _m2_3 = new MDScaleM2_3(_answers, _ge);

            MDScaleM3   _m3   = new MDScaleM3(_answers, _ge);
            MDScaleM3_1 _m3_1 = new MDScaleM3_1(_answers, _ge);
            MDScaleM3_2 _m3_2 = new MDScaleM3_2(_answers, _ge);
            MDScaleM3_3 _m3_3 = new MDScaleM3_3(_answers, _ge);
            MDScaleM3_4 _m3_4 = new MDScaleM3_4(_answers, _ge);
            MDScaleM3_5 _m3_5 = new MDScaleM3_5(_answers, _ge);
            MDScaleM3_6 _m3_6 = new MDScaleM3_6(_answers, _ge);

            MDScaleIntegral _integral = new MDScaleIntegral(_anamnes, _lie, _m1, _m2, _m3);

            _listscales.Add(_lie);
            _listscales.Add(_anamnes);
            _listscales.Add(_m1);
            if (_withresult == true)
            {
                _listscales.Add(_m1_1);
                _listscales.Add(_m1_2);
            }
            _listscales.Add(_m2);
            if (_withresult == true)
            {
                _listscales.Add(_m2_1);
                _listscales.Add(_m2_2);
                _listscales.Add(_m2_3);
            }
            _listscales.Add(_m3);
            if (_withresult == true)
            {
                _listscales.Add(_m3_1);
                _listscales.Add(_m3_2);
                _listscales.Add(_m3_3);
                _listscales.Add(_m3_4);
                _listscales.Add(_m3_5);
                _listscales.Add(_m3_6);
            }
            _listscales.Add(_integral);
        }
Esempio n. 4
0
        public void ResultsToBase()
        {
            MDAnswers Answers = tkf.ktl.Answers;

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

            StringWriter myWriter = new StringWriter();

            mySerializer.Serialize(myWriter, Answers);

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

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

            myWriter.Close();
        }
Esempio n. 5
0
        public static int GetMark(pBaseEntities GlobalEntities, MDAnswers mdAnswers, List<int> answers)
        {
            int m = 0;

            testsparam t = GlobalEntities.testsparams.First(tp => tp.idt == (int)EnumPTests.Modul2);
            t.answersparams.Load();

            for (int i = 0; i < answers.Count; i++)
            {
                answersparam a = t.answersparams.First(ap => ap.num == answers[i]);
                a.cellsparams.Load();
                if (mdAnswers[(int)a.num - 1].SelectedCellDescription.Trim() != "")
                {
                    cellsparam c = a.cellsparams.First(cp => cp.description.Trim() == mdAnswers[(int)a.num - 1].SelectedCellDescription.Trim());
                     m+=(int)c.mark;
                }
            }

            return m;
        }
Esempio n. 6
0
        public static int GetMark(pBaseEntities GlobalEntities, MDAnswers mdAnswers, List <int> answers)
        {
            int m = 0;

            testsparam t = GlobalEntities.testsparams.First(tp => tp.idt == (int)EnumPTests.Modul2);

            t.answersparams.Load();

            for (int i = 0; i < answers.Count; i++)
            {
                answersparam a = t.answersparams.First(ap => ap.num == answers[i]);
                a.cellsparams.Load();
                if (mdAnswers[(int)a.num - 1].SelectedCellDescription.Trim() != "")
                {
                    cellsparam c = a.cellsparams.First(cp => cp.description.Trim() == mdAnswers[(int)a.num - 1].SelectedCellDescription.Trim());
                    m += (int)c.mark;
                }
            }

            return(m);
        }
Esempio n. 7
0
        public testresult ResultsToBase(RecogCore.AnswerGrid.Answers Answers)
        {
            MDAnswers _answersforbase = new MDAnswers(_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(MDAnswers));

            StringWriter myWriter = new StringWriter();

            mySerializer.Serialize(myWriter, _answersforbase);

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

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

            myWriter.Close();
            return(t);
        }
Esempio n. 8
0
        void btn_recog_Click(object sender, EventArgs e)
        {
            switch ((EnumPTests)_testparam.idt)
            {
                case EnumPTests.Adaptability:
                    DAnswers da = new DAnswers();
                    AnswersFactory.UpdateTestFromAnswers<DAnswers>(da, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.Addictive:
                    AAnswers aa = new AAnswers();
                    AnswersFactory.UpdateTestFromAnswers<AAnswers>(aa, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.FPI:
                    FPIAnswers fa = new FPIAnswers();
                    AnswersFactory.UpdateTestFromAnswers<FPIAnswers>(fa, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.KettellA:
                    KettellAnswers kaa = new KettellAnswers();
                    AnswersFactory.UpdateTestFromAnswers<KettellAnswers>(kaa, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.KettellC:
                    KettellAnswers kca = new KettellAnswers();
                    AnswersFactory.UpdateTestFromAnswers<KettellAnswers>(kca, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.Leongard:
                    LAnswers la = new LAnswers();
                    AnswersFactory.UpdateTestFromAnswers<LAnswers>(la, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.Modul2:
                    MDAnswers ma = new MDAnswers();
                    AnswersFactory.UpdateTestFromAnswers<MDAnswers>(ma, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.NPNA:
                    NPNAnswers na = new NPNAnswers();
                    AnswersFactory.UpdateTestFromAnswers<NPNAnswers>(na, answers_grid, _testresult, _ge);
                    break;
                case EnumPTests.Prognoz:
                    PAnswers pa = new PAnswers();
                    AnswersFactory.UpdateTestFromAnswers<PAnswers>(pa, answers_grid, _testresult, _ge);
                    break;
            }

            this.Close();
        }
Esempio n. 9
0
        public testresult ResultsToBase(RecogCore.AnswerGrid.Answers Answers)
        {
            MDAnswers _answersforbase = new MDAnswers(_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(MDAnswers));

            StringWriter myWriter = new StringWriter();
            mySerializer.Serialize(myWriter, _answersforbase);

            testresult t = testresult.Createtestresult(0, _humanid, DateTime.Now, 6, myWriter.ToString(), "manual");
            _fe.testresults.AddObject(t);
            _fe.SaveChanges();

            myWriter.Close();
            return t;
        }