示例#1
0
 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);
 }
示例#2
0
 private void AddResLocaly(Resoult res)
 {
     Resoult[] temp = new Resoult[Resoults.Length + 1];
     Array.Copy(Resoults, temp, Resoults.Length);
     temp[Resoults.Length] = res;
     Resoults = temp;
 }
示例#3
0
 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);
         }
     });
 }
示例#4
0
        //用于语音识别
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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;
            }
        }
示例#8
0
 extern static void StartRecognier(Resoult resolut, SpeechBegin speechBegin, SpeechEnd speechEnd, StringBuilder accent);
示例#9
0
 extern static void StartRecognier(Resoult resolut, SpeechBegin speechBegin, SpeechEnd speechEnd);
示例#10
0
 public static void UploadResoult(Resoult resoult, Action <WebResponse> callback)
 {
     JPost(HOST + "/resoults", JsonConvert.SerializeObject(resoult), callback);
 }