Anonymous Login
2016-10-24 08:51 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
04927User patchesSurvey at runtimepublic2012-06-21 13:23
Assigned Tomdekker 
Product Version1.90 
Target VersionFixed in Version1.91 
Summary04927: added SurveyGroupQuestion identifier as a variable for use in questions
Descriptionsometimes people use javascript in the question text field to do special things with a question. It is often necessary in this js to reference the input field element of the question, which has an html id in the format of AnswerSxGxQ. Instead of hard-coding the SxGxQ every time, this patch lets users simply use the template replacement marker of "{SGQ}" (without quotes) which will later get replaced with the actual SxGxQ before rendering in the survey.
Steps To ReproduceOnly four lines were added to the code in four separate files:

group.php (for displaying group by group surveys)

question.php (for displaying question by question surveys)

survey.php (for displaying all-in-one surveys)

common_functions.php (handles the actual replacement of text)
Additional InformationThis was based on the install files for 1.9.1 RC3 Build 9642. Nothing else was altered except for the files/lines mentioned in "Steps To Reproduce"

Available at:
TagsNo tags attached.
Complete LimeSurvey version number (& build)9642
Attached Files
  • patch file icon diff.patch (1,333 bytes) 2011-02-04 17:35 -
    Common subdirectories: limesurvey_9742/admin and limesurvey-timbee/admin
    Common subdirectories: limesurvey_9742/classes and limesurvey-timbee/classes
    diff limesurvey_9742/common_functions.php limesurvey-timbee/common_functions.php
    >     if (strpos($line, "{SGQ}") !== false) $line=str_replace("{SGQ}", $question['sgq'], $line);
    Common subdirectories: limesurvey_9742/docs and limesurvey-timbee/docs
    Common subdirectories: limesurvey_9742/fonts and limesurvey-timbee/fonts
    diff limesurvey_9742/group.php limesurvey-timbee/group.php
    >         $question['sgq']=$qa[7];
    Common subdirectories: limesurvey_9742/images and limesurvey-timbee/images
    Common subdirectories: limesurvey_9742/locale and limesurvey-timbee/locale
    diff limesurvey_9742/question.php limesurvey-timbee/question.php
    >             $question['sgq']=$qa[7];
    Common subdirectories: limesurvey_9742/scripts and limesurvey-timbee/scripts
    diff limesurvey_9742/survey.php limesurvey-timbee/survey.php
    >                 $question['sgq']=$qa[7];
    Common subdirectories: limesurvey_9742/.svn and limesurvey-timbee/.svn
    Common subdirectories: limesurvey_9742/templates and limesurvey-timbee/templates
    Common subdirectories: limesurvey_9742/tmp and limesurvey-timbee/tmp
    Common subdirectories: limesurvey_9742/upload and limesurvey-timbee/upload
    patch file icon diff.patch (1,333 bytes) 2011-02-04 17:35 +




timbee (reporter)

Okay, I built a patch based on the latest SVN source (9742),
attached a a file here...


DenisChenu (developer)

Thanks !

Not for 1.90, but maybe for 1.91 or 1.92.


timbee (reporter)

groovy, thanks :)


Mazi (developer)

Menno, can you review the patch?


mdekker (developer)

Sure no problem


mdekker (developer)

Committed in svn 9755
Could you please add the documentation to our wiki?

perhaps with a link in the relevant work-around sections with the javascript?

-Issue History
Date Modified Username Field Change
2011-02-03 17:31 timbee New Issue
2011-02-04 17:34 timbee Note Added: 14053
2011-02-04 17:35 timbee File Added: diff.patch
2011-02-05 10:56 DenisChenu Note Added: 14054
2011-02-06 01:51 timbee Note Added: 14056
2011-02-08 20:57 Mazi Assigned To => mdekker
2011-02-08 20:57 Mazi Status new => assigned
2011-02-08 20:57 Mazi Note Added: 14091
2011-02-09 19:59 mdekker Note Added: 14119
2011-02-09 20:38 mdekker Note Added: 14120
2011-02-09 20:38 mdekker Status assigned => resolved
2011-02-09 20:38 mdekker Fixed in Version => 1.91
2011-02-09 20:38 mdekker Resolution open => fixed
2012-06-21 13:23 c_schmitz Status resolved => closed
+Issue History