Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: multiple)

  • MaBo97
  • MaBo97's Avatar
08 Aug 2023 14:37
Replied by MaBo97 on topic Extra Javascript not working on IOS devices
Dear Tony,

thank you for your reply! :) Unfortunately I can't give you a link to the code I changed because it's been some time since I initially created it. Actually the final result in the survey might be a mash of multiple code pieces. I've been trying around until it worked. As I said I'm not a programmer and my ability to read code is limited.

I have attached an lss of the minimal survey which only contains the first three questions. There is also code in the second question, which is also not working and it's very close to the code I posted above. I have also checked whether the problem is still present in the minimal example and it is. It's working on Android and Windows / Linux computers.

I hope we can find a solution.

Thank you again!
David

File Attachment:

File Name: limesurvey...imal.lss
File Size:118 KB
  • MaBo97
  • MaBo97's Avatar
07 Aug 2023 16:55 - 07 Aug 2023 16:56
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.6.31
Own server or LimeSurvey hosting: LimeSurvey Cloud
Survey theme/template: own / based on fruity
==================
Hey there,

I'm a a very happy LimeSurvey user and am using it for my company. I have a question regarding javascript. We are offering education and evaluate our courses using limesurvey. The courses are organized in diffent fields which are taught by various teachers and each individual course deals with a specific topic. At the beginning we have a series of dropdown questions that are supposed to be "cascaded". What we wanted to implement, and it's working on android already, is that if you select a field, only the teachers and topics of that field should be displayed in the drop down questions.

As there are changes in our staff and the course topics from time to time we wanted to implement the cascading with javascript. I know it could also be done natively with multiple "paths" through the questionaire, but this would mean to create a LOT of questions each time a change is happening. This is unfeasible using the gui (maybe it could be done quickly by editing the text of the import-export file). Javascript can be changed easily without taking the down the survey and i have already written some helper scripts to make it even easier. However, here's the problem:

The javascript code is working nicely on android devices and computer, but it doesn't work on IOS devices (so far we only tested mobile devices). I have no idea what might be behind this. I thought it's something like javascript disabled by default, but my IOS friends tell me that can you any website without a problem. Do you have any ideas how to fix this?

