private bool LoadNewQuestion(int nextQuestionNumber) { var nextQuestion = QABot.GetQuestion(QABot.ExerciseCount, nextQuestionNumber); if (!String.IsNullOrEmpty(nextQuestion)) { _currentControl.ClearControls(); _currentControl.setQuestionString(nextQuestion); _currentControl.EnableButton("_nextbutton"); _currentControl.setAnswerString(QABot.GetUserAnswer(nextQuestionNumber)); return(true); } else { _currentControl.DisableButton("_nextbutton"); _currentControl.EnableButton("_submitBtn"); return(false); } }
/// <summary> /// Generic method for simulating both the next and prev button clicks /// </summary> private bool LoadNewQuestion(int nextQuestionNumber) { string questionString = QABot.GetQuestion(QABot.ExerciseCount, nextQuestionNumber); if (nextQuestionNumber > 0 && !String.IsNullOrEmpty(questionString)) { _currentControl.ClearControls(); _currentControl.setQuestionString(questionString); _currentControl.EnableButton("_nextbutton"); _currentControl.setAnswerString(QABot.GetUserAnswer(nextQuestionNumber)); return(true); } //else //{ // //QABot.DecrementQuestionCount(); //This takes care of the "EOF" null value returned // _currentControl.DisableButton("_nextbutton"); // _currentControl.EnableButton("_submitBtn"); return(false); //} }