Welcome to the LimeSurvey Community Forum

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

Is Limesurvey able to detect the used device?

More
4 years 4 months ago - 4 years 4 months ago #215070 by jelo

I guess that what Denis is working on will be more robust.

Not sure what he is working on. Expanding the plugin.

The typical approach of other survey tools is to provide a function to the logic (e.g IsMoble).
The feature request for LimeSurvey would be to add a ExpressionScript function IsMobile.

Personally I would like to see a more flexible function, since the definition of what a mobile vs. desktop view is, can differ over time.
It's often only about the viewport and screen. A notebook often has a lower resolution than a smartphone. So a function in ExpressionScript with a viewport/screen estate check (e.g Width/Height).

You still have the JavaScriptcode somewhere. Perhaps a flexible approach would be to have a variable screen, where you could define not only URL mapping, but could enter JavaScript or predefined scripts and assign them to a variable.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Last edit: 4 years 4 months ago by jelo.

Please Log in to join the conversation.

More
4 years 4 months ago #215075 by DenisChenu

The typical approach of other survey tools is to provide a function to the logic (e.g IsMoble).
The feature request for LimeSurvey would be to add a ExpressionScript function IsMobile.

 
Possible in 4.X via plugin, not before (sample : github.com/LimeSurvey/LimeSurvey/tree/ma...expressionFixedDbVar )
Before : to have a value in ExpressionManager : you need a question.

Currently : i update Browser + add isMobile and isTablet optionnal question code globally.

I didn't make a question settings for this. Because current one work on 3.X and in 4.X and after : better to have new variables like you say : isMobile etc …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
4 years 4 months ago #215076 by jelo
If anyone wants to dig a bit deeper about mobile screens, a look at
www.mydevice.io/#compare-devices can help.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

More
4 years 4 months ago #215077 by tammo

You still have the JavaScriptcode somewhere. Perhaps a flexible approach would be to have a variable screen, where you could define not only URL mapping, but could enter JavaScript or predefined scripts and assign them to a variable.

Could you please explain what you mean here? I do not understand. Trying hard...

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

More
4 years 4 months ago #215078 by jelo
That is a thought about a feature request.
To prevent further confusion let's wait till you have the "more robust" approach at your fingertips and then compare the different solutions.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

More
4 years 4 months ago #215081 by DenisChenu
It's not mire robust : since there are no real securtity issue : i don't think you need a PHP solution.

But with a PHP solution : you can (i think ) have whole group separation, use variable in 1st page etc …


About a variable for screen size : you mean the real screen size or the current screen size.

And with zoom or without zoom ?

etc etc …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
4 years 4 months ago #215099 by DenisChenu
All done
gitlab.com/SondagesPro/QuestionSettingsType/findUserAgentInfo

(need to create a plugin topic here)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: tpartner

Please Log in to join the conversation.

More
4 years 4 months ago #215143 by tpartner
Nice!

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 6 months ago #225130 by Surveylab_KN
Hi Joffm,

this is a very nice solution to save the information about the device. Unfortunately, I am not able to adapt your adaptions for the multiple short text question (the one with the long free text works fine). I used a multiple short text question, replaced the part of the code and added 3 subquestions. But the text fields are still empty. Do I need to change something else.

I am using Version 5.2.10+220118.

Please Log in to join the conversation.

More
3 years 6 months ago - 3 years 6 months ago #225133 by tammo
See attached the question (wrapped in an English survey), made up using the ideas of Joffm and before him Christian Ludwig (as shown in the Javascript),
 


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 3 years 6 months ago by tammo.
The following user(s) said Thank You: Surveylab_KN

Please Log in to join the conversation.

More
2 years 9 months ago #233855 by Masalas
Can anyone please check whether this is still working for him/her? For me, it simply displays (as question text) the qid followed by the commands that should paste the gathered info. Tried the original long text as well as @tammo |s version (where I imported the whole survey, then exported the single question, replaced all the en-language codes to my survey language in the lsq file and imported into my survey).

Looks like this:
 

Please Log in to join the conversation.

More
2 years 9 months ago #233856 by jelo

Can anyone please check whether this is still working for him/her?
 
Please provide a LSS export. Not sure anyone will retype your JS from an image to check it.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Please Log in to join the conversation.

More
2 years 9 months ago #233860 by tpartner
It looks to me like the JavaScript isn't being parsed. Do you have permissions to use JS?

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: Masalas

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar Topic Author
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago - 2 years 9 months ago #233867 by Joffm
Yes, exactly this you get with XSS filter ON
 

Joffm

See some more remarks about this in your German thread about the Screen Out.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 9 months ago by Joffm.
The following user(s) said Thank You: Masalas

Please Log in to join the conversation.

More
2 years 9 months ago #233889 by Masalas
Thank you for the quick advice. It indeeds looks a lot like xss filter is set to ON (Joffm's hello world script from the other thread doesn't work, either, although script execution and popups are allowed in the browser). Chances that the superadmin will turn the filter off are very low, but I will ask him tomorrow anyway.

Do you know of any other way to detect at least the horizontal resolution?
I can get a (shortened?) user agent and OS from the browser detection question type, but that doesn't help me to reliably distinguish between tablet and smartphone (or does it? E.g., with firefox on my smartphone and my tablet, the question simply reports "Firefox (<version no.>) | Android (<version no.>)".
The standard themes all use the horizontal resolution in order to switch from one viewport to another? Can I somehow access that information? If not, I could probably still mess with the theme editor to display a message to users with resolutions below x.xxx horizontal px window size (but how?)?

Cheers.

PS. @jelo: In order to check whether the error was on my side (importing/exporting/adjusting/importing again), I meant to ask you all to try the original code. Hence no lss export.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose