public static string GetQuestion(QuestionMove questionMove) { try { if (questionMove == QuestionMove.Forward) { _questionNumber++; } if (questionMove == QuestionMove.BackWard) { _questionNumber--; } if ((_questionNumber >= _questions.Length) & (Options.CanMoveWithoutAnswer)) { _notAnsweredQuestions = true; } if (_notAnsweredQuestions) { var questionName = CheckHavingQuestionInResultsScores(); return(questionName != null ? _questionNumber + 1 + ") " + questionName : null); } if ((_questions.Length > _questionNumber) & (_questionNumber >= 0)) { return(_questionNumber + 1 + ") " + _questions[_questionNumber].Name); } _interviewCompleteness = true; return(null); } catch (Exception exp) { throw new Exception("GetQuestion: " + exp); } }
public void MakeAnswers(object question, QuestionMove questionMove) { try { var list = InterView.GetAnswersOnQuestion(question); SetAnswerSettings(list, questionMove); } catch (Exception exp) { throw new Exception(exp.ToString()); } }
public object GetQuestion(QuestionMove questionMove) { DeleteCurrentQuestionAndSetDefaults(); var question = InterView.GetQuestion(questionMove); if (Options.HavePictures) { _img = InterView.GetImageOnCurrQuestion(); _baseControl.Invalidate(); } return(question); }
private void GetQuestionAndAnswers(QuestionMove questionMove) { var question = _questionMaker.GetQuestion(questionMove); if (question == null) { FactorAnalize.FactorAnalizeInit(""); Close(); } else { Question_Lbl.Text = question.ToString(); var questionLocation = new Point(Question_Lbl.Location.X, Question_Lbl.Location.Y + Question_Lbl.Height); _questionMaker.ChangeQuestionCoords(questionLocation); _questionMaker.MakeAnswers(question, questionMove); } }
private void SetAnswerSettings(IEnumerable answerList, QuestionMove questionMove) { //admintools var spaceBetweenQuestionAndAnswers = Options.SpaceBetweenQuestionAndAnswers; var spaceBetweenAnswers = Options.SpaceBetweenAnswers; var spaceBetweenQuestionAndPicture = Options.PictureLocation; //only vertical dependence spaceBetweenQuestionAndPicture.X = 0; Point pictureSize; if (!Options.HavePictures) { spaceBetweenQuestionAndPicture = new Point(0, 0); } if (_img != null) { pictureSize = new Point(_img.Width, _img.Height); } else { pictureSize = new Point(0, 0); } // foreach (var element in answerList) { var radionButton = new RadioButton() { Location = new Point(_questionCoords.X + spaceBetweenQuestionAndPicture.X + spaceBetweenQuestionAndAnswers.X, _questionCoords.Y + spaceBetweenQuestionAndPicture.Y + pictureSize.Y + spaceBetweenQuestionAndAnswers.Y), Text = element.ToString(), Size = new Size(200, 25), Font = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold), Anchor = AnchorStyles.Bottom }; if (element == InterView.GetAnswerFromResultScoreList()) { radionButton.Checked = true; } spaceBetweenQuestionAndAnswers.X += spaceBetweenAnswers.X; spaceBetweenQuestionAndAnswers.Y += spaceBetweenAnswers.Y; _baseControl.Controls.Add(radionButton); } }