Esempio n. 1
0
 public Answer(MediaData Data)
     : this()
 {
     if (Data == null)
     {
         Data = new MediaData();
     }
     this.Data = Data;
 }
Esempio n. 2
0
        public MultiChoiceBallAswer(MediaData data, int ball)
            : base(data)
        {
            if (ball < 0)
            {
                ball = 0;
            }

            this.ball = ball;
        }
Esempio n. 3
0
        public Answer(MediaData Data, bool IsTrue)
            : this()
        {
            if (Data == null)
            {
               Data = new MediaData();
            }
            this.Data = Data;

            this.IsTrue = IsTrue;
        }
 public DataElementsControl(MediaData data)
     : this(new DataElementsViewModel(data))
 {
 }
Esempio n. 5
0
        /// <summary>
        /// парсинг вопроса
        /// </summary>
        /// <param name="question">элемент XML с вопросом</param>
        /// <exception cref="ArgumentException">неправлиный тип вопроса</exception>
        public virtual void Parse(XElement question)
        {
            this.ID = Int32.Parse(question.Attribute("ID").Value);
            if (this.ID == null) {
                throw new ArgumentException("Uncorrect xml file"); }

            this.MaxMark = Int32.Parse(question.Attribute("MaxMark").Value);
            if (this.MaxMark == null || this.MaxMark <= 0) { this.MaxMark = 1; }

            this.MinMark = Int32.Parse(question.Attribute("MinMark").Value);
            if (this.MinMark == null || this.MaxMark < 0 || this.MinMark >= this.MaxMark) { this.MinMark = 0; }

            try
            {
                this.Type = Question.GetTypeOfQuestion(question);
            }
            catch
            {
                throw new ArgumentException("Uncorrect xml file");
            }

            XElement Mdata = question.Element("MediaData");
            if (Mdata != null)
            {
                this.Data = new MediaData();
                this.Data.Parse(Mdata);
            }

            switch (this.Type)
            {
                case QuestionType.SingleChoice:
                    {
                        foreach (XElement answer in question.Element("Answers").Elements())
                        {
                            Answer ans = new Answer();
                            ans.Parse(answer);
                            this.Answers.Add(ans);
                        }
                        break;
                    }
                case QuestionType.MultiChoice:
                    {
                        break;
                    }
            }

            foreach (XElement RigthAns in question.Element("RightAnswers").Elements())
            {
                RightAnswer ans = RightAnswer.Parse(RigthAns);
                this.RightAnswers.Add(ans);
            }
        }
Esempio n. 6
0
 public MultiChoiceBallAswer(MediaData data, bool istrue)
     : base(data, istrue)
 {
 }
Esempio n. 7
0
 public MultiChoiceBallAswer(MediaData data)
     : base(data)
 {
 }
Esempio n. 8
0
        public DataElementsViewModel(MediaData data)
        {
            this.DataModel = data;
           // SetLongTextFile();

            this.DataModel.Files.CollectionChanged += (sender, args) => 
                OnUpdateImagesListHandler(this,new EventArgs());
        }