Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
simple-survey
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
simple-survey
Commits
714a07be
Commit
714a07be
authored
May 09, 2018
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed issue saving numeric response values
parent
9ce55059
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
15 deletions
+6
-15
one.adp
www/one.adp
+1
-1
one.tcl
www/one.tcl
+0
-1
process-response.tcl
www/process-response.tcl
+5
-13
No files found.
www/one.adp
View file @
714a07be
...
...
@@ -9,7 +9,7 @@
@message;noquote@
</if>
<h1><%= [lang::message::lookup "" simple-survey.Fill_out_survey "Please fill out the survey below.
Thank you for your cooperation.
"] %><h1>
<h1><%= [lang::message::lookup "" simple-survey.Fill_out_survey "Please fill out the survey below."] %><h1>
<br>
<p>
@description;noquote@
...
...
www/one.tcl
View file @
714a07be
# Is this page called as part of a workflow panel?
if
{
!
[
info
exists task
]}
{
...
...
www/process-response.tcl
View file @
714a07be
...
...
@@ -154,7 +154,7 @@ if {"" != $task_id} {
-assignments
{}
\
$task
_id
\
$the
_action
\
]
]
}
...
...
@@ -201,7 +201,6 @@ db_transaction {
order by sort_key
"
]
foreach question
$question
_info_list
{
set question_id
[
lindex
$question
0
]
set question_text
[
lindex
$question
1
]
...
...
@@ -210,6 +209,8 @@ db_transaction {
set response_value
[
string
trim
$response
_to_question
(
$question
_id
)]
ns_log Notice
"process-response: id=
$question
_id, text=
$question
_text, data_type=
$abstract
_data_type, prz=
$presentation
_type, value=
$response
_value"
switch --
$abstract
_data_type
{
"choice"
{
if
{
$presentation
_type ==
"checkbox"
}
{
...
...
@@ -249,8 +250,7 @@ db_transaction {
insert into survsimp_question_responses (response_id, question_id, boolean_answer)
values (:response_id, :question_id, :response_value)"
}
"number"
{}
"integer"
{
"number"
-
"integer"
{
if
{
[
empty_string_p
$response
_value
]
}
{
set response_value
[
db_null
]
}
...
...
@@ -375,17 +375,11 @@ db_transaction {
#
# Survey type-specific stuff
#
set
type
[
db_string get_type
"select type from survsimp_surveys where survey_id = :survey_id"
]
switch
$type
{
"general"
{
set survey_name
[
db_string survsimp_name_from_id
"select name from survsimp_surveys where survey_id = :survey_id"
]
db_release_unused_handles
if
{[
info
exists return_url
]
&& !
[
empty_string_p
$return
_url
]}
{
ad_returnredirect
"
$return
_url"
ad_script_abort
...
...
@@ -395,7 +389,6 @@ switch $type {
}
"scored"
{
db_foreach get_score
"select variable_name, sum(score) as sum_of_scores
from survsimp_choice_scores, survsimp_question_responses, survsimp_variables
where survsimp_choice_scores.choice_id = survsimp_question_responses.choice_id
...
...
@@ -409,7 +402,6 @@ switch $type {
where survsimp_logic.logic_id = survsimp_logic_surveys_map.logic_id
and survey_id = :survey_id"
]
if
{[
info
exists return_url
]
&& !
[
empty_string_p
$return
_url
]}
{
db_release_unused_handles
ad_returnredirect
$return
_url
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment