Example #1
0
        public static void UpdateTest(string fileName, HtmlStore[] store)
        {
            TestHelper helper = TestHelpers.Where(c => c.FullFileName == fileName).First();
            FileInfo   fi     = new FileInfo(fileName);

            helper.ConvTime = fi.LastWriteTime;
            helper.TestorData.CoreBLOBs.Clear();
            int qCount = helper.TestorData.CoreQuestions.Count();

            double[] marks = new double[helper.TestorData.CoreQuestions.Count()];
            for (int i = 0; i < qCount; i++)
            {
                marks[i] = helper.TestorData.CoreQuestions[i].QuestionMark;
            }
            helper.TestorData.CoreAnswers.Clear();
            helper.TestorData.CoreQuestions.Clear();
            HtmlStore.AddToDataset(helper.TestorData, helper.TestorData.CoreTests[0], store);
            helper.QuestCount = helper.TestorData.CoreQuestions.Count();
            for (int i = 0; i < helper.TestorData.CoreQuestions.Count(); i++)
            {
                if (i >= qCount)
                {
                    break;
                }
                helper.TestorData.CoreQuestions[i].QuestionMark = (short)marks[i];
            }
            HasChanges = true;
            OnTestHelpersChanged();
        }