Ejemplo n.º 1
0
        private void addTabcontrol7(Trail trail)
        {
            Learning learning = new Learning();
            Judgment judgment = new Judgment();
            Match match = new Match();
            Choice choice = new Choice();
            Puzzle puzzle = new Puzzle();
            if (!this.tabcontrol7learnQuestionType.Text.Equals("不存在"))
            {
                learning.ExciseName = this.tabcontrol7LearnExciseName.Text;
                learning.QuestionType = this.tabcontrol7learnQuestionType.Text;
                learning.Question = new ImageItem();
                learning.Question.Image = this.tabcontrol7LearnImage.Text;
                learning.Speech = this.tabcontrol0learnSound.Text;
                learning.Question.SpeechText = this.tabcontr0LearnKeyText.Text;
                learning.Question.Text = this.tabcontr0LearnKeyText.Text;

                learning.PinYing = this.tabcontrol7LearnPy.Text;
                 trail.Questions.Add(learning);
                // MessageBox.Show(strSerializeJSON);

            }
            else if (!this.tabcontrol7JudgeQuestionType.Text.Equals("不存在"))
            {
                judgment.ExciseName = this.tabcontrol7JudgeExciseName.Text;
                judgment.Speech = this.tabcontrol7JudgeSound.Text;
                judgment.QuestionType = this.tabcontrol7JudgeQuestionType.Text;
                judgment.Question = new ImageItem();

                judgment.Question.Image = this.tabcontrol7JudgeRightImage.Text;

                judgment.Distractor = new ImageItem();
                judgment.Distractor.Image = this.tabcontrol7JudgeWrongImage.Text;

                 trail.Questions.Add(judgment);

                //  MessageBox.Show(judgeSerializeJSON);

            }
            else if (!this.tabcontrol7MatchQuestionType.Text.Equals("不存在"))
            {
                match.ExciseName = this.tabcontrol7MatchExciseName.Text;
                match.QuestionType = this.tabcontrol7MatchQuestionType.Text;
                match.Speech = this.tabcontrol7MatchSound.Text;
                match.Question = new ImageItem();
                match.Question.Image = this.tabcontrol7MatchQuestionImage.Text;
                match.Answer = new ImageItem();
                match.Answer.Image = this.tabcontrol7MatchAnswerImage.Text;
                match.Distractor = new ImageItem();
                match.Distractor.Image = this.tabcontrol7MatchDistraImage.Text;
                trail.Questions.Add(match);

                //   MessageBox.Show(matchSerializeJSON);

            }
            else if (!this.tabcontrol7ChoiceQuestionType.Text.Equals("不存在"))
            {
                choice.ExciseName = this.tabcontrol7ChoiceExciseName.Text;
                choice.QuestionType = this.tabcontrol7ChoiceQuestionType.Text;
                choice.Speech = this.tabcontrol7ChoiceSound.Text;
                choice.Answer = new ImageItem();
                choice.Answer.Image = this.tabcontrol7ChoiceRightImage.Text;
                choice.Answer.SpeechText = this.tabcontrol7ChoiceRightText.Text;
                choice.Distractor = new ImageItem();
                choice.Distractor.Image = this.tabcontrol7ChoiceDistraImage.Text;
                choice.Distractor.SpeechText = this.tabcontrol7ChoiceDistraText.Text;

               trail.Questions.Add(choice);

            }
            else if (!this.tabcontrol7PuzzleQuestionType.Text.Equals("不存在"))
            {
                puzzle.ExciseName = this.tabcontrol7PuzzleExciseName.Text;
                puzzle.Speech = this.tabcontrol7PuzzleSound.Text;
                puzzle.QuestionType = this.tabcontrol7PuzzleQuestionType.Text;
                puzzle.PuzzleImage = new ImageItem();
                puzzle.PuzzleImage.Image = this.tabcontrol7PuzzleRightImage.Text;
                puzzle.Distractor = new ImageItem();
                puzzle.Distractor.Image = this.tabcontrol7PuzzleDistraImage.Text;

                trail.Questions.Add(puzzle);

                // MessageBox.Show(puzzleSerializeJSON);

            }
        }
