Welcome to the LimeSurvey Community Forum

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

Prohibit use of mobile device & decrease width of answer field

  • CarmenCampagnolo
  • CarmenCampagnolo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 2 months ago #233887 by CarmenCampagnolo
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 3.22.4+200212
Own server or LimeSurvey hosting:
Survey theme/template: 
==================
Hi all,

I have two questions:

1. Can I prohibit the use of mobile device? If so, what would the workaround for this be. I'm guessing there's is some sort of Javascript code that alerts anyone using mobile?

2. In Q2 and Q3 of the attached file, can I make the answer fields smaller? And make the cursor start on the left instead of the right?

Any help or info would be greatly appreciated!

Thanks!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago #233888 by Joffm
Hi,
1. yes, there is a script.
Two options: "Long text" or "multiple text"
[url] forums.limesurvey.org/forum/can-i-do-thi...e-used-device#204699 [/url]

2. Have a look at the settings ("display")
 

Numbers usually start this way.
But to get the cursor starting at the left, use a question of type "short text".
Then you have either to validate (like "is_numeric(self)") or use an input mask.

Joffm

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

Please Log in to join the conversation.

  • CarmenCampagnolo
  • CarmenCampagnolo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 2 months ago #233900 by CarmenCampagnolo
Hi Joffm,

thanks for your super helpful and quick response.

Regarding the script you suggested:
I would like to alert participants using a mobile device to please change over to tablet/PC. If, after the alert, they are still using mobile I would filter them out.

Is there a way to adjust your script for something like this?

Thanks,
Carmen

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 2 months ago #233907 by Joffm
Hi,
there is nothing to adapt.
As you see the script contains a function to detect the different settings an returns the jscd object.
And the second part is how you use it.
You see there is one way to display in a question od type "long text".
The there is @Tammo's wish to show the settings separated, in a question of type "multiple short text"

In your case I'd recommend this, too.
You may use a "multiple short text" question (Q1) with two subquestions to store the detection of mobile and the viewport width.
Like
Code:
$(document).ready(function() {
 
      // Hide this question (remove double slash below to hide)
      //$('#question{QID}').hide();
 
      var thisQuestion = $('#question{QID}');
 
      // Fill the array
      $('input[type=text]:eq(0)', thisQuestion).val( jscd.mobile );
      $('input[type=text]:eq(1)', thisQuestion).val( jscd.vieww );
});
Here something more displayed.
 

Now you can show a text display depending on a relvanced equation either
Q1_SQ001=="true"
or
Q1_SQ002<600 (or whichever value you need)
Something like "Please, use a device with a minimum screen width of xxx Pixel."

In a following group you may test again and create an equation (eqQ1) like {if(Q2_SQ001=="true",1,0)}
and set a quota (limit 0) on this equation on value 1.
Up to you and the type of your survey (open, closed) you may use the question Q1  in the equation or test again (Q2) after the text display.

Joffm

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

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose