public TestEditViewModel(Tests test) { _currentTest = test; _currentQuestion = new QuestionModel(); _testQuestions = new ObservableCollection<QuestionModel>(); }
private void InitQuestions(List<Question> questions) { foreach (var questionItem in questions) { QuestionModel questionModel = new QuestionModel(); questionModel.QuestionText = questionItem.QuestionText; foreach (var variantItem in questionItem.Variants) { var variant = new VariantModel(); if(variantItem.Type == "Image") { FileTransferClient fileTransfer = new FileTransferClient(); TransferedImage img = fileTransfer.DownloadImage(variantItem.ImageUri); var path = SaveImage(img.data, img.Filename); variant.ImageUri = path; variant.Type = variantItem.Type; } else { variant.VariantText = variantItem.VariantText; } questionModel.Variants.Add(variant); } _questions.Add(questionModel); } }
public ImageQuestionBuilder(QuestionModel questionModel) { //TODO }
private void SaveQuestion() { TestQuestions.Add(CurrentQuestion); CurrentQuestion = new QuestionModel(); }
private void LoadQuestion(int idx) { CurrentQuestion = _questions[idx]; }
public TextQuestionBuilder(QuestionModel questionModel) { _questionModel = questionModel; }