comparison src/constants.h @ 56:5410f9f279ea

Redefine question pattern to be more robust We now assume that a question begins after two empty lines.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 09 Aug 2016 09:59:16 +0200
parents aaaf8cdbc85c
children defd29b9f25a
comparison
equal deleted inserted replaced
55:aaaf8cdbc85c 56:5410f9f279ea
53 * @brief Regular expression to define a question. 53 * @brief Regular expression to define a question.
54 * 54 *
55 * A new question is the first unquoted string after the position 55 * A new question is the first unquoted string after the position
56 * that is followed after a newline by the word "Answer" 56 * that is followed after a newline by the word "Answer"
57 */ 57 */
58 #define QUESTION_PATTERN "([^\"]+)^(Answer.*$)", QRegularExpression::MultilineOption 58 #define QUESTION_PATTERN "\n\n(.*)\n+(Answer.*$)", QRegularExpression::MultilineOption
59
60 #define FIRST_QUESTION_PATTERN "(.*)\n+(Answer.*$)", QRegularExpression::MultilineOption
59 61
60 /** 62 /**
61 * @brief Identifiying line that shows a question is a choice question. */ 63 * @brief Identifiying line that shows a question is a choice question. */
62 #define CHOICE_IDENTIFIER "Answer,Votes,Percent" 64 #define CHOICE_IDENTIFIER "Answer,Votes,Percent"
63 65
69 * @brief The pattern used to match an unfilled choice answer. */ 71 * @brief The pattern used to match an unfilled choice answer. */
70 #define CHOICE_UNFILLED_PATTERN "\"([^\"]*)\"," 72 #define CHOICE_UNFILLED_PATTERN "\"([^\"]*)\","
71 73
72 /** 74 /**
73 * @brief The pattern used to match a free text answer. */ 75 * @brief The pattern used to match a free text answer. */
74 #define FREETXT_PATTERN "\"([^\"]*)\"", QRegularExpression::MultilineOption 76 #define FREETXT_PATTERN "\"([^\"]*)\"?", QRegularExpression::MultilineOption
75 77
76 #define TITLE_ROW_HEIGHT 30 78 #define TITLE_ROW_HEIGHT 30
77 79
78 #define CHOICE_ROW_HEIGHT 30 80 #define CHOICE_ROW_HEIGHT 30
79 81
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)