Beispiel #1
0
        /// <summary>
        /// Add a question to the TextFormStep
        /// </summary>
        /// <param name="questionText"></param>
        /// <param name="validityCondition">A delegate applied to an answer that determines if the answer is valid</param>
        /// <param name="passwordChar">Password masking character</param>
        /// <returns></returns>
        public Question AddQuestion(string questionText, AnswerCondition validityCondition, char passwordChar)
        {
            var result = AddQuestion(questionText, validityCondition);

            result.PasswordChar = passwordChar;
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Add a Question into the TextFormStep
        /// </summary>
        /// <param name="textQuestion"></param>
        /// <param name="validityCondition"></param>
        public Question AddQuestion(string textQuestion, AnswerCondition validityCondition)
        {
            var result = AddQuestion(textQuestion);

            result.ValidityCondition = validityCondition;
            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// The answer is valid if its length is between the specified minimum and maximum (inclusive)
        /// </summary>
        /// /// <param name="minimum"></param>
        /// /// <param name="maximum"></param>
        public static AnswerCondition Length(int minimum, int maximum)
        {
            AnswerCondition lengthDelegate = (answer) =>
            {
                return(!(answer == null || answer.Length < minimum || answer.Length > maximum));
            };

            return(lengthDelegate);
        }
Beispiel #4
0
        AnswerCondition[] DataToAnswerCondition(int[][] _data)
        {
            AnswerCondition[] result = new AnswerCondition[_data[0].Length];

            for (int i = 0; i < result.Length; i++)
            {
                if (_data[0][i] > 3)
                {
                    List <Word> words = new List <Word>();
                    for (int j = 3; j < 11; j++)
                    {
                        if (_data[j][i] != 0)
                        {
                            words.Add((Word)_data[j][i]);
                            //Debug.Log("Condition N°"+_data[1][i]+" - mot n°"+j+" : "+(Word)_data[j][i]);
                        }
                    }
                    result[i] = new AnswerCondition(words.ToArray(), _data[2][i]);
                }
            }
            //Debug.Log("Test : "+result[0].words[0]);

            return(result);
        }
Beispiel #5
0
 /// <summary>
 /// Add a question to the TextFormStep
 /// </summary>
 /// <param name="questionText"></param>
 /// <param name="validityCondition">A delegate applied to an answer that determines if the answer is valid</param>
 /// <param name="passwordChar">Password masking character</param>
 /// <returns></returns>
 public Question AddQuestion(string questionText, AnswerCondition validityCondition, char passwordChar)
 {
     var result = AddQuestion(questionText, validityCondition);
     result.PasswordChar = passwordChar;
     return result;
 }
Beispiel #6
0
 /// <summary>
 /// Add a Question into the TextFormStep
 /// </summary>
 /// <param name="textQuestion"></param>
 /// <param name="validityCondition"></param>
 public Question AddQuestion(string textQuestion, AnswerCondition validityCondition)
 {
     var result = AddQuestion(textQuestion);
     result.ValidityCondition = validityCondition;
     return result;
 }
Beispiel #7
0
 /// <summary>
 /// Creates a new Question
 /// </summary>
 /// <param name="text">The title to be shown in the header</param>
 /// <param name="validity">The condition for allowing the Next button to be enabled</param>
 public Question(string text, AnswerCondition validity)
 {
     this.QuestionText = text;
     this.ValidityCondition = validity;
 }
Beispiel #8
0
 /// <summary>
 /// Creates a new Question
 /// </summary>
 /// <param name="text">The title to be shown in the header</param>
 /// <param name="validity">The condition for allowing the Next button to be enabled</param>
 public Question(string text, AnswerCondition validity)
 {
     this.QuestionText      = text;
     this.ValidityCondition = validity;
 }