public TestForm() { string fileName; InitializeComponent(); string[] files = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.xml"); if (files.Length == 1) { fileName = files[0]; } else { SelectFileForm selectForm = new SelectFileForm(); CallBackMy.FillFileNameEventHendler(new List <string>(files)); selectForm.ShowDialog(); fileName = selectForm.SelectFile; } loader = new QuestionsLoader(); if (File.Exists(fileName)) { loader.LoadQuestions(fileName); CallBackMy.ShowQuestionEventHendler = ShowQuestion; CallBackMy.ShowTestResult = ShowResultTestDetail; CallBackMy.QuestionResultEnentHandler = QuestionResult; loader.StartTest(); } else { MessageBox.Show("Файл тестов не найден"); btAnswer.Enabled = false; } }
void Start() { score = 0; currentQuestion = 1; gotobjects = 0; if (gameObject.name != "exp-test_tube") { objectID = int.Parse(gameObject.tag); } hd = new HintsDisplay(); qs = new Questions(); ql = new QuestionsLoader(); scoreDisp = GameObject.Find("Scores"); hd.UpdateHints((qs.hints[(currentQuestion + startFrom) - 2])); test_tube_plane = GameObject.Find("exp-test_tube_plane"); leaf_experimented = GameObject.Find("exp-leaf_experimented"); chem_bottle = GameObject.Find("exp-chem_bottle"); leaf = GameObject.Find("exp-leaf"); leaf_plane = GameObject.Find("exp-leaf_plane"); arrows = GameObject.Find("Arrows"); wrongsound = Resources.Load("sound/wrong_answer") as AudioClip; if (arrows != false) { arrowEnabled = true; } else { arrowEnabled = false; } }
private void LoadQuestions(string path) { loader = new QuestionsLoader(); loader.SetTestNameHandler += loader_SetTestNameHandler; loader.SetQuestionLimitHandler += SetQuestionLimit; CallBackMy.AddFormCaptionEnentHandler = SetFormCaption; loader.LoadQuestions(path); Questions questions = loader.Questions; lbAnswers.DataSource = questions.QuestionsList; }
private void CreateQestions() { loader = new QuestionsLoader(); CallBackMy.AddFormCaptionEnentHandler = SetFormCaption; Questions questions = loader.Questions; tbCaption.Text = loader.Caption; tbQuestionLimit.Text = loader.QuestionLimit.ToString(); lbAnswers.DataSource = questions.QuestionsList; this.Text = "Finance pro [Администратор - Новый]"; }