Пример #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);

            }
        }
Пример #2
0
        private void showPuzzle(int i, Puzzle puzzle)
        {
            switch (i)
            {
                case 0:
                    this.tabControl0.SelectedIndex = 4;
                    this.tabcontrol0PuzzleExciseName.Text= puzzle.ExciseName ;
                    this.tabcontrol0PuzzleSound.Text=puzzle.Speech ;
                    this.tabcontrol0PuzzleQuestionType.Text =puzzle.QuestionType ;
                    this.tabcontrol0PuzzleRightImage.Text=puzzle.PuzzleImage.Image ;
                    this.tabcontrol0PuzzleDistraImage.Text= puzzle.Distractor.Image  ;
                    break;
                case 1:
                    this.tabControl1.SelectedIndex = 4;
                    this.tabcontrol1PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol1PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol1PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol1PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol1PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 2:
                    this.tabControl2.SelectedIndex = 4;
                    this.tabcontrol2PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol2PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol2PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol2PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol2PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 3:
                    this.tabControl3.SelectedIndex = 4;
                    this.tabcontrol3PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol3PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol3PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol3PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol3PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 4:
                    this.tabControl4.SelectedIndex = 4;
                    this.tabcontrol4PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol4PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol4PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol4PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol4PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 5:
                    this.tabControl5.SelectedIndex = 4;
                    this.tabcontrol5PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol5PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol5PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol5PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol5PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 6:
                    this.tabControl6.SelectedIndex = 4;
                    this.tabcontrol6PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol6PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol6PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol6PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol6PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 7:
                    this.tabControl7.SelectedIndex = 4;
                    this.tabcontrol7PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol7PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol7PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol7PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol7PuzzleDistraImage.Text = puzzle.Distractor.Image;

                    break;
                case 8:
                    this.tabControl8.SelectedIndex = 4;
                    this.tabcontrol8PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol8PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol8PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol8PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol8PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 9:
                    this.tabControl9.SelectedIndex = 4;
                    this.tabcontrol9PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol9PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol9PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol9PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol9PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 10:
                    this.tabControl10.SelectedIndex = 4;
                    this.tabcontrol10PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol10PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol10PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol10PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol10PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 11:
                    this.tabControl11.SelectedIndex = 4;
                    this.tabcontrol11PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol11PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol11PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol11PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol11PuzzleDistraImage.Text = puzzle.Distractor.Image;
                    break;
                case 12:
                    this.tabControl12.SelectedIndex = 4;
                    this.tabcontrol12PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol12PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol12PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol12PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol12PuzzleDistraImage.Text = puzzle.Distractor.Image;

                    break;
                case 13:
                    this.tabControl13.SelectedIndex = 4;
                    this.tabcontrol13PuzzleExciseName.Text = puzzle.ExciseName;
                    this.tabcontrol13PuzzleSound.Text = puzzle.Speech;
                    this.tabcontrol13PuzzleQuestionType.Text = puzzle.QuestionType;
                    this.tabcontrol13PuzzleRightImage.Text = puzzle.PuzzleImage.Image;
                    this.tabcontrol13PuzzleDistraImage.Text = puzzle.Distractor.Image;

                    break;

            }
        }