I'm not a programmer so the problem might be in the code, although I think it's not very complicated. I changed a code snippet by TPartner I found online (therefore the reference). This is what we are using right now (the "code" formatting didn't show a preview, so i used a blockquote instead) inside the "topic" question:

<span style="font-size:18px;">Kursbezeichnung:</span> <script type="text/javascript" data-author="Tony Partner">
    $(document).on('ready pjax:scriptcomplete', function() {
          var thisQuestion = $('#question{QID}');
                var secondContainer = thisQuestion.prevAll('.question-container').eq(1);
        
        // Define the excluded options
var excludes = {
    'A1': , // Bau
    'A2': , // Elektro
    'A3': , // Metall
    'A4': , // Sanitär-, Heizung-, Klimatechnik
    'A5': , // Holz
    'A6': , // Farbe und Gestaltung
    'A7': , // Fahrzeuge
    'A8': , // Friseur und Kosmetik
    'A9': , // Büro und Verwaltung
};

          $('.answer-item select', secondContainer).on('change', function(i) {
            // Reset the dropdown
            $('select.form-control', thisQuestion).val('').trigger('change');
            $('select.form-control option', thisQuestion).show();
            
            // Get the value of the previous question
            var selectedValue = $(this).val();
            
            // Hide answer options based on selectedValue
            $.each(excludes[selectedValue], function(i, val) {
                $('select.form-control option', thisQuestion).filter(function() {
                    return $(this).val() === val;
                }).hide();
            });
        });
    });
</script>


As i said I have another script which helps me generate the contents of "excludes".

Why is this not working on IOS devices?? How can I make work? Is there a maintainable alternative approach?

Thank you very much! Limesurvey is fantastic!

David
  • KaderKeb
  • KaderKeb's Avatar
03 Aug 2023 13:35
Replied by KaderKeb on topic Questions avec condition multiple
Merci encore pour le conseil je ne connaissais pas encore cette fonctionnalité, mais très précieuse. Je comprends mieux votre question du début de message.
  • Joffm
  • Joffm's Avatar
03 Aug 2023 12:29 - 03 Aug 2023 12:30
Replied by Joffm on topic Questions avec condition multiple
Bonjour
Pourquoi n'avez-vous pas répondu aux questions au début ?

comment je peux faire pour  terminer le questionnaire après le choix d'un des 4 choix du 3ème groupe .?

Utiliser les quotas

 




 
  • rockyist
  • rockyist's Avatar
03 Aug 2023 09:43
Hello Joffm, 

Thanks for your reminder. I will update my assignment and remove the relevance equations in the Irrelevant question. And I'm looking forward to your reply for my last question posted yesterday afternoon.

Best,

 
  • KaderKeb
  • KaderKeb's Avatar
03 Aug 2023 09:10
Replied by KaderKeb on topic Questions avec condition multiple
Pas d'idée pour m'orienter ? ou ne suis je pas assez clair ?
  • Joffm
  • Joffm's Avatar
02 Aug 2023 17:11
Why do you insert a subquestion relevance in "IrrelavantCopy" if you set the values by the equation?
 
Remove it

And change the assignment to
{IrrelavantCopy_SQ1=if(WalkingAbilityCopy=="Y","Y","")}
{IrrelavantCopy_SQ2=if(CycleAbilityCopy=="N","Y","")}


 
  • rockyist
  • rockyist's Avatar
02 Aug 2023 17:11
Hello Joffm, 

In your case, I hope the displayed modes are: Bus, Tram, Train and Metro. I don't want the hidden mode (shared scooter, shared car as a driver) to appear here. 
For the last screenshot, I hope the displayed travel modes are: shared bike, shared e-bike, shared car as a passenger, shared scooter and shared car as driver (the last two are the hidden mode in Irrelevant Question)

Best
  • Joffm
  • Joffm's Avatar
02 Aug 2023 16:50 - 02 Aug 2023 16:51
Wlthout driver license I see this in the survey I sent
 
and with this selection this.
 
What do you want to be displayed in this case?
And don't forget, "shared car (as a passenger)" is not included in your assignment. With intention? 

Joffm

 
  • rockyist
  • rockyist's Avatar
02 Aug 2023 16:22
Hello Joffm, 

Thank you for your reply. I deleted the condition of the CycleAbility question and now make it work in the Irrelevant Question. 

But another problem was raised. Shared scooter and shared car as a driver will not be displayed in the Irrelevant question if I choose no driver license. But these two options will leak to the preference question. The array filter doesn't work on the hidden subquestion. What should I do if I want to hide shared scooter and shared car as a driver in the preference question?

On the other hand, shared scooter will not be displayed in the NotUsingReason question due to the hide in Irrelevant Question. What should I do if I want to show shared scooter in the NotUsingReason question? [The lss file is attach below]

Luqi
 
  • Joffm
  • Joffm's Avatar
02 Aug 2023 13:08
Hi, there are some initial mistakes.
You see CycleAbility is only asked if I answered "Frequency (bike) with "Never"
But CycleAbility is a condition to show "bike, etc. in "Irrelevant"
There were some variables that were not defined (ín your provided part of the survey)
And you used "Irrelevant" as "array filter" though it is a question of type "array"

But as far as I understand your logic it should be like this
 

File Attachment:

File Name: limesurvey...8621.lss
File Size:244 KB


Joffm

how will LimeSurvey platform identify the priority when there are several conditional operators (and, or). 

This is as we learned it at school. 
[url] manual.limesurvey.org/ExpressionScript_-...ntation/en#Operators [/url]

 
  • rockyist
  • rockyist's Avatar
02 Aug 2023 11:19
Your LimeSurvey version: Version 5.6.14+230403
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hello guys, 

Recently, I've been using multiple question answers to filter the following sub-questions. My idea is explained below:

I will first ask about individual capabilities, e.g., Walking ability, cycle ability, vehicle ownership and driver's license. The travel mode will only be displayed in the Irrelevant Question if the following conditions are met:
  • Walking (if the respondents choose "no" in the WalkingAbility Question)
  • Private bike (if the respondents choose ("yes" in the CycleAbility Question AND bike/e-bike in the vehicle ownership question). However, the CycleAbility question is also displayed conditionally. If the respondent chooses "Never" for both bike and shared bike in the frequency question, we will ask whether they can cycle or not. So we should also take into account the case when CycleAbility is hidden. The same for shared bikes and shared e-bikes.)
  • Shared bike (if the respondents choose "yes" in the CycleAbility Question)
  • Shared E-bike (if the respondents choose "yes" in the CycleAbility Question)
  • Private scooter (if the respondents choose ("yes" in the CycleAbility Question AND "SQ01"/"SQ02" in the DriverLicense Question AND "SQ005" in the VehicleOwnership Question))
  • Shared scooter (if the respondents choose ("yes" in the CycleAbility Question AND "SQ01"/"SQ02" in the DriverLicense Question))
  • Private car as driver (if the respondents choose "SQ01" in the DriverLicense Question AND "SQ004" in the VehicleOwnership Question)
  • Shared car as driver (if the respondents choose "SQ01" in the DriverLicense Question
Then the travel modes that are not chosen by respondents in the Irrelevant Question will be displayed in the next Preference Question. 
And ReasonNotUsing Question will ask about shared modes which are chosen in the Irrelevant Question (implying the respondents will never use these shared modes).
The implementation of consecutive filters and the design of multiple conditions are really difficult for me. And I'll appreciate it if you can help me with this problem and tell me: how will LimeSurvey platform identify the priority when there are several conditional operators (and, or). 

Best,
 
  • KaderKeb
  • KaderKeb's Avatar
02 Aug 2023 09:15
Questions avec condition multiple was created by KaderKeb
Bonjour,
Je suis un nouvel utilisateur LimeSurvey Community Edition, et j'ai créé un formulaire pour recenser les besoins en formation  avec 5 groupes distincts, le 1er relatif à la description du répondant, le 2ème pour le choix de type de formation (2choix), le 3ème  pour le premier type de formation (4 choix), le 4ème pour le second type de formation  et le 5ème pour développer le 4ème choix du 3ème groupe.

J'essaye de comprendre la logique conditionnelle et j'avoue que je sèche un peu.
Pour la condition pour aller du 2ème groupe au 3ème ou 4 ème groupe ça fonctionne. Par contre je ne comprends pas comment je peux faire pour  terminer le questionnaire après le choix d'un des 4 choix du 3ème groupe .?

J'ai joint le fichier lss de mon questionnaire pour essayer d'être le plus claire possible. Quelqu'un peut-il me conseiller ?
  • Joffm
  • Joffm's Avatar
28 Jul 2023 22:22
Hi,
sorry but what for do you ask the first question?
There are only 10 items. So why filter them?
I do not see any necessity at all, because there is no difference if I select 4 or 5 modes before or I select them directly in the second question.
Here some ideas from former threads about trips and stages




Joffm

 
  • yvp_test
  • yvp_test's Avatar
28 Jul 2023 20:08
Oh, sorry about the survey file, that was an accident.

Regarding the similar surveys you mentioned: could you give me a hint where to find them? My research wasn't successful.
Displaying 646 - 660 out of 761 results.

Lime-years ahead

Online-surveys for every purse and purpose