Welcome to the LimeSurvey Community Forum

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

creating a table using javascript and the options are based previous answer

  • qiangqi
  • qiangqi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 6 months ago #232557 by qiangqi
Hi Joffm,

I copied the command of no.question and no.bottom in my survey, but it doesn't work. besides, the choice button in the second part also don't appear. I don't know why these problems occur.  You could see them in the .lss file in attachment. 

for the question of "re-select mode", actually, the parcel 1 could only be choose when you choose mode of yellow column and parcel 2 for blue column. so, I think the options should be 4, No, take package 1 and keep chosen mode, take package 1 and re-select mode, take package 2 and re-select mode. when one of the last two is chosen, a new question choosing modes would appear.

Best wishes,
Qiang

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago - 1 year 6 months ago #232558 by Joffm
You did no add these css classes to the questions in "css classes".
Did you read the manual? At least "question types" and "ExpressionScript"
[url] manual.limesurvey.org/Question_type_-_Ar...lass_.28css_class.29 [/url]

And , obviously, you can't use "no-question", because than you would hide everything as you placed the table into the question text.
So "no-bottom" in the first array

If you want to remove the small white space between the two arrays, use the webdevelopment tool to find the affected classes.

And set the condition of table77 to "!is_empty(that.table55.sq_SQ001)" as you want to display it after a mode in table55 was selected.

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 6 months ago by Joffm.

Please Log in to join the conversation.

  • qiangqi
  • qiangqi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 6 months ago #232571 by qiangqi
Hi Joffm,

I use webdevelopment tool to find the affected classes and I try to delete them, but the result is all contents including the first part are deleted. so, could u tell me how to solve the problem?
<style type="text/css">.question-valid-container{
 display: none;
}
  .text-info{
 display: none;
}
  .col-xs-12  {
 display: none;
}
</style>

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #232583 by Joffm
1. You have to look for the "question-title-container".
Here all your stuff is inserted.
The "question-valid-container" is a container for error messages.

I created two new classes
"padtop0" (padding-top set to "0")
"padbot0" (padding-bottom set to "0")

So "padbot0" in the first question,
"padtop0" in the second question.

Code:
.padtop0 .question-title-container {
    padding-top: 0em;
}
.padtop0 .table {
    margin-bottom: 10px;
}
.padbot0 .question-title-container {
    padding-bottom: 0em;
}
.padbot0 .table {
    margin-bottom: 0px;
}


By the way:
What do you imagine to happen in this question?
First I select "tram"
Then I agree to take a parcel of 4kg, but I want to re-select because I can't carry a parcel of that weight and I am going to do the trip with my bakviets.
But you said "and parcel 2 for blue column".
But now I have "parcel 2 and yellow column".
You have to consider this. I think, the best solution is not to limit this (up to the respondents)

Anyway: Do you really think anybody will change his selected transportmode, only bacause he agrees to deliver a parcel? I do not.

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • qiangqi
  • qiangqi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 6 months ago #232588 by qiangqi
Hi Joffm,

it works! thanks for your help.

from the second part, you could see "detour riding time" and "extra walking time", and the former is just for modes except tram and bus, and latter is for the two modes.so, it is impossible to choose parcel 1 and tram.

besides, if you want to choose a parcel, the extra riding time and cost are different for modes. it is possible that you could earn more money and spend less extra time if you change a mode. but i know it is also possible some persons are lazy to choose another mode when answer the questionnaire. it may be better to show the two parts together and let respondent to choose a mode. But i also want to know whether adding a parcel could have impact for persons choosing a mode compared to normal choice of mode. so, do you have some better advice for this? thanks in advance.

best wishes,
Qiang

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #232590 by Joffm

 if you want to choose a parcel, the extra riding time and cost are different for modes. it is possible that you could earn more money and spend less extra time if you change a mode

There is extra riding time, and extra cost. I really doubt that many people will change their mind for a small benefit.

but i know it is also possible some persons are lazy to choose another mode when answer the questionnaire.

Not only when answering a questionnaire, in real life.

But it doesn't matter.
You will get your results and you will analyse them.

 



 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • qiangqi
  • qiangqi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 6 months ago #232596 by qiangqi
Thanks for your help again!!! Could you share your .lss file to me? the picture of yours looks better than mine. I want to know how to fill the background color for the whole questionnaire, set the width and color for table's lines, and adjust the size of button.

Best wishes,
Qiang

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #232684 by Joffm
Hi,
because this was only a rough prototype the code is a bit messy.

I will improve it and send.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #232686 by Joffm
Here it is.
 

File Attachment:

File Name: limesurvey...6499.lss
File Size:40 KB

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • qiangqi
  • qiangqi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 6 months ago #232693 by qiangqi
Hi Joffm,

Thanks for your time and effort to help me. I don't know when I could solve these problems if I don't get your help. I sincerely hope you and your family could are happiness and healthy. Thanks for your help again!!!

Best wishes,
Qiang

Please Log in to join the conversation.

  • qiangqi
  • qiangqi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 6 months ago #232803 by qiangqi
Hi Joffm,

for the file you send to me, I find a problem that the width of each column could not be defined. so, the result is that first part and second part could be corresponded, as shown the picture. for solving the problem, I try to define the width for different columns in command, as shown the picture, but in fact, it doesn't work. so, I want to know if you have some method to deal with the problem. Thanks.

Best,
Qiang
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 6 months ago #232804 by Joffm
1. Of course I resized the images to the same width
As only the first column is set to a fixed width, the rest will distribute evenly.
I do not see any images in your screenshot.

2. You added more columns than you showed before.

So as this is not really LimeSurvey related, only HTML and css, the final layout is up to you.
Now you know how it works.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose