Ejemplo n.º 1
0
        private void CreateTestDescription()
        {
            string path      = Application.StartupPath + "\\TestDescription.rtf";
            string rtfString = (new StreamReader(path)).ReadToEnd();

            string typeCaption = (testRow.IsPractice ? "Practice" : "Computer-Adaptive Test") +
                                 ((testRow.IsQuestionTypeIdNull())
                                      ? ("")
                                      :
                                  (": " +
                                   Question.Type.GetName(typeof(Question.Type), testRow.QuestionTypeId).ToString()));

            string caption = testRow.Name;

            iTestForm.ChangeCaption(caption);
            rtfString = rtfString.Replace("%Type%", typeCaption);
            rtfString = rtfString.Replace("%Description%", testRow.Description.ToString());
            rtfString = rtfString.Replace("%Caption%", caption);
            if (navigator.TotalTime != TimeSpan.MaxValue)
            {
                rtfString = rtfString.Replace("%Time%", String.Format("{0} min", navigator.TotalTime.TotalMinutes));
            }
            else
            {
                rtfString = rtfString.Replace("%Time%", "unlimited");
            }
            rtfString = rtfString.Replace("%NumberOfQuestions%", navigator.TotalNumberOfQuestions.ToString());
            descriptionRichTextBox.Rtf = rtfString;
        }
Ejemplo n.º 2
0
        public void PrepareTestDescription(IDescription form)
        {
            descriptionTestString = "";
            string caption = testRow.Name;

            descriptionTestString += "<< " + caption + " >>" + "<p>";
            string typeCaption = (testRow.IsPractice ? "Practice" : "Computer-Adaptive Test") +
                                 ((testRow.IsQuestionTypeIdNull())
                                      ? ("")
                                      :
                                  (": " +
                                   BuisinessObjects.Type.GetName(typeof(BuisinessObjects.Type), testRow.QuestionTypeId)));

            descriptionTestString += typeCaption + "<p>";
            if (navigator.TotalTime != TimeSpan.MaxValue)
            {
                descriptionTestString += "Time: " + String.Format("{0} min", navigator.TotalTime.TotalMinutes) + "<p>";
            }
            else
            {
                descriptionTestString += "Time: " + "unlimited" + "<p>";
            }
            descriptionTestString += "Number of questions: " + navigator.TotalNumberOfQuestions + "<p>";
            descriptionTestString += testRow.Description + "<p>";
            form.Caption("Description: " + testRow.Name);
            form.DescriptionString(descriptionTestString);
        }