How to prohibit using the survey with smartphones

More
7 months 1 week ago #163541 by VAMOS_FHB
VAMOS_FHB created the topic: How to prohibit using the survey with smartphones
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?

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago #163548 by tpartner
tpartner replied the topic: How to prohibit using the survey with smartphones
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:
$(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
#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:
<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:
.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, LouisGac

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago #163651 by LouisGac
LouisGac replied the topic: How to prohibit using the survey with smartphones
and this going to become an option for LS3 Fruity theme.
Thx tony

Please Log in or Create an account to join the conversation.

More
5 months 1 week ago - 5 months 1 week ago #166795 by jason8898
jason8898 replied the topic: How to prohibit using the survey with smartphones
Why prohibit people from doing surveys using a smartphone when almost 70% users use smartphones to access the web.
Last Edit: 5 months 1 week ago by LouisGac.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!