private void button_Click() { MessageBox.Show("Start Test!!"); System.Diagnostics.Debug.WriteLine("触发了"); Slide activeSlide = Globals.ThisAddIn.Application.ActivePresentation.SlideShowWindow.View.Slide; Question question = new Question(); question.questionType = int.Parse(activeSlide.Shapes["questionType"].TextFrame.TextRange.Text); question.questionScore = int.Parse(activeSlide.Shapes["questionScore"].TextFrame.TextRange.Text); question.questionLimitTime = int.Parse(activeSlide.Shapes["questionLimitTime"].TextFrame.TextRange.Text); question.questionDescribe = activeSlide.Shapes["questionDescribe"].TextFrame.TextRange.Text; question.questionAnswer = activeSlide.Shapes["questionAnswer"].TextFrame.TextRange.Text; System.Diagnostics.Debug.WriteLine("触发了!!"); List <Option> optionList = new List <Option>(); Option option = new Option(); option.optionType = activeSlide.Shapes["questionAnswer"].TextFrame.TextRange.Text; option.optionDescribe = activeSlide.Shapes["questionDescribe"].TextFrame.TextRange.Text; optionList.Add(option); QuestionData questionData = new QuestionData(); questionData.question = question; questionData.optionList = optionList; System.Diagnostics.Debug.WriteLine("触发了!!!~~"); SubmitQuestionForm submitQuestionForm = new SubmitQuestionForm(); submitQuestionForm.questionData = questionData; //submitQuestionForm.LoadText1(activeSlide.Shapes["questionScore"].TextFrame.TextRange.Text, activeSlide.Shapes["questionLimitTime"].TextFrame.TextRange.Text); submitQuestionForm.LoadText(); submitQuestionForm.ShowDialog(); }
/// <summary> /// 单选题提交按钮事件 /// </summary> private void sumbitChocie_Click() { if (buttonClickCount == 0) { return; } buttonClickCount = 0; Slide activeSlide = Globals.ThisAddIn.Application.ActivePresentation.SlideShowWindow.View.Slide; MF.CommandButton button = (MF.CommandButton)activeSlide.Shapes["sumbitButton"].OLEFormat.Object; button.Enabled = false; Question question = new Question(); question.questionType = int.Parse(activeSlide.Shapes["questionType"].TextFrame.TextRange.Text); question.questionScore = int.Parse(activeSlide.Shapes["questionScore"].TextFrame.TextRange.Text); question.questionLimitTime = int.Parse(activeSlide.Shapes["questionLimitTime"].TextFrame.TextRange.Text); question.questionDescribe = activeSlide.Shapes["questionDescribe"].TextFrame.TextRange.Text; question.questionAnswer = activeSlide.Shapes["questionAnswer"].TextFrame.TextRange.Text; List <Option> optionList = new List <Option>(); string chars = "ABCDEFG"; for (int i = 0; i < 7; i++) { if (ShapesUitls.IsExistedOfShape(activeSlide, "option" + chars[i] + "Type")) { Option option = new Option(); option.optionType = activeSlide.Shapes["option" + chars[i] + "Type"].TextFrame.TextRange.Text; option.optionDescribe = activeSlide.Shapes["option" + chars[i] + "Text"].TextFrame.TextRange.Text; optionList.Add(option); } else { break; } } QuestionData questionData = new QuestionData(); questionData.question = question; questionData.optionList = optionList; SubmitQuestionForm submitQuestionForm = new SubmitQuestionForm(); submitQuestionForm.questionData = questionData; submitQuestionForm.LoadText(); submitQuestionForm.ShowDialog(); }
private void sumbitJudgeQuestion_Click() { if (buttonClickCount == 0) { return; } buttonClickCount = 0; Slide activeSlide = Globals.ThisAddIn.Application.ActivePresentation.SlideShowWindow.View.Slide; MF.CommandButton button = (MF.CommandButton)activeSlide.Shapes["sumbitButton"].OLEFormat.Object; button.Enabled = false; //MessageBox.Show("Start Test!!"); System.Diagnostics.Debug.WriteLine("触发了"); //Slide activeSlide = Globals.ThisAddIn.Application.ActivePresentation.SlideShowWindow.View.Slide; Question question = new Question(); question.questionType = int.Parse(activeSlide.Shapes["questionType"].TextFrame.TextRange.Text); question.questionScore = int.Parse(activeSlide.Shapes["questionScore"].TextFrame.TextRange.Text); question.questionLimitTime = int.Parse(activeSlide.Shapes["questionLimitTime"].TextFrame.TextRange.Text); question.questionDescribe = activeSlide.Shapes["questionDescribe"].TextFrame.TextRange.Text; question.questionAnswer = activeSlide.Shapes["questionAnswer"].TextFrame.TextRange.Text; System.Diagnostics.Debug.WriteLine("触发了!!"); //List<Option> optionList = new List<Option>(); //Option option = new Option(); //option.optionType = activeSlide.Shapes["questionAnswer"].TextFrame.TextRange.Text; //option.optionDescribe = activeSlide.Shapes["questionDescribe"].TextFrame.TextRange.Text; //optionList.Add(option); QuestionData questionData = new QuestionData(); questionData.question = question; //questionData.optionList = optionList; System.Diagnostics.Debug.WriteLine("触发了!!!~~"); SubmitQuestionForm submitQuestionForm = new SubmitQuestionForm(); submitQuestionForm.questionData = questionData; //submitQuestionForm.LoadText1(activeSlide.Shapes["questionScore"].TextFrame.TextRange.Text, activeSlide.Shapes["questionLimitTime"].TextFrame.TextRange.Text); submitQuestionForm.LoadText(); submitQuestionForm.ShowDialog(); }
private void sumbitSimpleQuestion_Click() { if (buttonClickCount == 0) { return; } buttonClickCount = 0; Slide activeSlide = Globals.ThisAddIn.Application.ActivePresentation.SlideShowWindow.View.Slide; MF.CommandButton button = (MF.CommandButton)activeSlide.Shapes["sumbitButton"].OLEFormat.Object; button.Enabled = false; //System.Diagnostics.Debug.WriteLine("触发了1"); Question question = new Question(); question.questionType = int.Parse(activeSlide.Shapes["questionType"].TextFrame.TextRange.Text); question.questionScore = int.Parse(activeSlide.Shapes["questionScore"].TextFrame.TextRange.Text); question.questionLimitTime = int.Parse(activeSlide.Shapes["questionLimitTime"].TextFrame.TextRange.Text); question.questionDescribe = activeSlide.Shapes["questionDescribe"].TextFrame.TextRange.Text; question.questionAnswer = activeSlide.Shapes["questionAnswer"].TextFrame.TextRange.Text; //System.Diagnostics.Debug.WriteLine("触发了2"); QuestionData questionData = new QuestionData(); questionData.question = question; //questionData.optionList = optionList; // System.Diagnostics.Debug.WriteLine("触发了3"); SubmitQuestionForm submitQuestionForm = new SubmitQuestionForm(); submitQuestionForm.questionData = questionData; submitQuestionForm.LoadText(); submitQuestionForm.ShowDialog(); //System.Diagnostics.Debug.WriteLine("触发了4"); }