Ejemplo n.º 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);
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 3
0
        public bool SelectPossibleAnswer(string text)
        {
            var answer = PossibleAnswers.FirstOrDefault(a => a.AnswerText == text);

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

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