Ejemplo n.º 2
0
        private void showChoice(int i, Choice choice)
        {
            switch (i)
            {
                case 0:
                    this.tabControl0.SelectedIndex =3;
                    this.tabcontrol0ChoiceExciseName.Text= choice.ExciseName;
                    this.tabcontrol0ChoiceQuestionType.Text=choice.QuestionType  ;
                    this.tabcontrol0ChoiceSound.Text=choice.Speech ;
                    this.tabcontrol0ChoiceRightImage.Text=choice.Answer.Image ;
                    this.tabcontrol0ChoiceRightText.Text=choice.Answer.SpeechText ;
                    this.tabcontrol0ChoiceDistraImage.Text=choice.Distractor.Image;
                    this.tabcontrol0ChoiceDistraText.Text=choice.Distractor.SpeechText;

                    break;
                case 1:
                    this.tabControl1.SelectedIndex =3;
                    this.tabcontrol1ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol1ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol1ChoiceSound.Text = choice.Speech;
                    this.tabcontrol1ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol1ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol1ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol1ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 2:
                    this.tabControl2.SelectedIndex = 3;
                    this.tabcontrol2ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol2ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol2ChoiceSound.Text = choice.Speech;
                    this.tabcontrol2ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol2ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol2ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol2ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 3:
                    this.tabControl3.SelectedIndex = 3;
                    this.tabcontrol3ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol3ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol3ChoiceSound.Text = choice.Speech;
                    this.tabcontrol3ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol3ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol3ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol3ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 4:
                    this.tabControl4.SelectedIndex = 3;
                    this.tabcontrol4ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol4ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol4ChoiceSound.Text = choice.Speech;
                    this.tabcontrol4ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol4ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol4ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol4ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 5:
                    this.tabControl5.SelectedIndex = 3;
                    this.tabcontrol5ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol5ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol5ChoiceSound.Text = choice.Speech;
                    this.tabcontrol5ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol5ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol5ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol5ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 6:
                    this.tabControl6.SelectedIndex = 3;
                    this.tabcontrol6ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol6ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol6ChoiceSound.Text = choice.Speech;
                    this.tabcontrol6ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol6ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol6ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol6ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 7:
                    this.tabControl7.SelectedIndex = 3;
                    this.tabcontrol7ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol7ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol7ChoiceSound.Text = choice.Speech;
                    this.tabcontrol7ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol7ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol7ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol7ChoiceDistraText.Text = choice.Distractor.SpeechText;

                    break;
                case 8:
                    this.tabControl8.SelectedIndex = 3;
                    this.tabcontrol8ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol8ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol8ChoiceSound.Text = choice.Speech;
                    this.tabcontrol8ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol8ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol8ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol8ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 9:
                    this.tabControl9.SelectedIndex = 3;
                    this.tabcontrol9ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol9ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol9ChoiceSound.Text = choice.Speech;
                    this.tabcontrol9ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol9ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol9ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol9ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 10:
                    this.tabControl10.SelectedIndex = 3;
                    this.tabcontrol10ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol10ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol10ChoiceSound.Text = choice.Speech;
                    this.tabcontrol10ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol10ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol10ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol10ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 11:
                    this.tabControl11.SelectedIndex = 3;
                    this.tabcontrol11ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol11ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol11ChoiceSound.Text = choice.Speech;
                    this.tabcontrol11ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol11ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol11ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol11ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;
                case 12:
                    this.tabControl12.SelectedIndex = 3;
                    this.tabcontrol12ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol12ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol12ChoiceSound.Text = choice.Speech;
                    this.tabcontrol12ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol12ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol12ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol12ChoiceDistraText.Text = choice.Distractor.SpeechText;

                    break;
                case 13:
                    this.tabControl13.SelectedIndex = 3;
                    this.tabcontrol13ChoiceExciseName.Text = choice.ExciseName;
                    this.tabcontrol13ChoiceQuestionType.Text = choice.QuestionType;
                    this.tabcontrol13ChoiceSound.Text = choice.Speech;
                    this.tabcontrol13ChoiceRightImage.Text = choice.Answer.Image;
                    this.tabcontrol13ChoiceRightText.Text = choice.Answer.SpeechText;
                    this.tabcontrol13ChoiceDistraImage.Text = choice.Distractor.Image;
                    this.tabcontrol3ChoiceDistraText.Text = choice.Distractor.SpeechText;
                    break;

            }
        }