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.
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?