private void button1_Click(object sender, EventArgs e) { mResoult = new Resoult(Form1.CSCallResoult); mSpeechEnd = new SpeechEnd(Form1.CSCallSpeechEnd); mSpeechBegin = new SpeechBegin(Form1.CSCallSpeechBegin); StartRecognier(mResoult, mSpeechBegin, mSpeechEnd); }
private void AddResLocaly(Resoult res) { Resoult[] temp = new Resoult[Resoults.Length + 1]; Array.Copy(Resoults, temp, Resoults.Length); temp[Resoults.Length] = res; Resoults = temp; }
private void ExamFinished(Resoult resoult) { Show(); resoult.User = User.Id; WebRequest.UploadResoult(resoult, (response) => { if (response.IsSucces()) { AddResLocaly(resoult); Exam element = null; foreach (Exam exam in Exams) { if (exam.Id == resoult.Exam) { element = exam; } } OpenExamResult(element); ExamListView_SelectedIndexChanged(this, new EventArgs()); } else { MessageBox.Show("Error while uploading the result! Try again!", "Exam error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }); }
//用于语音识别 private void button1_Click(object sender, EventArgs e) { //用来识别进行的相应委托 mResoult = new Resoult(CSCallResoult); mSpeechEnd = new SpeechEnd(CSCallSpeechEnd); mSpeechBegin = new SpeechBegin(CSCallSpeechBegin); //开启当前的语音识别 StringBuilder content = new StringBuilder(); content.Append("mandarin"); StartRecognier(mResoult, mSpeechBegin, mSpeechEnd, content); }
private int GetRes(Resoult res) { int curr = 0; for (int i = 0; i < examquestions.Length; i++) { if (res.Answers[i] == 0) { curr += examquestions[i].Point; } } return(curr); }
private Resoult FindResult(Exam exam) { Resoult r = null; foreach (var res in Resoults) { if (res.Exam == exam.Id && res.User == User.Id) { r = res; } } return(r); }
private void LoadUp() { newresults = Array.FindAll <Resoult>(newresults, u => u.Exam == exam.Id); myresoult = Array.Find <Resoult>(newresults, u => u.User == me.Id); try { WriteText(); WriteChart(); } catch (Exception ex) { MessageBox.Show(ex.Message); throw; } }
extern static void StartRecognier(Resoult resolut, SpeechBegin speechBegin, SpeechEnd speechEnd, StringBuilder accent);
extern static void StartRecognier(Resoult resolut, SpeechBegin speechBegin, SpeechEnd speechEnd);
public static void UploadResoult(Resoult resoult, Action <WebResponse> callback) { JPost(HOST + "/resoults", JsonConvert.SerializeObject(resoult), callback); }