Welcome to the LimeSurvey Community Forum

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

Custom question attributes?

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120108 by tpartner
Replied by tpartner on topic Custom question attributes?
Why do you need the sum in a third input? You can use Expression Manager to pipe the sum into text.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 10 months ago #120113 by garvsaxena
Replied by garvsaxena on topic Custom question attributes?
Ok got it..! I think this should solve my problem. But suppose I have a question with the ID = GE-1, and has options SQ001, SQ002, SQ003 and SQ004. Now we have to do that show the sum of SQ001 + SQ002 + SQ003 will display in the SQ004.

Please guide me the Expression and Relevance equation for the thing I want to achieve.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120123 by tpartner
Replied by tpartner on topic Custom question attributes?
I don't think you can easily do that with Expression manager but you could do it with a little script. Add this to the question source.

Code:
<script type="text/javascript" charset="utf-8">  
  $(document).ready(function() {
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Add some classes
    $('input.text', thisQuestion).addClass('active-item');
    $('input.text:last', thisQuestion).removeClass('active-item').addClass('total-item');
 
    // Disable the last input
    $('.total-item', thisQuestion).prop('readonly', true);
 
    // Listener on the inputs
    $('.active-item', thisQuestion).on('keyup change paste', function() {
      setTimeout(function() { // Pause required for paste
        // Calculate and insert the total
        var total = 0;
        $('.active-item', thisQuestion).each(function(i) {
          total = total + Number($(this).val());
        });
        $('.total-item', thisQuestion).val(total);
      }, 100);
    });
  });
</script>

File Attachment:

File Name: limesurvey...5914.lss
File Size:16 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 10 months ago #120130 by garvsaxena
Replied by garvsaxena on topic Custom question attributes?
Ok thanx for your support..!

but Please guide me where and in which file I have to paste this script which you have send me..!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120132 by tpartner
Replied by tpartner on topic Custom question attributes?
Did you look at the attached sample survey? The script is in the question source.

Please refer to the manual - manual.limesurvey.org/Workarounds:_Manip....29_in_LimeSurvey.3F


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 10 months ago #120408 by garvsaxena
Replied by garvsaxena on topic Custom question attributes?
Hey thanks for your support.

I have one more issue that according to my clients need we need a custom question type which include listbox(drop down list) followed by a text field. and many more type of question. So can you please suggest me that from where and how can we create a new question type. Please help me out its very urgent!!!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120423 by tpartner
Replied by tpartner on topic Custom question attributes?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 10 months ago #120428 by garvsaxena
Replied by garvsaxena on topic Custom question attributes?
if we want to edit in the Question Index section, then how can I do this
The topic has been locked.
More
8 years 10 months ago #120510 by garvsaxena
Replied by garvsaxena on topic Custom question attributes?
Hey Fresh Lemon..how r u?
Actually I have a question regarding lime survey. I have to edit in the Question Index section and could not find the template file regarding this, can you please tell me that which file is responsible for Question Index Section on the Survey Question Page.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 10 months ago #120524 by tpartner
Replied by tpartner on topic Custom question attributes?
What changes do you want to make? There is no .pstpl file for the index. Associated styles can be found in template.css.

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: garvsaxena
The topic has been locked.
More
8 years 10 months ago #120528 by garvsaxena
Replied by garvsaxena on topic Custom question attributes?
Thanx a lot for replying..!

Actually I want to make this Question Index as DropDown Menu on the top of the survey page, currently it is displaying on the right.
The topic has been locked.
More
8 years 10 months ago #120529 by garvsaxena
Replied by garvsaxena on topic Custom question attributes?
Thanks for your reply first..!

Actually I want to make Question Index like DropDown Menu on the top of the survey, currently this is displaying on the right side of the survey page.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose