How to best start coding my own questions

5 months 3 weeks ago - 5 months 3 weeks 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: 5 months 3 weeks ago by Omti90.

Please Log in to join the conversation.

5 months 3 weeks ago #215392 by Omti90
So with the cacheing issue overcome I've made some rapid progress.

File Attachment:

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?

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now