2
Vote

Cannot clear survey results with 1 Vote/Reg user

description

If I have 1 vote/registered user selected, and I use the Clear Results Data function (Clear)... it clears the results in the survey, but the user cannot vote again on the cleared survey.

Sometimes we like to change 1 question; or test the survey module... then the "test" user cannot vote.

SUMMARY: If the survey results are cleared, the user voting history should also be cleared.

comments

goombamd wrote Jul 25, 2013 at 3:36 PM

Following advice on the FORUM, this code below worked when used in combination with the Clear Results Data. 468 correlates with ModuleID. I believe it should also work if you remove the UserID=3 and clear all results.



update Profile

set ProfileData = replace(convert(varchar(8000),ProfileData),'<item key="468:Voted" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"><boolean>true</boolean></item>','')

where PortalId=0 and UserID=3 and ProfileData like '%468:Voted%true%'

go

select * from SurveyOptions
update SurveyOptions
set Votes = (select count(*) from SurveyResults where SurveyOptions.SurveyOptionID = SurveyResults.SurveyOptionID)

wrote Jan 5, 2014 at 10:55 PM