Search code examples
phphtmlcsslimesurvey

LimeSurvey issues with QID changing when copying Survey


Does anyone know a way to keep the QID from changing when copying a Survey in LimeSurvey. I'm copying surveys from a development server to a production server and have edited the template css to do many specific things. For instance, I have custom CSS for the specific question ID (QID) to not display certain numbers or title in that particular question.

When I transfer the survey to the production server, the QIDs change and my custom CSS doesn't apply to the same contents of the survey. Does anyone know a way to completely transfer all the original information from one survey to another? If not, does anyone know an alternate method of custom CSS that will work universally between copied surveys?

Here's an example:

#slider-844755X43X297SQ001 .slider_callout {
display: none;}
#question87_warning {display:none}

When I copy the survey over, the question might show up as #question155 instead of #question87. Any help here would be greatly appreciated.


Solution

  • There is no avoiding the QID being changed on import. It is a sequential number so depends on how many questions have already been created on the new server.

    I suggest using JavaScript to apply a class to the question and then target that class from template.css.

    So, something like this in the HTML source of the question:

    <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID}).addClass(with-no-callout); }); </script>

    And then something like this in template.css:

    .with-no-callout .slider_callout { display: none; }