- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Class Representative Election
- Candyman
- Topic Author
- Offline
- New Member
Less
More
3 years 3 months ago #211080
by Candyman
Class Representative Election was created by Candyman
Hi to all of you!
I wanted to create a simple survey for a class representative and it's deputy.
A person which has been given an vote for class representative should not be visible for class representative deputy.
I used a "matrix by column" and prayed every pupil would be so kind to vote for two different persons. This has not worked well.
A dropdown with names A .... Z and a second dropdown with A .. Z without name e.g. M, which has been voted for class representative was a second thought.
I'm very new to limesurvey and I need a litte bit of input. Reading the manual has not enlighted me. I use Version 3.22.27+200720.
Any kind of help is appreciated. Thanks in advance!
Candyman
I wanted to create a simple survey for a class representative and it's deputy.
A person which has been given an vote for class representative should not be visible for class representative deputy.
I used a "matrix by column" and prayed every pupil would be so kind to vote for two different persons. This has not worked well.
A dropdown with names A .... Z and a second dropdown with A .. Z without name e.g. M, which has been voted for class representative was a second thought.
I'm very new to limesurvey and I need a litte bit of input. Reading the manual has not enlighted me. I use Version 3.22.27+200720.
Any kind of help is appreciated. Thanks in advance!
Candyman
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10116
- Thank you received: 3597
3 years 3 months ago #211096
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Class Representative Election
Use an array-by-column with this sub-question validation:
Sample survey attached:
Code:
(!is_empty(self.sq_SQ001) AND !is_empty(self.sq_SQ002)) AND (self.sq_SQ001 != self.sq_SQ002)
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13004
- Thank you received: 4001
3 years 3 months ago - 3 years 3 months ago #211105
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Class Representative Election
Well,
here are some ideas beyond tpartner's solution which is the easiest.
Of course, both are his creations as well.
First you may consider a maxdiff approach
Or you could think of something like a cardsort
Joffm
here are some ideas beyond tpartner's solution which is the easiest.
Of course, both are his creations as well.
First you may consider a maxdiff approach
Or you could think of something like a cardsort
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 3 months ago by Joffm.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13682
- Thank you received: 2497
3 years 3 months ago #211110
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Class Representative Election
Max-diff are a QuestionTheme ?
github.com/tpartner?tab=repositories
github.com/tpartner?tab=repositories
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13004
- Thank you received: 4001
3 years 3 months ago #211117
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Class Representative Election
No, it's a javascript and css solution.
Joffm
Code:
<script type="text/javascript" charset="utf-8"> function maxDiff(qID, randomize) { // Identify some elements var thisQuestion = $('#question'+qID); var thisTable = $('table.subquestion-list:eq(0)', thisQuestion); // Assign a new question class $(thisQuestion).addClass('max-diff-array'); // Move the columns $('thead tr:eq(0)', thisTable).prepend($('thead tr:eq(0) th:eq(1)', thisTable)); $('tr.answers-list', thisTable).each(function(i){ $('td.answer-item:eq(0)', this).prependTo(this); }); // Random rows if(randomize) { var rowsArr = []; $('tr.answers-list', thisTable).each(function(i){ $(this).attr('data-index', i); rowsArr.push(i); }); shuffleArray(rowsArr); $(rowsArr).each(function(i){ $('tbody', thisTable).append($('tr[data-index="'+this+'"]', thisTable)); }); } // Prevent clicking twice in the same row $('input[type="radio"]', thisQuestion).on('click', function () { $('input[type="radio"]', thisQuestion).prop('disabled', false); $('input[type="radio"]:checked', thisQuestion).each(function(i) { var thisRow = $(this).closest('tr.answers-list'); $('input[type="radio"]', thisRow).not(this).prop('disabled', true); }); }); // Fix up the row classes var rowClass = 1; $('tr.answers-list', thisTable).each(function(i) { $(this).addClass('array'+(2-(i%2))); }); } function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } $(document).ready(function(){ // Call the maxDiff() function // Set the second parameter to true for randomized rows maxDiff({QID}, true); }); </script>
Code:
<style type="text/css">.ls-answers tbody .answertext { text-align: center; } </style>
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10116
- Thank you received: 3597
3 years 3 months ago #211120
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Class Representative Election
I suppose it could be.Max-diff are a QuestionTheme ?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- Candyman
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
3 years 3 months ago #211130
by Candyman
Replied by Candyman on topic Class Representative Election
Thanks for your quick response!
I've imported the lss and modified it to my requests.
With a little help ... everything is gettin' better.
I've imported the lss and modified it to my requests.
With a little help ... everything is gettin' better.
The topic has been locked.
- Candyman
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
3 years 3 months ago #211132
by Candyman
Replied by Candyman on topic Class Representative Election
Wow!
I'll take the first suggestion but I show respect for your solution.
I'm lucky understanding the first one, changing the language with another post in this forum made by you.
Thanks a million!
I'll take the first suggestion but I show respect for your solution.
I'm lucky understanding the first one, changing the language with another post in this forum made by you.
Thanks a million!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13682
- Thank you received: 2497
3 years 3 months ago #211149
by DenisChenu
For the complete system : great to all Expression by QuestionTheme
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Class Representative Election
Yes, surely and directly with HTMLtpartner wrote:
I suppose it could be.Max-diff are a QuestionTheme ?
For the complete system : great to all Expression by QuestionTheme
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10116
- Thank you received: 3597
3 years 3 months ago #211157
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Class Representative Election
I'm pretty sure it would need some JS, for example, to disable the options when a corresponding option in the other column is selected.es, surely and directly with HTML
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13682
- Thank you received: 2497
3 years 3 months ago #211178
by DenisChenu
About js : i always think it must be ther to help, but never think it can be disabled (more and more user use nojs extension for example).
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Class Representative Election
Yes but the right/left part are better in HTMLtpartner wrote: I'm pretty sure it would need some JS, for example, to disable the options when a corresponding option in the other column is selected.
About js : i always think it must be ther to help, but never think it can be disabled (more and more user use nojs extension for example).
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.