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

More
3 years 1 week ago #213354 by Santoke5
Replied by Santoke5 on topic How to best start coding my own questions
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.
  • Omti90
  • Omti90's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago #215084 by Omti90
Replied by Omti90 on topic How to best start coding my own questions
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.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #215133 by tpartner
Replied by tpartner on topic How to best start coding my own questions
I asked for a link to a live survey so I could see the source.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Omti90
  • Omti90's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago - 2 years 11 months ago #215326 by Omti90
Replied by Omti90 on topic How to best start coding my own questions
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: 2 years 11 months ago by Omti90.
The topic has been locked.
  • Omti90
  • Omti90's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 11 months ago #215392 by Omti90
Replied by Omti90 on topic How to best start coding my own questions
So with the cacheing issue overcome I've made some rapid progress.

[img


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.
Code:
if ($(this).hasClass('items-end')) {
                    //Get class with column label and get columnLabel
                    //if( $(this).items-end-wrapper.colLabel== columnName)
                    // { do stuff }
 
                    $(newDraggable).addClass('moved');
                }
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).
Code:
<div class ="colLabel">
                        {{ind}}
                    </div>

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