public SurveyResult(Survey survey, SurveyUser user) { this.survey = survey; this.user = user; answersSet = new List <Tuple <Question, List <Answer>, List <Answer> > >(); surveyTotalScore = 0.0; LastAnsweredQuestion = survey.Questions[1]; }
public SurveyCollection(SurveyUser user) { currentUser = user; if (user.Role.HasFlag(UserRole.Admin)) { canAdd = true; } Surveys = new SurveyObjectCollection <Survey>(); }
public void StartSurvey(int surveyId, SurveyUser user) { if (surveyId <= surveyCollection.Surveys.GetLastId()) { Survey survey = surveyCollection.Surveys[surveyId]; StartSurvey(survey, user); } else { throw new ArgumentOutOfRangeException("surveyId", $"Survey with id {surveyId} not found in collection"); } }
public void StartSurvey(Survey survey, SurveyUser user) { this.surveyResult = new SurveyResult(survey, user); currentQuestion = surveyResult.Survey.Questions[1]; maxQuestionId = surveyResult.Survey.Questions.GetLastId(); }
public Survey(string title, int id, SurveyUser creator) : base(title, id) { Questions = new SurveyObjectCollection <Question>(); UserCreator = creator; }