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); } }
private void showLearning(int i,Learning learning) { switch(i) { case 0: this.tabControl0.SelectedIndex = 0; this.tabcontrol0LearnExciseName.Text = learning.ExciseName; this.tabcontrol0learnQuestionType.Text= learning.QuestionType ; this.tabcontrol0LearnImage.Text=learning.Question.Image ; this.tabcontrol0learnSound.Text=learning.Speech ; this.tabcontr0LearnKeyText.Text=learning.Question.SpeechText ; this.tabcontr0LearnKeyText.Text=learning.Question.Text ; this.tabcontrol0LearnPy.Text= learning.PinYing ; break; case 1: this.tabControl1.SelectedIndex = 0; this.tabcontrol1LearnExciseName.Text = learning.ExciseName; this.tabcontrol1learnQuestionType.Text= learning.QuestionType ; this.tabcontrol1LearnImage.Text=learning.Question.Image ; this.tabcontrol1learnSound.Text=learning.Speech ; this.tabcontrl1LearnKeyText.Text=learning.Question.SpeechText ; this.tabcontrl1LearnKeyText.Text=learning.Question.Text ; this.tabcontrol1LearnPy.Text= learning.PinYing ; break; case 2: this.tabControl2.SelectedIndex = 0; this.tabcontrol2LearnExciseName.Text = learning.ExciseName; this.tabcontrol2learnQuestionType.Text = learning.QuestionType; this.tabcontrol2LearnImage.Text = learning.Question.Image; this.tabcontrol2learnSound.Text = learning.Speech; this.tabcontrl2LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl2LearnKeyText.Text = learning.Question.Text; this.tabcontrol2LearnPy.Text = learning.PinYing; break; case 3: this.tabControl3.SelectedIndex = 0; this.tabcontrol3LearnExciseName.Text = learning.ExciseName; this.tabcontrol3learnQuestionType.Text = learning.QuestionType; this.tabcontrol3LearnImage.Text = learning.Question.Image; this.tabcontrol3learnSound.Text = learning.Speech; this.tabcontrl3LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl3LearnKeyText.Text = learning.Question.Text; this.tabcontrol3LearnPy.Text = learning.PinYing; break; case 4: this.tabControl4.SelectedIndex = 0; this.tabcontrol4LearnExciseName.Text = learning.ExciseName; this.tabcontrol4learnQuestionType.Text = learning.QuestionType; this.tabcontrol4LearnImage.Text = learning.Question.Image; this.tabcontrol4learnSound.Text = learning.Speech; this.tabcontrl4LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl4LearnKeyText.Text = learning.Question.Text; this.tabcontrol4LearnPy.Text = learning.PinYing; break; case 5: this.tabControl5.SelectedIndex = 0; this.tabcontrol5LearnExciseName.Text = learning.ExciseName; this.tabcontrol5learnQuestionType.Text = learning.QuestionType; this.tabcontrol5LearnImage.Text = learning.Question.Image; this.tabcontrol5learnSound.Text = learning.Speech; this.tabcontrl5LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl5LearnKeyText.Text = learning.Question.Text; this.tabcontrol5LearnPy.Text = learning.PinYing; break; case 6: this.tabControl6.SelectedIndex = 0; this.tabcontrol6LearnExciseName.Text = learning.ExciseName; this.tabcontrol6learnQuestionType.Text = learning.QuestionType; this.tabcontrol6LearnImage.Text = learning.Question.Image; this.tabcontrol6learnSound.Text = learning.Speech; this.tabcontrl6LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl6LearnKeyText.Text = learning.Question.Text; this.tabcontrol6LearnPy.Text = learning.PinYing; break; case 7: this.tabControl7.SelectedIndex = 0; this.tabcontrol7LearnExciseName.Text = learning.ExciseName; this.tabcontrol7learnQuestionType.Text = learning.QuestionType; this.tabcontrol7LearnImage.Text = learning.Question.Image; this.tabcontrol7learnSound.Text = learning.Speech; this.tabcontrl7LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl7LearnKeyText.Text = learning.Question.Text; this.tabcontrol7LearnPy.Text = learning.PinYing; break; case 8: this.tabControl8.SelectedIndex = 0; this.tabcontrol8LearnExciseName.Text = learning.ExciseName; this.tabcontrol8learnQuestionType.Text = learning.QuestionType; this.tabcontrol8LearnImage.Text = learning.Question.Image; this.tabcontrol8learnSound.Text = learning.Speech; this.tabcontrl8LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl8LearnKeyText.Text = learning.Question.Text; this.tabcontrol8LearnPy.Text = learning.PinYing; break; case 9: this.tabControl9.SelectedIndex = 0; this.tabcontrol9LearnExciseName.Text = learning.ExciseName; this.tabcontrol9learnQuestionType.Text = learning.QuestionType; this.tabcontrol9LearnImage.Text = learning.Question.Image; this.tabcontrol9learnSound.Text = learning.Speech; this.tabcontrl9LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl9LearnKeyText.Text = learning.Question.Text; this.tabcontrol9LearnPy.Text = learning.PinYing; break; case 10: this.tabControl10.SelectedIndex = 0; this.tabcontrol10LearnExciseName.Text = learning.ExciseName; this.tabcontrol10learnQuestionType.Text = learning.QuestionType; this.tabcontrol10LearnImage.Text = learning.Question.Image; this.tabcontrol10learnSound.Text = learning.Speech; this.tabcontrl10LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl10LearnKeyText.Text = learning.Question.Text; this.tabcontrol10LearnPy.Text = learning.PinYing; break; case 11: this.tabControl11.SelectedIndex = 0; this.tabcontrol11LearnExciseName.Text = learning.ExciseName; this.tabcontrol11learnQuestionType.Text = learning.QuestionType; this.tabcontrol11LearnImage.Text = learning.Question.Image; this.tabcontrol11learnSound.Text = learning.Speech; this.tabcontrl11LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl11LearnKeyText.Text = learning.Question.Text; this.tabcontrol11LearnPy.Text = learning.PinYing; break; case 12: this.tabControl12.SelectedIndex = 0; this.tabcontrol12LearnExciseName.Text = learning.ExciseName; this.tabcontrol12learnQuestionType.Text = learning.QuestionType; this.tabcontrol12LearnImage.Text = learning.Question.Image; this.tabcontrol12learnSound.Text = learning.Speech; this.tabcontrl12LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl12LearnKeyText.Text = learning.Question.Text; this.tabcontrol12LearnPy.Text = learning.PinYing; break; case 13: this.tabControl13.SelectedIndex = 0; this.tabcontrol13LearnExciseName.Text = learning.ExciseName; this.tabcontrol13learnQuestionType.Text = learning.QuestionType; this.tabcontrol13LearnImage.Text = learning.Question.Image; this.tabcontrol13learnSound.Text = learning.Speech; this.tabcontrl13LearnKeyText.Text = learning.Question.SpeechText; this.tabcontrl13LearnKeyText.Text = learning.Question.Text; this.tabcontrol13LearnPy.Text = learning.PinYing; break; } }