public static int GetMark(pBaseEntities GlobalEntities, DAnswers FPIAnswers, List<int> AnswersYes, List<int> AnswersNo) { int m = 0; testsparam t = GlobalEntities.testsparams.First(tp => tp.idt == (int)EnumPTests.Adaptability); t.answersparams.Load(); for (int i = 0; i < AnswersYes.Count; i++) { answersparam a = t.answersparams.First(ap => ap.num == AnswersYes[i]); a.cellsparams.Load(); if (FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim() != "") { cellsparam c = a.cellsparams.First(cp => cp.description.Trim() == FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim()); if (c.mark == 1) { m++; } } } for (int i = 0; i < AnswersNo.Count; i++) { answersparam a = t.answersparams.First(ap => ap.num == AnswersNo[i]); a.cellsparams.Load(); if (FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim() != "") { cellsparam c = a.cellsparams.First(cp => cp.description.Trim() == FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim()); if (c.mark == 0) { m++; } } } return m; }
public DTestLoader(pBaseEntities GlobalEntities, TwoButtonsControl Control) { _ge = GlobalEntities; _ktc = Control; _answers = new DAnswers(_ge); arg = new TestDoneEventArgs(); }
public DTestLoader(pBaseEntities GlobalEntities, TwoButtonsControl Control) { _ge = GlobalEntities; _ktc = Control; _answers = new DAnswers(_ge); arg = new TestDoneEventArgs(); }
public void ResultsToBase() { DAnswers Answers = tkf.ktl.Answers; XmlSerializer mySerializer = new XmlSerializer(typeof(DAnswers)); StringWriter myWriter = new StringWriter(); mySerializer.Serialize(myWriter, Answers); testresult t = testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Adaptability, myWriter.ToString(), "auto"); _fe.testresults.AddObject(t); _fe.SaveChanges(); myWriter.Close(); }
public static int GetMark(pBaseEntities GlobalEntities, DAnswers FPIAnswers, List <int> AnswersYes, List <int> AnswersNo) { int m = 0; testsparam t = GlobalEntities.testsparams.First(tp => tp.idt == (int)EnumPTests.Adaptability); t.answersparams.Load(); for (int i = 0; i < AnswersYes.Count; i++) { answersparam a = t.answersparams.First(ap => ap.num == AnswersYes[i]); a.cellsparams.Load(); if (FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim() != "") { cellsparam c = a.cellsparams.First(cp => cp.description.Trim() == FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim()); if (c.mark == 1) { m++; } } } for (int i = 0; i < AnswersNo.Count; i++) { answersparam a = t.answersparams.First(ap => ap.num == AnswersNo[i]); a.cellsparams.Load(); if (FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim() != "") { cellsparam c = a.cellsparams.First(cp => cp.description.Trim() == FPIAnswers[(int)a.num - 1].SelectedCellDescription.Trim()); if (c.mark == 0) { m++; } } } return(m); }
public testresult ResultsToBase(RecogCore.AnswerGrid.Answers Answers) { DAnswers _answersforbase = new DAnswers(_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(DAnswers)); StringWriter myWriter = new StringWriter(); mySerializer.Serialize(myWriter, _answersforbase); testresult t = testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Adaptability, myWriter.ToString(), "manual"); _fe.testresults.AddObject(t); _fe.SaveChanges(); myWriter.Close(); return(t); }
public DScalePC(DAnswers DAnswers, pBaseEntities GlobalEntities) { _answers = DAnswers; _ge = GlobalEntities; }
public DScaleSC(DAnswers DAnswers, pBaseEntities GlobalEntities,DScaleK K) { _answers = DAnswers; _ge = GlobalEntities; _k = K; }
public testresult ResultsToBase(RecogCore.AnswerGrid.Answers Answers) { DAnswers _answersforbase = new DAnswers(_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(DAnswers)); StringWriter myWriter = new StringWriter(); mySerializer.Serialize(myWriter, _answersforbase); testresult t = testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Adaptability, myWriter.ToString(), "manual"); _fe.testresults.AddObject(t); _fe.SaveChanges(); myWriter.Close(); return t; }
public DScalePT(DAnswers DAnswers, pBaseEntities GlobalEntities, DScaleK K) { _answers = DAnswers; _ge = GlobalEntities; _k = K; }
public DScaleMF(DAnswers DAnswers, pBaseEntities GlobalEntities) { _answers = DAnswers; _ge = GlobalEntities; }
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(); }
private void Loading() { _tp = _ge.testsparams.First(t => t.idt == _testid); switch (_testid) { case (int)EnumPTests.KettellC://TODO:это все поместить в фабрику отчетов с функцие добавления пустых ответов //create fool kettellanswers KettellAnswers ka = new KettellAnswers(); for (int a = 0; a < 104; a++) { ka.Add(0, "", "", a, ""); } XmlSerializer mySerializer = new XmlSerializer(typeof(KettellAnswers)); StringWriter myWriter = new StringWriter(); mySerializer.Serialize(myWriter, ka); _human=_fe.humans.First(h => h.idh == _humanid); KettellCTestReport kcr = new KettellCTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.KettellC, myWriter.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kcr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kcr.ListScales[i]; } break; case (int)EnumPTests.PNN: PNNAnswers pa = new PNNAnswers(); for (int a = 0; a < 104; a++) { pa.Add(PnnSignalType.Green,PnnKeyType.AnyKey,DateTime.Now,0); } XmlSerializer mySerializerp = new XmlSerializer(typeof(PNNAnswers)); StringWriter myWriterp = new StringWriter(); mySerializerp.Serialize(myWriterp, pa); _human=_fe.humans.First(h => h.idh == _humanid); PNNTestReport pnr = new PNNTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.PNN, myWriterp.ToString(), "manual"), _ge, _fe); for (int i = 0; i < pnr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = pnr.ListScales[i]; } break; case (int)EnumPTests.Adaptability: DAnswers kd = new DAnswers(); for (int a = 0; a < 165; a++) { kd.Add(0, "", "", a, ""); } XmlSerializer mySerializerd = new XmlSerializer(typeof(DAnswers)); StringWriter myWriterd = new StringWriter(); mySerializerd.Serialize(myWriterd, kd); _human=_fe.humans.First(h => h.idh == _humanid); DTestReport kdr = new DTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Adaptability, myWriterd.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kdr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kdr.ListScales[i]; } break; case (int)EnumPTests.FPI: FPIAnswers kfpi= new FPIAnswers(); for (int a = 0; a < 114; a++) { kfpi.Add(0, "", "", a, ""); } XmlSerializer mySerializerfpi = new XmlSerializer(typeof(FPIAnswers)); StringWriter myWriterfpi = new StringWriter(); mySerializerfpi.Serialize(myWriterfpi, kfpi); _human=_fe.humans.First(h => h.idh == _humanid); FPITestReport kfr = new FPITestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.FPI, myWriterfpi.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kfr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kfr.ListScales[i]; } break; case (int)EnumPTests.KettellA: KettellAnswers kaa = new KettellAnswers(); for (int a = 0; a < 185; a++) { kaa.Add(0, "", "", a, ""); } XmlSerializer mySerializera = new XmlSerializer(typeof(KettellAnswers)); StringWriter myWritera = new StringWriter(); mySerializera.Serialize(myWritera, kaa); _human=_fe.humans.First(h => h.idh == _humanid); KettellATestReport kar = new KettellATestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.KettellA, myWritera.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kar.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kar.ListScales[i]; } break; case (int)EnumPTests.Contrasts: ContrastsAnswers mkd = new ContrastsAnswers(); for (int a = 0; a < 6; a++) { mkd.Add(DateTime.Now, 0); } XmlSerializer mySerializermd = new XmlSerializer(typeof(ContrastsAnswers)); StringWriter myWritermd = new StringWriter(); mySerializermd.Serialize(myWritermd, mkd); _human = _fe.humans.First(h => h.idh == _humanid); ContrastsTestReport mkdr = new ContrastsTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Contrasts, myWritermd.ToString(), "manual"), _ge, _fe); for (int i = 0; i < mkdr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = mkdr.ListScales[i]; } break; case (int)EnumPTests.Prognoz: PAnswers paa = new PAnswers(); for (int a = 0; a < 86; a++) { paa.Add(0, "", "", a, ""); } XmlSerializer mySerializerpr = new XmlSerializer(typeof(PAnswers)); StringWriter myWriterpr = new StringWriter(); mySerializerpr.Serialize(myWriterpr, paa); _human = _fe.humans.First(h => h.idh == _humanid); PTestReport par = new PTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Prognoz, myWriterpr.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < par.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = par.ListScales[i]; } break; case (int)EnumPTests.Addictive: AAnswers aaa = new AAnswers(); for (int a = 0; a < 30; a++) { aaa.Add(0, "", "", a, ""); } XmlSerializer mySerializeraa = new XmlSerializer(typeof(AAnswers)); StringWriter myWriteraa = new StringWriter(); mySerializeraa.Serialize(myWriteraa, aaa); _human = _fe.humans.First(h => h.idh == _humanid); ATestReport aar = new ATestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Addictive, myWriteraa.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < aar.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = aar.ListScales[i]; } break; case (int)EnumPTests.NPNA: NPNAnswers npn = new NPNAnswers(); for (int a = 0; a < 276; a++) { npn.Add(0, "", "", a, ""); } XmlSerializer mySerializernpn = new XmlSerializer(typeof(NPNAnswers)); StringWriter myWriternpn = new StringWriter(); mySerializernpn.Serialize(myWriternpn, npn); _human = _fe.humans.First(h => h.idh == _humanid); NPNTestReport npnr = new NPNTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.NPNA, myWriternpn.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < npnr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = npnr.ListScales[i]; } break; case (int)EnumPTests.Leongard: LAnswers lpn = new LAnswers(); for (int a = 0; a < 88; a++) { lpn.Add(0, "", "", a, ""); } XmlSerializer mySerializerlpn = new XmlSerializer(typeof(LAnswers)); StringWriter myWriterlpn = new StringWriter(); mySerializerlpn.Serialize(myWriterlpn, lpn); _human = _fe.humans.First(h => h.idh == _humanid); LTestReport lpnr = new LTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Leongard, myWriterlpn.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < lpnr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale =lpnr.ListScales[i]; } break; } }