private void UserControl_Initialized(object sender, EventArgs e)
        {
            UIElement indexPart = CommonControlCreator.CreateUIPart(new QuestionTextPart(string.Format("{0}. ", this.index + 1)), this.Foreground);

            if (indexPart is Control)
            {
                ((Control)indexPart).VerticalAlignment = System.Windows.VerticalAlignment.Top;
            }
            this.questionBodyPanel.Children.Add(indexPart);
            StackPanel stackPanel = new StackPanel();

            stackPanel.Orientation = Orientation.Vertical;
            this.questionBodyPanel.Children.Add(stackPanel);
            CommonControlCreator.CreateContentControl(mcQuestion.Content, stackPanel, this.Foreground, null);

            List <int> optionIndexList = new List <int>();

            if (this.mcQuestion.RandomOption)
            {
                Random rand = new Random((int)DateTime.Now.Ticks);
                while (true)
                {
                    int  index = rand.Next(mcQuestion.QuestionOptionCollection.Count * 10) % mcQuestion.QuestionOptionCollection.Count;
                    bool found = false;
                    foreach (int temp in optionIndexList)
                    {
                        if (temp == index)
                        {
                            found = true;
                            break;
                        }
                    }

                    if (!found)
                    {
                        optionIndexList.Add(index);
                    }

                    if (optionIndexList.Count == mcQuestion.QuestionOptionCollection.Count)
                    {
                        break;
                    }

                    Thread.Sleep(10);
                }
            }
            else
            {
                for (int i = 0; i < mcQuestion.QuestionOptionCollection.Count; i++)
                {
                    optionIndexList.Add(i);
                }
            }

            for (int i = 0; i < mcQuestion.QuestionOptionCollection.Count; i++)
            {
                this.AppendOption(mcQuestion.QuestionOptionCollection[optionIndexList[i]], i);
            }
        }
        private void UserControl_Initialized(object sender, EventArgs e)
        {
            UIElement indexPart = CommonControlCreator.CreateUIPart(new QuestionTextPart(string.Format("{0}. ", this.index + 1)), this.Foreground);

            if (indexPart is Control)
            {
                ((Control)indexPart).VerticalAlignment = System.Windows.VerticalAlignment.Top;
            }

            this.questionBodyPanel.Children.Add(indexPart);
            StackPanel stackPanel = new StackPanel();

            stackPanel.Orientation = Orientation.Vertical;
            this.questionBodyPanel.Children.Add(stackPanel);
            CommonControlCreator.CreateContentControl(this.esQuestion.Content, stackPanel, this.Foreground, null);

            if (!string.IsNullOrEmpty(this.response.Answer.FlowDocument))
            {
                System.IO.MemoryStream ms = new System.IO.MemoryStream(Encoding.UTF8.GetBytes(this.response.Answer.FlowDocument));
                this.answerEditControl.Document = this.response.Answer.FlowDocument;
            }

            this.answerEditControl.TextChangedEvent += answerEditorControl_TextChanged;
        }