示例#1
0
 public static void EndLesson()
 {
     BaseHelper.Go("A0");
     GlobalFlowControl.Lesson.Starting = false;
     try
     {
         Synthesizer.SetSpeed(0);
         LessonStatusHelper.Update("", null, "ended", null, null, null);
         if (_thread != null && _thread.IsAlive)
         {
             form2.CloseForm();
             if (_robotCommands != null)
             {
                 _robotCommands.StopSpeak();
             }
             if (_thread != null && _thread.IsAlive)
             {
                 _thread.Abort();
             }
         }
     }
     catch
     {
     }
 }
示例#2
0
        private void RandomAskStudentQuestion()
        {
            TablePositionHelper.RandomStudentForAsking();

            string rdmStd = TablePositionHelper.LatestChosenStudent;

            BaseHelper.Go(TablePositionHelper.FindTablePosByStdId(rdmStd));

            Synthesizer.Speak(rdmStd + ". " + "Can you stand up?");

            Wait(3000);

            int rdmIndex = new Random().Next(3);

            string speech = "";

            switch (rdmIndex)
            {
            case 0:
                speech = "I have a question for you. Are you ready?";
                break;

            case 1:
                speech = "I am going to ask you a question. Please think carefully " +
                         "and give me the answer. ";
                break;

            case 2:
                speech = "Ok. I want to challenge you by asking a question. " +
                         "Please listen carefully and answer. ";
                break;
            }

            Synthesizer.Speak(speech);

            Wait(3000);
        }