| |
80 |
80 |
if {[db_0or1row upload_file_exist ""]} { |
| |
81 |
81 |
set upload_file_exist($question_id) $attachment_answer |
| |
82 |
82 |
} |
| |
83 |
83 |
} |
| |
84 |
84 |
|
| |
85 |
85 |
if { [exists_and_not_null response_to_question($question_id)] } { |
| |
86 |
86 |
|
| |
87 |
87 |
set response_value [string trim $response_to_question($question_id)] |
| |
88 |
88 |
} elseif {$required_p == "t" && ![info exists upload_file_exist($question_id)]} { |
| |
89 |
89 |
lappend questions_with_missing_responses $question_text |
| |
90 |
90 |
continue |
| |
91 |
91 |
} else { |
| |
92 |
92 |
set response_to_question($question_id) "" |
| |
93 |
93 |
set response_value "" |
| |
94 |
94 |
} |
| |
95 |
95 |
|
| |
96 |
96 |
if {![empty_string_p $response_value]} { |
| |
97 |
97 |
if { $abstract_data_type == "number" } { |
| |
98 |
98 |
if { ![regexp {^(-?[0-9]+\.)?[0-9]+$} $response_value] } { |
| |
99 |
99 |
|
| |
100 |
|
ad_complain "[_ survey.lt_The_response_to_quest]"." |
| |
|
100 |
ad_complain "[_ survey.lt_The_response_to_quest]" |
| |
101 |
101 |
continue |
| |
102 |
102 |
} |
| |
103 |
103 |
} elseif { $abstract_data_type == "integer" } { |
| |
104 |
104 |
if { ![regexp {^[0-9]+$} $response_value] } { |
| |
105 |
105 |
|
| |
106 |
106 |
ad_complain "[_ survey.lt_The_response_to_quest_1]" |
| |
107 |
107 |
continue |
| |
108 |
108 |
} |
| |
109 |
109 |
} |
| |
110 |
110 |
} |
| |
111 |
111 |
|
| |
112 |
112 |
if { $abstract_data_type == "blob" } { |
| |
113 |
113 |
set tmp_filename $response_to_question($question_id.tmpfile) |
| |
114 |
114 |
set n_bytes [file size $tmp_filename] |
| |
115 |
115 |
if { $n_bytes == 0 && $required_p == "t" } { |
| |
116 |
116 |
if {![info exist upload_file_exist($question_id)]} { |
| |
117 |
117 |
ad_complain "[_ survey.lt_Your_file_is_zero-len]" |
| |
118 |
118 |
} |
| |
119 |
119 |
} |
| |
120 |
120 |
} |