Welcome to the LimeSurvey Community Forum

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

How to prohibit using the survey with smartphones

  • VAMOS_FHB
  • VAMOS_FHB's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #163541 by VAMOS_FHB
Hi everybody,

I'm setting up a survey with several questions of the type array dual scale. The survey in general is not suitable for the use with mobile devices (smartphones).

The default templates in LS 2.7 (default, news_paper) deliver a mobile version when they are used with a mobile browser. I'm NOT looking for a responsible template, I just want to permit users with mobile browsers to use the mobile version of the survey.

1) Using the "desktop version" could be suitable. How do I force LS to always deliver the "desktop version" of the survey?

2) Another possibility would be to prohibit the use of smartphones. I thought about checking for the user agent (yes, I know, this is not always reliable) on the welcome page and forwarding to an endpage with a message that states that using the survey with a smartphone is not possible. Does anyone have an example for that?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 1 month ago #163548 by tpartner
1) The template does not deliver a "mobile" version depending on device, it simply responds to screen width.

To stop the arrays from responding to screen width, add something like this to the end of template.js:
Code:
$(document).ready(function(){
 
  $('.no-more-tables td.visible-xs, .no-more-tables span.visible-xs-block').remove();
  $('.no-more-tables').removeClass('no-more-tables');
});

To enforce a minimum width for the survey elements, add something like this to the end of template.css
Code:
#outerframeContainer,
#topsurveymenubar {
  min-width: 900px;
}


2) I don't know why you want to redirect to the end page. You could simply place two elements in the welcome message - one shown on large screens, one shown on smaller screens - and hide the "Next" button on smaller screens.

Something like this in the welcome message:
Code:
<p class="over-900">This is the welcome message for large screens.</p>
<p class="under-900">Your device is too small. Please try again on a larger screen.</p>

And something like this at the end of template.css:
Code:
.under-900 {
  display: none;
}
 
@media only screen and (max-width: 900px) {
  .over-900 {
    display: none;
  }
  .under-900 {
    display: block;
  }
 
  #movenextbtn,
  #movesubmitbtn {
    display: none;
  }
}

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: Ben_V
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 1 month ago #163651 by LouisGac
and this going to become an option for LS3 Fruity theme.
Thx tony
The topic has been locked.
More
5 years 11 months ago - 5 years 11 months ago #166795 by jason8898
Why prohibit people from doing surveys using a smartphone when almost 70% users use smartphones to access the web.
Last edit: 5 years 11 months ago by LouisGac.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose