Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to best start coding my own questions

2 years 1 week ago #213354 by Santoke5
Yeah, that's a very good question. It will be much helpful if the OP shares the link here. So that all of them members can visit and leave helpful replies. 
The topic has been locked.
1 year 11 months ago #215084 by Omti90
Sorry that turned out rather more difficult than I thought it might be. Is there some how to guide I missed?
Anyway, now that I've got some time to have a look at this again. I'm rather glad I started early... I've uploaded what I've done so far if someone wants to have a look: mega.nz/file/VpBXBapK#9c5Lphxa43pSl1y2oz...AHTga0pzL_rTRJKhnLW0

That said, I'm not sure if the .css file is affecting what's being shown at all. Since even changing stuff in working styles doesn't seem to affect what's shown in limesurvey. If I change the coloration of the answers, there's no effect.

If I literally delete the entire file and save, there's no effect. I'm honestly baffled why that is. I deleted the entire cache of my secondary browser thrice, trying this in different configurations without any effect.

It's almost like it's saved the cardsort.css once in my databank and is using that backup, rather than getting it from the upload folder. Could that have happened? Do I need to force reupload this somehow?
The topic has been locked.
1 year 11 months ago #215133 by tpartner
I asked for a link to a live survey so I could see the source.

Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
1 year 11 months ago - 1 year 11 months ago #215326 by Omti90
Someone on the discord told me a solution. Apparently something was cached somewhere (but not in the browser), which prevented it from using the new version.

You can solve that by altering the config.php in limesurvey/application/config/config.php. You need to set debug = 2 (or in my case debug=>2). That apparently makes it reloaded cached data. This worked for me.
Last edit: 1 year 11 months ago by Omti90.
The topic has been locked.
1 year 10 months ago #215392 by Omti90
So with the cacheing issue overcome I've made some rapid progress.


This basically works, but is kinda ugly and requires survey users not to be idiots. So yeah suboptimal. But that's as far as I can get with twig and css, I think.

As the next step I want to just have one answer that replicates column number times. And I also want to check if the answer was already given in the column, in which case I want to remove the previous answer (or just reject the new one depending what works better).

So I need to get started with the java script. I've just got two issues there. I need to read the colum names out of either the twig or from the server (and I have no clue how to access either).

And I need to see on which class (items-end-wrapper) - identifiable by its column label - the answer got dropped. I figured for this I'll just need to check if the column label was already used for the variable/answer.
if ($(this).hasClass('items-end')) {
                    //Get class with column label and get columnLabel
                    //if( $(this).items-end-wrapper.colLabel== columnName)
                    // { do stuff }
Sorry if I horribly mangled java syntax here. I'm only really familiar with C#, so no clue if this is possible at all or what steps are required to make it happen. For example: I think the colLabel class I'm defining in my twig that contains my colum labels, doesn't actually hold them but is just printing them ("ind" is the label here).
<div class ="colLabel">

So do I need to define some seperate java class for this, is this twig enough so I can access the information from the js, or can I make the "ind" information otherwise readable from the js?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose