public QuestionInfoForm(Client client, QuestionBase question) { InitializeComponent(); this.Question = question; this.client = client; FillQuestionBox(); FillClientAnswersBox(); this.Text = " Вопрос " + question.Name +" Ученика: " + client.Data.Name + " " + this.client.Data.LastName + " " + this.client.Data.Group ; }
public void AddQuestion(QuestionBase q) { if (this.test.Questions.Contains(q) == true) { return; } this.test.Questions.Add(q); this.test.Questions.OrderBy(t => t.Number); this.OnTestChange(this,new TestChangedEventArgs(this.test)); RaisePropertyChanged(() => this.Test); }
public void ShowQuestion(QuestionBase q) { try { ShowQuestionEvent(q); } catch (Exception e) { throw new Exception("", e); } }
public void AddQuestion(QuestionBase q, bool EnableReplace) { if (this._questions.Contains(q, new KeyEqualityComparer<QuestionBase>(k => k.ID)) == true) { if (EnableReplace == true) { this._questions[this._questions.IndexOf(this._questions.First(k => k.ID.Equals(q.ID)))] = q; } else { throw new ArgumentOutOfRangeException("такой вопрос уже есть"); } } else { this._questions.Add(q); } }
public static UserControl GetQuestionControl(QuestionBase q) { switch (q.Type) { case QuestionType.SingleChoice: { return new SQView((SingleChoiceQuestionViewModel)QuestionViewModelFactory.GetQuestionViewModelBase(q)); } case QuestionType.MultiChoice: { return new MQView((MultiChoiceQuestionViewModel)QuestionViewModelFactory.GetQuestionViewModelBase(q)); } case QuestionType.TextQuestion: { return new TQView((TextAnswerQuestionViewModel)QuestionViewModelFactory.GetQuestionViewModelBase(q)); } default: { return null; } } }
public QuestionListBoxItem(QuestionBase q) { this.name = q.Name; this.Type = q.GetTypeOfQuestion(); this.QuestionID = q.ID; }
public void RemoveQuestion(QuestionBase q) { RemoveQuestionEvent(q); }
/// <summary> /// задать показываемый вопрос /// </summary> /// <param name="q">вопрос</param> public void ShowQuestion(QuestionBase q) { this.ShowingQuestion = QuestionViewModelFactory.GetQuestionViewModelBase(q); this.OnUpdateQuestionsListHandler(this,new EventArgs()); }
public void RemoveFile(QuestionBase q) { this._questions.Remove(q); }
public void AddQuestion(QuestionBase q) { AddQuestion(q, false); }
public void RemoveQuestion(QuestionBase q) { RemoveQuestion(q.ID); }
public void ChangeQuestion(QuestionBase q) { ChangeQuestion(this.test.Questions.First(i => i.ID == q.ID), q); }
public void ChangeQuestion(QuestionBase _base, QuestionBase _new) { this.test.Questions[this.test.Questions.IndexOf(_base)] = _new; this.OnTestChange(this, new TestChangedEventArgs(this.test)); RaisePropertyChanged(() => this.Test); }
public QuestionListItemViewModel(QuestionBase q) { this._name = q.Name; this._type = q.GetTypeOfQuestion(); this._number = q.Number; }
public static string GetText(QuestionBase question) { if (question.Type == QuestionType.SingleChoice) { return getSQText((QSingleChoice) question); } if (question.Type == QuestionType.MultiChoice) { return getMQText((QMultiChoice)question); } if (question.Type == QuestionType.TextQuestion) { return getTQText((QTextChoice)question); } return ""; }
public static void ChangeQuestion(QuestionBase qNew) { }
public static void AddQuestion(QuestionBase q) { }
protected QuestionViewModelBase(QuestionBase questionModel) { if (questionModel == null) { throw new ArgumentNullException(); } this.questionModel = questionModel; }
public static QuestionViewModelBase GetQuestionViewModelBase(QuestionBase q) { switch (q.Type) { case QuestionType.SingleChoice: { return new SingleChoiceQuestionViewModel((QSingleChoice)q); } case QuestionType.MultiChoice: { return new MultiChoiceQuestionViewModel((QMultiChoice)q); } case QuestionType.TextQuestion: { return new TextAnswerQuestionViewModel((QTextChoice)q); } default: { return null; } } }