Esempio n. 1
0
        private Question CreateMultipleChoiceQuestion(XElement questionIterator, Category parent)
        {
            MultipleChoiceQuestion multipleQuestion = new MultipleChoiceQuestion(parent);

            MultipleChoiceQuestion.CheckBoxItem multipleChoiceItem;
            foreach (XElement item in questionIterator.Elements("item"))
            {
                multipleChoiceItem = new MultipleChoiceQuestion.CheckBoxItem(multipleQuestion);
                if (item.Attribute("def") != null)
                {
                    multipleChoiceItem.IsChecked = item.Attribute("def").Value == "1";
                }
                multipleChoiceItem.IsMoreDetailsEnabled = item.Attribute("otr").Value == "1";
                multipleChoiceItem.Name = item.Value;
                multipleQuestion.CheckBoxItems.Add(multipleChoiceItem);
            }
            return(multipleQuestion);
        }
Esempio n. 2
0
 private Question CreateMultipleChoiceQuestion(XElement questionIterator, Category parent)
 {
     MultipleChoiceQuestion multipleQuestion = new MultipleChoiceQuestion(parent);
     MultipleChoiceQuestion.CheckBoxItem multipleChoiceItem;
     foreach (XElement item in questionIterator.Elements("item"))
     {
         multipleChoiceItem = new MultipleChoiceQuestion.CheckBoxItem(multipleQuestion);
         if (item.Attribute("def") != null)
         {
             multipleChoiceItem.IsChecked = item.Attribute("def").Value == "1";
         }
         multipleChoiceItem.IsMoreDetailsEnabled = item.Attribute("otr").Value == "1";
         multipleChoiceItem.Name = item.Value;
         multipleQuestion.CheckBoxItems.Add(multipleChoiceItem);
     }
     return multipleQuestion;
 }