コード例 #1
0
        private void UpdateCurrentQuestion()
        {
            if (currentQuestion != null)
            {
                if (KtextTittle.Value == "")
                {
                    KtextTittle.IsWrong();
                    return;
                }

                if (KtextText.Value == "")
                {
                    KtextText.IsWrong();
                    return;
                }

                currentQuestion.Tittle       = KtextTittle.Value;
                currentQuestion.QuestionText = KtextText.Value;

                currentQuestion.ArrayOfPosiblesQuestions = new String[] { qst_1.Value, qst_2.Value, qst_3.Value, qst_4.Value };

                currentQuestion.CorrectQuestionNumber = GetSelectedIndex();

                currentQuestion.Update();


                FATHER_FORM.SearchData();
                this.Dispose();
            }
        }
コード例 #2
0
        //CreateNewQuestion

        private void CreateNewQuestion()
        {
            if (currentQuestion == null)
            {
                if (KtextTittle.Value == "")
                {
                    KtextTittle.IsWrong();
                    return;
                }

                if (KtextText.Value == "")
                {
                    KtextText.IsWrong();
                    return;
                }

                currentQuestion              = new Question();
                currentQuestion.Tittle       = KtextTittle.Value;
                currentQuestion.QuestionText = KtextText.Value;

                currentQuestion.ArrayOfPosiblesQuestions = new String[] { qst_1.Value, qst_2.Value, qst_3.Value, qst_4.Value };

                currentQuestion.CorrectQuestionNumber = GetSelectedIndex();

                currentQuestion.Insert();

                currentQuestion = null;

                KtextText.Value = KtextTittle.Value = "";

                qst_1.Value      = qst_2.Value = qst_3.Value = qst_4.Value = "Posible respuesta";
                qst_1.IsSelected = qst_2.IsSelected = qst_3.IsSelected = qst_4.IsSelected = false;

                FATHER_FORM.SearchData();
                this.Dispose();
            }
        }