I did manage to understand how the checkbox and radio buttons work.. Yes I understand your position, but you must understand also mine.
A tool which has such potential, yet simple stuff are missing. I understand that they are to be built in time and I respect that. Besides its not like I asked anyone to research for me or code for me, simply an off-the-hand opinion, if not, then its ok I managed to get this far on my own, why not a little further. Its why I dont submit new issues/features anymore as well. I am doing this for myself and If I believe one can gain from it, I will post my idea here. Besides this is how one discovers new features to add, research.
For those interested, apparently the answers which are selected in radio button of checkbox simply just exist with the NULL value in the VoterAnswers table and the corresponding VoterID. If an answer is not selected, then it doesn't exist at all.
EDIT:
For those interested:
I managed to get close to finding a solution where a user can filter the data exported into CSV file through a drop down menu.
What I did was this:
USE [SurveyDB20652]
GO
/****** Object: StoredProcedure [dbo].[vts_spVoterExportCSVData] Script Date: 18/9/2012 2:41:47 μμ ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
/*
Survey changes: copyright (c) 2010, Fryslan Webservices TM (http://survey.codeplex.com)
NSurvey - The web survey and form engine
Copyright (c) 2004, 2005 Thomas Zumbrunn. (http://www.nsurvey.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/// <summary>
/// Return the data needed to export a CSV file
/// </summary>
*/
ALTER PROCEDURE [dbo].[vts_spVoterExportCSVData]
@SurveyID int,
@StartDate datetime,
@EndDate datetime
AS
SELECT SUBSTRING(Q.QuestionText,1,20) as QuestionText,Q.QuestionId,
AnswerID,SelectionModeId,AnswerTypeId,
SUBSTRING(Q.QuestionText,1,20)+'...'+' | '+ AnswerText as ColumnHeader ,
AnswerText,
Q.DisplayOrder QuestionDisplayOrder,
Q.QuestionId,
Q.Alias QuestionAlias,
Q.QuestionIdText QuestionIdText,
A.DisplayOrder AnswerDisplayOrder,
A.AnswerId ,
A.AnswerAlias,Q.ParentQuestionid,
case when q.parentQuestionId is null then null
else (select count(*)+1 from vts_tbquestion q1
where q1.parentquestionid=q.parentquestionid
and q1.questionid<q.questionid
)
end as roworder,
case when q.parentQuestionId is null then null
else (select QuestionText from vts_tbquestion q1
where q1.questionid=q.parentquestionid
)
end as ParentQuestiontext,
case when q.parentQuestionId is null then null
else (select QuestionIdText from vts_tbquestion q1
where q1.questionid=q.parentquestionid
)
end as ParentQuestionIdtext,
case when q.parentQuestionId is null then null
else (select ALIAS from vts_tbquestion q1
where q1.questionid=q.parentquestionid
)
end as ParentQuestionAliastext,
A.AnswerIDText AnswerIdText
FROM vts_tbQuestion Q
INNER JOIN vts_tbAnswer A
ON A.QuestionID = Q.QuestionID
WHERE
SurveyID = @SurveyID
ORDER BY Q.DisplayOrder, Q.QuestionID, A.DisplayOrder
SELECT
V.VoterID,
V.VoteDate,
V.StartDate,
V.IPSource,
V.ContextUserName as username,
(SELECT sum(ScorePoint) FROM vts_tbVoter
INNER JOIN vts_tbVoterAnswers
ON vts_tbVoterAnswers.VoterID = vts_tbVoter.VoterID
INNER JOIN vts_tbAnswer
ON vts_tbAnswer.AnswerID = vts_tbVoterAnswers.AnswerID
WHERE vts_tbVoter.VoterID = V.VoterID) AS Score
FROM vts_tbVoter V
WHERE
V.SurveyID = @SurveyID AND
V.Validated <> 0 AND
DATEDIFF (d,@startDate,V.VoteDate) >= 0 AND DATEDIFF (d,@endDate,V.VoteDate) <= 0 AND
V.VoterID IN (SELECT VoterID FROM vts_tbVoterAnswers WHERE AnswerID='32')
ORDER BY V.VoterID DESC
SELECT
V.VoterID,
VA.AnswerID,
SectionNumber,
VA.AnswerText,
AnswerTypeId,
SelectionModeId,
Q.QuestionId,
A.AnswerText AnswerAnswerText,
A.DisplayOrder AnswerDisplayOrder,
A.AnswerAlias,
A.AnswerIDText AnswerIdAlias
FROM vts_tbVoterAnswers VA
INNER JOIN vts_tbVoter V
ON V.VoterID = VA.VoterID
INNER JOIN vts_tbAnswer A
ON VA.AnswerId=A.AnswerId
INNER JOIN vts_tbQuestion Q
ON A.QuestionId=Q.QuestionId
WHERE
V.SurveyID = @SurveyID AND
V.Validated <> 0 AND
DATEDIFF (d,@startDate,V.VoteDate) >= 0 AND DATEDIFF (d,@endDate,V.VoteDate) <= 0 AND
V.VoterID IN (SELECT VoterID FROM vts_tbVoterAnswers WHERE AnswerID='32')
ORDER BY V.VoterID DESC
I simply added the bold red code in and it simply filters entries that have the AnswerID='32', meaning that they have given a specific answer to a specific question. I tested this thoroughly and it works.
Now what remains is to connect the stored procedure with the respective form field value in the file "ExportData.aspx":
<asp:DropDownList ID="ddlSeed" runat="server">
<asp:ListItem Value=""> All </asp:ListItem>
<asp:ListItem Value="32"> Yes </asp:ListItem>
<asp:ListItem Value="31"> No </asp:ListItem>
</asp:DropDownList>
To do that I imagine I have to add a variable in the stored procedure (for example: @Seed int) which will be assigned the value of the drop down list.
This is where Im stuck. Im trying to figure out how to do it. So far I've found several ways to do it for MSAccess, but not for SQL directly. If anyone knows Id appreciate an input.
Thanks :)