//加载第qn题目 public void ToQuestionN(int qn, bool forceBegin = false) { MainWindow mainwin = (MainWindow)Application.Current.MainWindow; Exercise exercise = mainwin.ListeningTest.getExercise(qn); currentQuestion = mainwin.ListeningTest.getQuestion(qn); int timeRemain = mainwin.ListeningTest.timeRemain(qn); Part part = mainwin.listeningTest.getPart(qn); bool isPartFirst = mainwin.listeningTest.isPartFirst(qn); if (!forceBegin && isPartFirst) { //查看direction Direction direction = new Direction(part, this, qn); direction.Owner = mainwin; direction.Show(); } else { // 判断试题结束 if (exercise == null) { //提交试题答题记录 Inspection inspection = new Inspection(answer); inspection.Owner = mainwin; inspection.ShowDialog(); return; } TestProgressBar.SetProgress(qn, mainwin.ListeningTest.getExerciseMaxQn(qn), 16); //展示exercise if (currentExercise != exercise) { currentExercise = exercise; //清空显示区域 ExerciseDisplay.Children.Clear(); for (int i = 0; i < currentExercise.questions.Length; i++) { QuestionContent questionContent = new QuestionContent(currentExercise.questions[i], mainwin.ListeningTest.getQn(currentExercise.questions[i]), this); ExerciseDisplay.Children.Add(questionContent); } } //设定当前题目 foreach (QuestionContent qc in ExerciseDisplay.Children) { if (qc.question == currentQuestion) { qc.Active(timeRemain); } else { qc.DeActive(); } } } }
public void Setup() { progressBar = new TestProgressBar(); TestSuiteBuilder builder = new TestSuiteBuilder(); suite = builder.Build( new TestPackage( testsDll ) ); mockEvents = new MockTestEventSource( suite ); }
public void Setup() { progressBar = new TestProgressBar(); //TestSuiteBuilder builder = new TestSuiteBuilder(); //suite = builder.Build( new TestPackage( testsDll ) ); //mockEvents = new MockTestEventSource( suite ); }