View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
04143Bug reportsOtherpublic2010-05-05 10:28
Reporterelameno Assigned Torakete  
PrioritynormalSeverityblock 
Status closedResolutionfixed 
Product Version1.87+ 
Fixed in Version1.90b 
Summary04143: Multi-page surveys are not able to be finished (results are lost) when activated using LSRC sActivateSurvey call.
Description

When running Lime 1.87+ from revision 8408 in the stable branch any multi-page survey (and perhaps any survey at all) that is activated using the Lime Survey Remote Control will bomb when clicking on the "Next" button.

The problem looks to be a missing column in the survey table that is set up. I'll submit a patch that looks like it updates the lsrc.helper.php to work properly.

TagsNo tags attached.
Attached Files
sActivateSurvey_fix.diff (2,697 bytes)   
Index: admin/remotecontrol/lsrc.helper.php
===================================================================
--- admin/remotecontrol/lsrc.helper.php	(revision 8408)
+++ admin/remotecontrol/lsrc.helper.php	(working copy)
@@ -2052,7 +2052,7 @@
 	}
 
 	/**
-	 * function to activate surveys based on new activate.php 5771 2008-10-13 02:28:40Z jcleeland $
+	 * function to activate surveys based on activate.php 8089 2009-12-06 22:03:44Z c_schmitz $
 	 *
 	 * @param unknown_type $surveyid
 	 * @return boolean
@@ -2335,6 +2335,7 @@
 			//Create the survey responses table
 			$createsurvey = "id I NOTNULL AUTO PRIMARY,\n";
 			$createsurvey .= " submitdate T,\n";
+			$createsurvey .= " lastpage I,\n";
 			$createsurvey .= " startlanguage C(20) NOTNULL ,\n";
 			//Check for any additional fields for this survey and create necessary fields (token and datestamp)
 			$pquery = "SELECT private, allowregister, datestamp, ipaddr, refurl FROM {$dbprefix}surveys WHERE sid={$surveyid}";
@@ -2371,7 +2372,7 @@
 			." AND ".db_table_name('questions').".sid={$surveyid} "
 			." AND ".db_table_name('groups').".language='".GetbaseLanguageFromSurveyid($surveyid). "' "
 			." AND ".db_table_name('questions').".language='".GetbaseLanguageFromSurveyid($surveyid). "' "
-			." ORDER BY ".db_table_name('groups').".group_order, title";
+			." ORDER BY group_order, question_order";
 			$aresult = db_execute_assoc($aquery);
 			while ($arow=$aresult->FetchRow()) //With each question, create the appropriate field(s)
 			{
@@ -2449,7 +2450,7 @@
 					}
 					if ((isset($alsoother) && $alsoother=="Y") && ($arow['type']=="M" || $arow['type']=="P"  || $arow['type']=="1")) //Sc: check!
 					{
-						$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}other` C(255),\n";
+						$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}other` X,\n";
 						if ($arow['type']=="P")
 						{
 							$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}othercomment` X,\n";
@@ -2517,7 +2518,7 @@
 					$abresult=db_execute_assoc($abquery) or $this->debugLsrc ("Couldn't get perform answers query$abquery".$connect->ErrorMsg());
 					while ($abrow = $abresult->FetchRow())
 					{
-						$createsurvey .= "  `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}` C(20),\n";
+						$createsurvey .= "  `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}` F,\n";
 					}
 				} //End if ($arow['type'] == "K")
 				/*		elseif ($arow['type'] == "J")
@@ -4332,4 +4333,4 @@
 		}
 		return "".$iCountParticipants."Datasets given, ".$iInsertedParticipants." rows inserted. ";
 	}
-}
\ No newline at end of file
+}
sActivateSurvey_fix.diff (2,697 bytes)   
didnt_activate.csv (5,104 bytes)   
# LimeSurvey Survey Dump
# DBVersion 142
# This is a dumped survey from the LimeSurvey Script
# http://www.limesurvey.org/
# Do not change this header!

#
# SURVEYS TABLE
#
"sid","owner_id","admin","active","expires","startdate","adminemail","private","faxto","format","template","language","additional_languages","datestamp","usecookie","notification","allowregister","allowsave","autonumber_start","autoredirect","allowprev","printanswers","ipaddr","refurl","datecreated","publicstatistics","publicgraphs","listpublic","htmlemail","tokenanswerspersistence","assessments","usecaptcha","usetokens","bounce_email","attributedescriptions","emailresponseto","tokenlength"
"33214","1","David Wolff","N","","","davidwolff@letu.edu","Y","","G","default","en","","N","N","0","N","Y","0","N","Y","N","N","N","2010-02-22","N","N","N","Y","N","N","D","N","davidwolff@letu.edu","","","15"

#
# GROUPS TABLE
#
"gid","sid","group_name","group_order","description","language"
"702","33214","Group 1","0","You will be able to fill out this group of questions, but Lime will crash when you move to the second group and all your responses will be lost.<br />","en"
"703","33214","Group 2","1","You won't be able to get to this group if this survey was activated using LSRC.<br />","en"

#
# QUESTIONS TABLE
#
"qid","sid","gid","type","title","question","preg","help","other","mandatory","lid","lid1","question_order","language"
"9927","33214","702","C","1","Do you feel well today?<br />","","","N","Y","0","0","0","en"
"9928","33214","703","C","2","Were you able to reach this question?<br />","","","N","Y","0","0","0","en"

#
# ANSWERS TABLE
#
"qid","code","answer","default_value","assessment_value","sortorder","language"
"9927","1","","N","0","1","en"
"9928","1","","N","0","1","en"

#
# CONDITIONS TABLE
#

#
# LABELSETS TABLE
#

#
# LABELS TABLE
#

#
# QUESTION_ATTRIBUTES TABLE
#
"qaid","qid","attribute","value"
"85958","9927","answer_width",""
"85959","9927","array_filter",""
"85960","9927","array_filter_exclude",""
"85961","9927","hidden","0"
"85962","9927","page_break","0"
"85963","9927","public_statistics","0"
"85964","9927","random_order","0"
"85965","9927","scale_export","0"
"85966","9928","answer_width",""
"85967","9928","array_filter",""
"85968","9928","array_filter_exclude",""
"85969","9928","hidden","0"
"85970","9928","page_break","0"
"85971","9928","public_statistics","0"
"85972","9928","random_order","0"
"85973","9928","scale_export","0"

#
# ASSESSMENTS TABLE
#

#
# SURVEYS_LANGUAGESETTINGS TABLE
#
"surveyls_survey_id","surveyls_language","surveyls_title","surveyls_description","surveyls_welcometext","surveyls_endtext","surveyls_url","surveyls_urldescription","surveyls_email_invite_subj","surveyls_email_invite","surveyls_email_remind_subj","surveyls_email_remind","surveyls_email_register_subj","surveyls_email_register","surveyls_email_confirm_subj","surveyls_email_confirm","surveyls_dateformat"
"33214","en","Survey Can't Be Finished Bug ","If this survey is activated via the Lime Survey Remote Control it will not be able to be finished.&nbsp; It will crash when moving from the first question group to the second.<br />","Welcome<br />","Thanks<br />","","","Invitation to participate in survey","Dear {FIRSTNAME},<br /><br />You have been invited to participate in a survey.<br /><br />The survey is titled:<br />""{SURVEYNAME}""<br /><br />""{SURVEYDESCRIPTION}""<br /><br />To participate, please click on the link below.<br /><br />Sincerely,<br /><br />{ADMINNAME} ({ADMINEMAIL})<br /><br />----------------------------------------------<br />Click here to do the survey:<br />{SURVEYURL}","Reminder to participate in survey","Dear {FIRSTNAME},<br /><br />Recently we invited you to participate in a survey.<br /><br />We note that you have not yet completed the survey, and wish to remind you that the survey is still available should you wish to take part.<br /><br />The survey is titled:<br />""{SURVEYNAME}""<br /><br />""{SURVEYDESCRIPTION}""<br /><br />To participate, please click on the link below.<br /><br />Sincerely,<br /><br />{ADMINNAME} ({ADMINEMAIL})<br /><br />----------------------------------------------<br />Click here to do the survey:<br />{SURVEYURL}","Survey registration confirmation","Dear {FIRSTNAME},<br /><br />You, or someone using your email address, have registered to participate in an online survey titled {SURVEYNAME}.<br /><br />To complete this survey, click on the following URL:<br /><br />{SURVEYURL}<br /><br />If you have any questions about this survey, or if you did not register to participate and believe this email is in error, please contact {ADMINNAME} at {ADMINEMAIL}.","Confirmation of completed survey","Dear {FIRSTNAME},<br /><br />This email is to confirm that you have completed the survey titled {SURVEYNAME} and your response has been saved. Thank you for participating.<br /><br />If you have any further questions about this email, please contact {ADMINNAME} at {ADMINEMAIL}.<br /><br />Sincerely,<br /><br />{ADMINNAME}","1"

#
# QUOTA TABLE
#

#
# QUOTA_MEMBERS TABLE
#

#
# QUOTA_LANGUAGESETTINGS TABLE
#

didnt_activate.csv (5,104 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)8408
I will donate to the project if issue is resolved
Browser
Database type & versionMySQL 5
Server OS (if known)Windows XP
Webserver software & version (if known)Apache 2.2
PHP Version5.2.10

Users monitoring this issue

elameno

Activities

rakete

rakete

2010-02-22 14:46

reporter   ~11146

I cannot reproduce this always, just with certain surveys created and exported prior 1.86... if I import and export them via the Admin Panel the files seem to be fixed..

elameno

elameno

2010-02-22 17:20

reporter   ~11148

Hmm, well I was putting together a survey that would hopefully reproduce the bug for you when I found another issue. I was running the latest version from the stable branch (svn revision 8423) when I did all of this.

What I did:

  • I created a brand new survey. exported it to CSV, and copied it to the remotecontrol/surveys directory
  • I created a new survey of that type via LSRC
  • I added a participant to the survey via LSRC
  • I attempted to activate the new survey via LSRC.

What happened:

  • The new survey was created
  • The participants were added
  • The begin and end dates I sent to the sActivateSurvey call were added to the survey and the sActivateSurvey response indicated that all went well; however, the survey was not activated.

I'll attach a copy of the CSV file I used.

As a note, after the activate survey call failed with the latest stable branch, I tried using the version that I patched and the activate survey call worked.

Thanks for your help!

rakete

rakete

2010-04-01 20:45

reporter   ~11567

hey there, I applied your patch to the stable branch... Thank you... I hope it's "stable" ;)

Issue History

Date Modified Username Field Change
2010-02-17 17:01 elameno New Issue
2010-02-17 17:01 elameno Status new => assigned
2010-02-17 17:01 elameno Assigned To => rakete
2010-02-17 17:01 elameno File Added: sActivateSurvey_fix.diff
2010-02-17 17:01 elameno LimeSurvey build number => 8408
2010-02-17 17:01 elameno Database & DB-Version => MySQL 5
2010-02-17 17:01 elameno Operating System (Server) => Windows XP
2010-02-17 17:01 elameno Webserver => Apache 2.2
2010-02-17 17:01 elameno PHP Version => 5.2.10
2010-02-22 14:46 rakete Note Added: 11146
2010-02-22 17:20 elameno Note Added: 11148
2010-02-22 17:22 elameno File Added: didnt_activate.csv
2010-02-22 17:46 elameno Issue Monitored: elameno
2010-04-01 20:45 rakete Note Added: 11567
2010-04-01 20:45 rakete Status assigned => resolved
2010-04-01 20:45 rakete Fixed in Version => 1.90b
2010-04-01 20:45 rakete Resolution open => fixed
2010-05-05 10:28 c_schmitz Status resolved => closed
2011-10-20 18:29 c_schmitz Category RemoteControl => (No Category)