/// <summary> /// Creates a copy of the question. /// </summary> /// <param name="parent">Instance of <see cref="Category"/> that question belongs to.</param> /// <returns>New instance of question.</returns> public Question Copy(Category parent) { MultipleChoiceQuestion question = new MultipleChoiceQuestion(parent) { Description = this.Description, Id = this.Id }; foreach (CheckBoxItem checkBoxItem in CheckBoxItems) { question.CheckBoxItems.Add(new CheckBoxItem(checkBoxItem, question)); } return(question); }
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); }
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; }
/// <summary> /// Creates a copy of the question. /// </summary> /// <param name="parent">Instance of <see cref="Category"/> that question belongs to.</param> /// <returns>New instance of question.</returns> public Question Copy(Category parent) { MultipleChoiceQuestion question = new MultipleChoiceQuestion(parent) { Description = this.Description, Id = this.Id }; foreach (CheckBoxItem checkBoxItem in CheckBoxItems) { question.CheckBoxItems.Add(new CheckBoxItem(checkBoxItem, question)); } return question; }