private void CheckTeamDone()
 {
     //
     //if(_teamId ==null)
     //{
     //    // khác examing (có thể là done)
     //}
     if ((new BLL()).TeamIsDone(_teamId))
     {
         if (_tmrCheckCauhoi != null)
         {
             _tmrCheckCauhoi.Stop();
         }
         ///
         //hien diem cho nay
         if (_view is V_Led_Vong1)
         {
             V_Led_Vong1 view = _view as V_Led_Vong1;
         }
         ///
         Close();
     }
 }
Ejemplo n.º 2
0
 public App(V_Led_Vong1 view)
 {
     _view            = view;
     _controller      = new LED_Vong1_Controller(_view);
     _view.Controller = _controller;
 }
        private void UpdateView(Question nextQues, bool isShownAnswerkey)
        {
            //throw new NotImplementedException();

            if (_view is V_Led_Vong1)
            {
                V_Led_Vong1 myView = _view as V_Led_Vong1;
                if (nextQues == null)// het cau hoi vong nay
                {
                    return;

                    ////
                    ///
                }
                if (nextQues.ImageRelativePath == null || nextQues.ImageRelativePath == "")
                {
                    //throw new NotImplementedException();'
                    if (nextQues is Compound)
                    {
                        Compound ques = nextQues as Compound;
                        myView.QuestionText        = ques.QuestionContent;
                        myView.QuestionMaybeAnswer = "A." + ques.ChoiceA + "\nB." + ques.ChoiceB + "\nC." + ques.ChoiceC + "\nD." + ques.ChoiceD;
                    }
                    else if (nextQues is Multiple_Choice)
                    {
                        Multiple_Choice ques = nextQues as Multiple_Choice;
                        myView.QuestionText        = ques.QuestionContent;
                        myView.QuestionMaybeAnswer = "A." + ques.ChoiceA + "\nB." + ques.ChoiceB + "\nC." + ques.ChoiceC + "\nD." + ques.ChoiceD;
                        myView.ShowABCD            = true;
                    }
                    else if (nextQues is Fill_In)
                    {
                        Fill_In ques = nextQues as Fill_In;
                        myView.QuestionText = ques.QuestionContent.Replace("NNN", "...");
                        myView.ShowABCD     = false;
                    }
                    else
                    {
                        myView.QuestionText = nextQues.QuestionContent;
                        myView.ShowABCD     = false;
                    }

                    myView.ShowPic         = false;
                    myView.QuestionNumText = nextQues.STT;

                    //if (isShownAnswerkey)
                    //{
                    //    try
                    //    {
                    //        myView.AnswerKey = _preQuestion.AnswerKey;
                    //    }
                    //    catch
                    //    {

                    //    }
                    //    _tmrCheckCauhoi.Stop();

                    //    Timer tmrDung = new Timer();
                    //    tmrDung.Enabled = true;
                    //    //
                    //    if (myView.AnswerKey.Length < 10)
                    //        tmrDung.Interval = 1000;
                    //    else
                    //        tmrDung.Interval = 2000;
                    //    tmrDung.Start();
                    //    tmrDung.Tick += delegate (object send, EventArgs ev)
                    //    {
                    //        //

                    //        V_Load(null, EventArgs.Empty);

                    //        //_tmrCheckCauhoi.Start();

                    //        myView.AnswerKey = "";
                    //        tmrDung.Stop();
                    //        tmrDung.Dispose();
                    //    };


                    //}
                    //else
                    //{
                    //    myView.AnswerKey = "";
                    //}

                    myView.RelocatingAndResizingControls("nohinh");
                }

                else

                {
                    try
                    {
                        myView.Pic = Image.FromFile(Application.StartupPath + nextQues.ImageRelativePath);
                    }

                    finally
                    {
                        if (nextQues is Compound)
                        {
                            Compound ques = nextQues as Compound;
                            myView.QuestionText        = ques.QuestionContent;
                            myView.QuestionMaybeAnswer = "A." + ques.ChoiceA + "\nB." + ques.ChoiceB + "\nC." + ques.ChoiceC + "\nD." + ques.ChoiceD;
                        }
                        else if (nextQues is Multiple_Choice)
                        {
                            Multiple_Choice ques = nextQues as Multiple_Choice;
                            myView.QuestionText        = ques.QuestionContent;
                            myView.QuestionMaybeAnswer = "A." + ques.ChoiceA + "\nB." + ques.ChoiceB + "\nC." + ques.ChoiceC + "\nD." + ques.ChoiceD;
                            myView.ShowABCD            = true;
                        }
                        else if (nextQues is Fill_In)
                        {
                            Fill_In ques = nextQues as Fill_In;
                            myView.QuestionText = ques.QuestionContent.Replace("NNN", "...");
                            myView.ShowABCD     = false;
                        }
                        else
                        {
                            myView.QuestionText = nextQues.QuestionContent;
                            myView.ShowABCD     = false;
                        }

                        myView.ShowPic         = true;
                        myView.QuestionNumText = nextQues.STT;

                        myView.RelocatingAndResizingControls("hinh");
                    }
                }
            }
        }