Example #1
0
        public override void RemoveChild(AssestmentContext dbContext, BaseEntity childToRemove)
        {
            var itemToRemove = PossibleAnswers.FirstOrDefault(x => x.InternalId == childToRemove.InternalId);

            PossibleAnswers.Remove(itemToRemove);
            dbContext.PossibleAnswers.Remove(itemToRemove);
        }
Example #2
0
        public Task <bool> JudgeAsync(IInteractionContext sourceContext, SocketMessage parameter)
        {
            var input = parameter.Content.ConvertTypesetterToTypewriter();

            Answer = PossibleAnswers.FirstOrDefault(possibleAnswer => possibleAnswer.EqualsIgnoreCase(input));

            return(Task.FromResult(!string.IsNullOrEmpty(Answer)));
        }
Example #3
0
        public bool SelectPossibleAnswer(string text)
        {
            var answer = PossibleAnswers.FirstOrDefault(a => a.AnswerText == text);

            if (answer != null)
            {
                answer.IsSelected = true;
            }

            return(answer != null);
        }
Example #4
0
 public SurveyAnswer FindPossibleAnswer(string text)
 {
     return(PossibleAnswers.FirstOrDefault(a => a.AnswerText == text));
 }