Welcome to the LimeSurvey Community Forum

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

Select multiple points on an image

  • tixeon
  • tixeon's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 6 months ago #176191 by tixeon
Replied by tixeon on topic Select multiple points on an image
This is a great script. I am wondering if there is a way to make it so that the image resizes when in mobile mode?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #176197 by tpartner
Replied by tpartner on topic Select multiple points on an image
The attached sample survey IS responsive to screen width.




Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #176206 by holch
Replied by holch on topic Select multiple points on an image

The attached sample survey IS responsive to screen width.


What I am wondering is, how do you analyze such a survey, where you register positions on an image via coordinates, but the image can have different sizes, depending on the resolution / view port.

I am not very good a reading JS code. Does the script record this?

In any case, you would need to analyze the results on a case by case basis, because the images might be totally different for any of the responses.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #176209 by tpartner
Replied by tpartner on topic Select multiple points on an image
The coordinates are in percentages of width/height and based on the center of the dots, so image size is irrelevant. I suppose you could also put in media queries to reduce the size of the dots on smaller screens but I don't see the point.

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: holch
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #176215 by holch
Replied by holch on topic Select multiple points on an image

The coordinates are in percentages of width/height and based on the center of the dots, so image size is irrelevant.

Great. That solves the problem of images not being the same size! Thank you for clarifying.

So in your example from the screenshot, Position 1 reads as 6.69% from the top, 17.81% from the left.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #176219 by tpartner
Replied by tpartner on topic Select multiple points on an image
Yep, the coordinates are relative to the top-left corner of the image.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #176470 by Joffm
Replied by Joffm on topic Select multiple points on an image
Hi,
the provided solution works like a charm.

BUT: In a new survey the client would like to see markers in two different colors (e.g. green, red) to be able to mark positive points and negative points.
Something like: left click: green, right click: red.

And furthermore there should be a comment field for each marker. where the respondent explains why he selected this part (positive resp. negative)

Well, because Tony provided this solution this post is more or less addressed to him.


I attach a screenshot of a solution of IFAD CIS.
www.ifad.de/software/befragungssoftware-cis/?lang=en www.ifad.de/software/befragungssoftware-cis/?lang=en

In my case the comment field can be below., but the important thing is that the respondent can see the connection between marker and field.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #176504 by tpartner
Replied by tpartner on topic Select multiple points on an image
Hmm...that'll take some time to develop.

It's interesting that the linked example doesn't work on smartphones. Do you need it to be mobile-compatible? If so (and maybe regardless of that), I would suggest dragging into position instead of clicking - the right-click (tap and hold) on phones is not intuitive to many.

Regarding the comments, can you get away with a single-line input (<input type="text">)?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #176580 by Joffm
Replied by Joffm on topic Select multiple points on an image
Hi,

some feedback:

Yes, you are right about smartphones: The developers of the example say "It doesn't make sense on smartphones".

So, if you have any ideas you are absolutely free in design.

The need (the wishes) are:
  • two different markers (positive vs. negative)
  • comments related to each marker
  • if I remove a marker the comment is removed as well
  • Single line for comments is fine.
  • Doesn't matter where the comment is displayed. Can be below the picture.
  • smartphone not absolutely required.

The "nice to have" are:
  • Multiline comment
  • smartphone enabled


Thank you in advance

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #176590 by tpartner
Replied by tpartner on topic Select multiple points on an image
My thinking on the single-line input is that we could use a multiple-short-text question for the good/bad values, the coordinates and the comments. That way we could roll it into a custom question theme containing all necessary scripts and styles.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #176634 by Joffm
Replied by Joffm on topic Select multiple points on an image
Hi, Tony,

sounds good.

Are you able to do it? Unfortunately I am not.
I am good at many things, but neither familiar with JS nor with the custom question themes (which I hope to learn some day).

Kind regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 5 months ago #176667 by tpartner
Replied by tpartner on topic Select multiple points on an image
Yes, I can probably do that but it will take some time.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose