public override void BeginExam(ExamFlowType nextFlowType) { }
public override void BeginExam(ExamFlowType nextFlowType) { if (!GlobalUser.DoAnswer) { CleanUp(); return; } Paper_ItemsItem itemInfo = PaperItems[0].items[_itemIndex]; switch (nextFlowType) { case ExamFlowType.TitleAudio: //1.播放大题题干 PromptCommandText = "听指令"; _NextFlowType = ExamFlowType.PromptAudio; PlayAudio(QsTitleAudio); break; case ExamFlowType.PromptAudio: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(PaperItems[0].source_content)) { _NextFlowType = ExamFlowType.QuestionAudio; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.QuestionAudio; PlayAudio(PaperItems[0].source_content); break; case ExamFlowType.QuestionAudio: //3.播放 题目音频 PromptCommandText = "请听录音"; if (string.IsNullOrEmpty(itemInfo.source_content)) { _NextFlowType = ExamFlowType.PrepareTime; BeginExam(_NextFlowType); break; } PlayAudio(itemInfo.source_content); if (itemInfo.item_repet_times > 1 && itemInfo.item_repet_times > _item_repet_times) { _item_repet_times++; _NextFlowType = ExamFlowType.QuestionAudio; } else { _NextFlowType = ExamFlowType.PrepareTime; } break; case ExamFlowType.PrepareTime: //3.阅读题目 PromptCommandText = "请看题"; TotalTime = itemInfo.item_prepare_second; PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.AnswerTime; _dTimer.Start(); break; case ExamFlowType.StartRecordAudio: //3.阅读题目 PromptCommandText = "准备录音"; _NextFlowType = ExamFlowType.AnswerTime; //PlayAudio(PaperItems[_itemIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "startrecord.mp3")); break; case ExamFlowType.AnswerTime: //3.阅读题目 //PromptCommandText = "开始录音"; //TotalTime = itemInfo.item_answer_second; //PlayTime = 0; //_NextFlowType = ExamFlowType.StopRecordAudio; //_Recording = RecordState.Recording; //PlayRecorder(); PromptCommandText = "开始答题"; TotalTime = itemInfo.item_answer_second; PlayTime = 0; _NextFlowType = ExamFlowType.StopRecordAudio; _Recording = RecordState.Recording; PlayRecorderWithSysAduio("startrecord"); break; case ExamFlowType.StopRecordAudio: //3.阅读题目 PromptCommandText = "停止录音"; _NextFlowType = ExamFlowType.NextQs; //PlayAudio(PaperItems[_itemIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "stoprecord.mp3")); break; //case ExamFlowType.AnswerTime: // //3.阅读题目 // PromptCommandText = "开始答题"; // TotalTime = itemInfo.item_answer_second; // PlayTime = 0; // _NextFlowType = ExamFlowType.NextQs; // _Recording = RecordState.Recording; // PlayRecorderWithSysAduio("startrecord"); // break; case ExamFlowType.NextQs: //记录答案 UpdateAnswer(); //3.下一题 _itemIndex++; _NextFlowType = ExamFlowType.PrepareTime; BindQsItemInfo(); break; } }
public override void BeginExam(ExamFlowType nextFlowType) { if (!GlobalUser.DoAnswer) { CleanUp(); return; } //Paper_ItemsItem itemInfo = PaperItems[0].items[_itemIndex]; switch (nextFlowType) { case ExamFlowType.TitleAudio: //1.播放大题题干 PromptCommandText = "听指令"; if (string.IsNullOrEmpty(QsTitleAudio)) { _NextFlowType = ExamFlowType.PromptAudio; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.PromptAudio; PlayAudio(QsTitleAudio); break; case ExamFlowType.PromptAudio: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(infoList[0].audio)) { _NextFlowType = ExamFlowType.PromptAudio1; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.PromptAudio1; QsTitleContent = infoList[0].text; PlayAudio(infoList[0].audio); break; case ExamFlowType.PromptAudio1: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(infoList[1].audio)) { _NextFlowType = ExamFlowType.PrepareTime; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.PrepareTime; QsTitleContent = infoList[1].text; PlayAudio(infoList[1].audio); break; case ExamFlowType.PrepareTime: //3.阅读题目 PromptCommandText = "请看题"; TotalTime = PaperItems[0].items[0].item_prepare_second; PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.QuestionAudio; _dTimer.Start(); break; case ExamFlowType.QuestionAudio: //3.播放 题目音频 PromptCommandText = "请听录音"; if (string.IsNullOrEmpty(PaperItems[0].info_content_source_content)) { _NextFlowType = ExamFlowType.PromptAudio2; BeginExam(_NextFlowType); break; } PlayAudio(PaperItems[0].info_content_source_content); if (PaperItems[0].info_repet_times > 1 && PaperItems[0].info_repet_times > _item_repet_times) { Thread.SpinWait(2 * 1000); _item_repet_times++; _NextFlowType = ExamFlowType.QuestionAudio; } else { _NextFlowType = ExamFlowType.PromptAudio2; } break; case ExamFlowType.PromptAudio2: ShowTextBox = Visibility.Visible; //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(infoList[2].audio)) { _NextFlowType = ExamFlowType.AnswerTime; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.AnswerTime; QsTitleContent = infoList[2].text; PlayAudio(infoList[2].audio); break; case ExamFlowType.AnswerTime: //3.填空 PromptCommandText = "开始答题"; _answerTime = TotalTime = PaperItems[0].items.Sum(s => s.item_answer_second); PlayTime = 0; _NextFlowType = ExamFlowType.PromptAudio3; _dTimer.Start(); break; case ExamFlowType.PromptAudio3: EnableTextBox = false; UpdateTextAnswer(); //填空提交 //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(infoList[3].audio)) { _NextFlowType = ExamFlowType.Question1Audio; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.Question1Audio; QsTitleContent = infoList[3].text; PlayAudio(infoList[3].audio); break; case ExamFlowType.Question1Audio: //3.播放 题目音频 PromptCommandText = "请听录音"; if (string.IsNullOrEmpty(PaperItems[1].info_content_source_content)) { _NextFlowType = ExamFlowType.PromptAudio4; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.PromptAudio4; PlayAudio(PaperItems[0].info_content_source_content); break; case ExamFlowType.PromptAudio4: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(infoList[4].audio)) { _NextFlowType = ExamFlowType.PrepareTime2; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.PrepareTime2; QsTitleContent = infoList[4].text; PlayAudio(infoList[4].audio); break; case ExamFlowType.PrepareTime2: //3.阅读题目 PromptCommandText = "请看题"; TotalTime = PaperItems[1].items[0].item_prepare_second; PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.PromptAudio5; _dTimer.Start(); break; case ExamFlowType.PromptAudio5: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(infoList[5].audio)) { _NextFlowType = ExamFlowType.RecordTime; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.RecordTime; QsTitleContent = infoList[5].text; PlayAudio(infoList[5].audio); break; case ExamFlowType.StartRecordAudio: //3.阅读题目 PromptCommandText = "准备录音"; _NextFlowType = ExamFlowType.RecordTime; //PlayAudio(PaperItems[_itemIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "startrecord.mp3")); break; case ExamFlowType.RecordTime: //3.阅读题目 //PromptCommandText = "开始录音"; //TotalTime = itemInfo.item_answer_second; //PlayTime = 0; //_NextFlowType = ExamFlowType.StopRecordAudio; //_Recording = RecordState.Recording; //PlayRecorder(); PromptCommandText = "开始答题"; TotalTime = PaperItems[1].items[0].item_answer_second; PlayTime = 0; _NextFlowType = ExamFlowType.StopRecordAudio; _Recording = RecordState.Recording; PlayRecorderWithSysAduio("startrecord"); break; case ExamFlowType.StopRecordAudio: //3.阅读题目 PromptCommandText = "停止录音"; _NextFlowType = ExamFlowType.NextQs; //PlayAudio(PaperItems[_itemIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "stoprecord.mp3")); break; //case ExamFlowType.AnswerTime: // //3.阅读题目 // PromptCommandText = "开始答题"; // TotalTime = itemInfo.item_answer_second; // PlayTime = 0; // _NextFlowType = ExamFlowType.NextQs; // _Recording = RecordState.Recording; // PlayRecorderWithSysAduio("startrecord"); // break; case ExamFlowType.NextQs: //记录答案 UpdateAnswer(); //3.下一题 _itemIndex = 2; _NextFlowType = ExamFlowType.PrepareTime; BindQsItemInfo(); break; } }
public override void BeginExam(ExamFlowType nextFlowType) { var itemInfo = PaperItems[_itemIndex]; switch (nextFlowType) { case ExamFlowType.TitleAudio: //1.播放大题题干 PromptCommandText = "听指令"; _NextFlowType = ExamFlowType.PromptAudio; PlayAudio(QsTitleAudio); break; case ExamFlowType.PromptAudio: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(itemInfo.source_content)) { _NextFlowType = ExamFlowType.PrepareTime; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.PrepareTime; PlayAudio(itemInfo.source_content); break; case ExamFlowType.PrepareTime: //3.阅读题目 PromptCommandText = "请看题"; _prepareTime = TotalTime = itemInfo.items.Sum(s => s.item_prepare_second); PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.QuestionAudio; _dTimer.Start(); break; case ExamFlowType.QuestionAudio: //3.播放 题目音频 PromptCommandText = "请听录音"; if (string.IsNullOrEmpty(itemInfo.info_content_source_content)) { _NextFlowType = ExamFlowType.AnswerTime; BeginExam(_NextFlowType); break; } PlayAudio(itemInfo.info_content_source_content); if (itemInfo.info_repet_times > 1 && itemInfo.info_repet_times > _item_repet_times) { _item_repet_times++; _NextFlowType = ExamFlowType.QuestionAudio; } else { _NextFlowType = ExamFlowType.AnswerTime; } break; case ExamFlowType.AnswerTime: //3.阅读题目 PromptCommandText = "开始答题"; _answerTime = TotalTime = itemInfo.items.Sum(s => s.item_answer_second); PlayTime = 0; _NextFlowType = ExamFlowType.NextQs; _dTimer.Start(); break; case ExamFlowType.NextQs: //记录答案 UpdateAnswer(); //3.下一题 _itemIndex++; _NextFlowType = ExamFlowType.PrepareTime; BindQsItemInfo(); break; } }
public virtual void BeginExam(ExamFlowType nextFlowType) { }
public override void BeginExam(ExamFlowType nextFlowType) { if (!GlobalUser.DoAnswer) { CleanUp(); return; } var itemInfo = PaperItems[0]; switch (nextFlowType) { case ExamFlowType.TitleAudio: //1.播放大题题干 PromptCommandText = "听指令"; _NextFlowType = ExamFlowType.PromptAudio; PlayAudio(QsTitleAudio); break; case ExamFlowType.PromptAudio: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; _NextFlowType = ExamFlowType.PrepareTime; if (string.IsNullOrEmpty(itemInfo.source_content)) { BeginExam(_NextFlowType); break; } //_NextFlowType = ExamFlowType.PrepareTime; PlayAudio(itemInfo.source_content); break; case ExamFlowType.PrepareTime: //3.阅读题目 PromptCommandText = "请看题"; _prepareTime = TotalTime = itemInfo.items.Sum(s => s.item_prepare_second); PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.QuestionInfoAudio; _dTimer.Start(); break; case ExamFlowType.QuestionInfoAudio: //3.播放 题目音频 PromptCommandText = "请听录音"; if (string.IsNullOrEmpty(itemInfo.info_content_source_content)) { _NextFlowType = ExamFlowType.QuestionAudio; BeginExam(_NextFlowType); break; } PlayAudio(itemInfo.info_content_source_content); if (itemInfo.info_repet_times > 1 && itemInfo.info_repet_times > _item_repet_times) { _item_repet_times++; _NextFlowType = ExamFlowType.TipTime; } else { _NextFlowType = ExamFlowType.QuestionAudio; } break; case ExamFlowType.TipTime: //间隔 等待时间 PromptCommandText = ""; TotalTime = PaperItems[0].info_interval; PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.QuestionInfoAudio; _dTimer.Start(); break; //case ExamFlowType.TipAudio: // //间隔 等待提示音 // PromptCommandText = ""; // _NextFlowType = ExamFlowType.QuestionInfoAudio; // if (string.IsNullOrEmpty(PaperItems[0].item_tip_source_content)) // { // BeginExam(_NextFlowType); // break; // } // //_NextFlowType = ExamFlowType.PrepareTime; // PlayAudio(PaperItems[0].item_tip_source_content); // break; case ExamFlowType.ItemTipAudio: //间隔 等待提示音 PromptCommandText = ""; _NextFlowType = ExamFlowType.QuestionAudio; if (string.IsNullOrEmpty(PaperItems[0].item_tip_source_content)) { BeginExam(_NextFlowType); break; } //_NextFlowType = ExamFlowType.PrepareTime; PlayAudio(PaperItems[0].item_tip_source_content); break; case ExamFlowType.QuestionAudio: //间隔 等待提示音 PromptCommandText = "请听录音"; _NextFlowType = ExamFlowType.PrepareTime; if (string.IsNullOrEmpty(itemInfo.items[_itemIndex].source_content)) { BeginExam(_NextFlowType); break; } PlayAudio(itemInfo.items[_itemIndex].source_content); if (itemInfo.items[_itemIndex].item_repet_times > 1 && itemInfo.items[_itemIndex].item_repet_times > _item_repet_times) { _item_repet_times++; _NextFlowType = ExamFlowType.ItemTipAudio; } else { _NextFlowType = ExamFlowType.AnswerTime; } break; case ExamFlowType.AnswerTime: //3.阅读题目 PromptCommandText = "开始答题"; _answerTime = TotalTime = itemInfo.items[_itemIndex].item_answer_second; PlayTime = 0; _NextFlowType = ExamFlowType.NextQs; _dTimer.Start(); break; case ExamFlowType.NextQs: //记录答案 UpdateAnswer(); //3.下一题 _itemIndex++; _NextFlowType = ExamFlowType.ItemTipAudio; BindQsItemInfo(); break; } }
public override void BeginExam(ExamFlowType nextFlowType) { if (_infoIndex == 2) { //询问 switch (nextFlowType) { case ExamFlowType.TitleAudio: //1.播放大题题干 PromptCommandText = "听指令"; _NextFlowType = ExamFlowType.PromptAudio; PlayAudio(QsTitleAudio); break; case ExamFlowType.PromptAudio: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(PaperItems[_infoIndex].source_content)) { _NextFlowType = ExamFlowType.QuestionAudio; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.QuestionAudio; PlayAudio(PaperItems[_infoIndex].source_content); break; case ExamFlowType.QuestionAudio: //3.播放 题目音频 PromptCommandText = "请听录音"; if (string.IsNullOrEmpty(PaperItems[_infoIndex].items[_itemIndex].source_content)) { _NextFlowType = ExamFlowType.PrepareTime; BeginExam(_NextFlowType); break; } PlayAudio(PaperItems[_infoIndex].items[_itemIndex].source_content); if (PaperItems[_infoIndex].items[_itemIndex].item_repet_times > 1 && PaperItems[_infoIndex].items[_itemIndex].item_repet_times > _item_repet_times) { _item_repet_times++; _NextFlowType = ExamFlowType.QuestionAudio; } else { _NextFlowType = ExamFlowType.PrepareTime; } break; case ExamFlowType.PrepareTime: //3.阅读题目 PromptCommandText = "请看题"; TotalTime = PaperItems[_infoIndex].items[_itemIndex].item_prepare_second; PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.AnswerTime; _dTimer.Start(); break; case ExamFlowType.StartRecordAudio: //3.阅读题目 PromptCommandText = "准备录音"; _NextFlowType = ExamFlowType.AnswerTime; //PlayAudio(PaperItems[_infoIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "startrecord.mp3")); break; case ExamFlowType.AnswerTime: ////3.阅读题目 //PromptCommandText = "开始录音"; //TotalTime = PaperItems[_infoIndex].items[_itemIndex].item_answer_second; //PlayTime = 0; //_NextFlowType = ExamFlowType.StopRecordAudio; //_Recording = RecordState.Recording; //PlayRecorder(); //3.阅读题目 PromptCommandText = "开始答题"; TotalTime = PaperItems[_infoIndex].items[_itemIndex].item_answer_second; PlayTime = 0; _NextFlowType = ExamFlowType.StopRecordAudio; _Recording = RecordState.Recording; PlayRecorderWithSysAduio("startrecord"); break; case ExamFlowType.StopRecordAudio: //3.阅读题目 PromptCommandText = "停止录音"; _NextFlowType = ExamFlowType.NextQs; //PlayAudio(PaperItems[_infoIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "stoprecord.mp3")); break; //case ExamFlowType.AnswerTime: // //3.阅读题目 // PromptCommandText = "开始答题"; // TotalTime = itemInfo.item_answer_second; // PlayTime = 0; // _NextFlowType = ExamFlowType.NextQs; // _Recording = RecordState.Recording; // PlayRecorderWithSysAduio("startrecord"); // break; case ExamFlowType.NextQs: //记录答案 UpdateAnswer(EngineQsType.SCENEASK); //3.下一题 _itemIndex++; _NextFlowType = ExamFlowType.QuestionAudio; BindQsItemInfo(); break; } } else { //信息获取 switch (nextFlowType) { case ExamFlowType.TitleAudio: //1.播放大题题干 PromptCommandText = "听指令"; _NextFlowType = ExamFlowType.PromptAudio; PlayAudio(QsTitleAudio); break; case ExamFlowType.PromptAudio: //2.播放大题题干 提示音频, PromptCommandText = "听指令"; if (string.IsNullOrEmpty(PaperItems[_infoIndex].source_content)) { _NextFlowType = ExamFlowType.PrepareTime; BeginExam(_NextFlowType); break; } _NextFlowType = ExamFlowType.PrepareTime; PlayAudio(PaperItems[_infoIndex].source_content); break; case ExamFlowType.PrepareTime: //3.阅读题目 PromptCommandText = "请看题"; TotalTime = PaperItems[0].info_prepare_second; PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.QuestionAudio; _dTimer.Start(); break; case ExamFlowType.QuestionAudio: //3.播放 题目音频 PromptCommandText = "请听录音"; if (string.IsNullOrEmpty(PaperItems[_infoIndex].info_content_source_content)) { _NextFlowType = ExamFlowType.PrepareTime2; BeginExam(_NextFlowType); break; } PlayAudio(PaperItems[_infoIndex].info_content_source_content); if (PaperItems[_infoIndex].info_repet_times > 1 && PaperItems[_infoIndex].info_repet_times > _info_repet_times) { _info_repet_times++; _NextFlowType = ExamFlowType.QuestionAudio; } else { _NextFlowType = ExamFlowType.PrepareTime2; } break; case ExamFlowType.PrepareTime2: QsItemContent = ""; QsItemContent1 = PaperItems[1].info_content; //3.阅读题目 PromptCommandText = "请看题"; TotalTime = PaperItems[1].items[0].item_prepare_second; PlayTime = 0; SendProgress(); _NextFlowType = ExamFlowType.AnswerTime; _dTimer.Start(); break; case ExamFlowType.StartRecordAudio: //3.阅读题目 PromptCommandText = "准备录音"; _NextFlowType = ExamFlowType.AnswerTime; //PlayAudio(PaperItems[_infoIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "startrecord.mp3")); break; case ExamFlowType.AnswerTime: ////3.阅读题目 //PromptCommandText = "开始录音"; //TotalTime = PaperItems[1].items[0].item_answer_second; //PlayTime = 0; //_NextFlowType = ExamFlowType.StopRecordAudio; //_Recording = RecordState.Recording; //PlayRecorder(); //3.阅读题目 PromptCommandText = "开始答题"; TotalTime = PaperItems[1].items[0].item_answer_second; PlayTime = 0; _NextFlowType = ExamFlowType.StopRecordAudio; _Recording = RecordState.Recording; PlayRecorderWithSysAduio("startrecord"); break; case ExamFlowType.StopRecordAudio: //3.阅读题目 PromptCommandText = "停止录音"; _NextFlowType = ExamFlowType.NextQs; //PlayAudio(PaperItems[_infoIndex].source_content); PlaySysAudio(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "stoprecord.mp3")); break; //case ExamFlowType.AnswerTime: // //3.阅读题目 // PromptCommandText = "开始答题"; // TotalTime = itemInfo.item_answer_second; // PlayTime = 0; // _NextFlowType = ExamFlowType.NextQs; // _Recording = RecordState.Recording; // PlayRecorderWithSysAduio("startrecord"); // break; case ExamFlowType.NextQs: //记录答案 UpdateAnswer(EngineQsType.COMPOSITION, 1, 0); //3.下一题 _itemIndex = 2; _NextFlowType = ExamFlowType.PromptAudio; BindQsItemInfo(); break; } } }