Welcome to the LimeSurvey Community Forum

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

Embed website in Limesurvey (iframe?)

  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 11 months ago #167809 by Skowronski
Embed website in Limesurvey (iframe?) was created by Skowronski
Hello dear Community!

For my study, I need to let people play an online game for 30 minutes. Before and after, they need to fill out questionnaires.
For this reason, I need to find a way how to include a foreign website (the game) in my LimeSurvey questionnaire.
The idea was to embed the game via iframe. How do I do this exactly? I tried to put this: <iframe frameborder="0" height="500" scrolling="no" src="LINK TO GAME" width="800"></iframe> in the source code of a text display question. But when I save it, the text is gone and nothing happens.
What can I do? What am I doing wrong?

Thanks for the help!
Marika
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 11 months ago #167817 by Joffm
Replied by Joffm on topic Embed website in Limesurvey (iframe?)
Hello, Marika,

yes it is correct.
Code:
<div class="embed-responsive "><iframe allowfullscreen="" class="embed-responsive-item" frameborder="0" src="http://www.limesurvey.org"></iframe></div>

You have to enter it in "source code mode"?



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 11 months ago #167818 by Skowronski
Replied by Skowronski on topic Embed website in Limesurvey (iframe?)
Thank you for your help.
I tried to do it with your example code and the example website, but it did not work. I ended up having a result like in the attachment.
And again, after I saved the question, the text in the "source code mode" is gone... :(
Do you or anyone has/have an idea what I can do?
Attachments:
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 11 months ago #167819 by holch
Replied by holch on topic Embed website in Limesurvey (iframe?)
Did you switch off the XSS filter? (not sure if this is necessary though, but when it comes to filtering code it is often the XSS filter which is on).

Did you have a look at this here:
manual.limesurvey.org/Global_settings#Security --> IFrame embedding allowed

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 11 months ago #167822 by Joffm
Replied by Joffm on topic Embed website in Limesurvey (iframe?)
One addition:By the way:

Statement of markusfluer
www.limesurvey.org/forum/german-forum/11...soll?start=15#164192

Translated:
For the source code mode you need administration rights.
In other words, if you do not have administration rights on your installation, it will not work for you.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 11 months ago - 5 years 11 months ago #167840 by Skowronski
Replied by Skowronski on topic Embed website in Limesurvey (iframe?)
I switched off the XSS filter and it worked. I am also able to change the source code of the question.
I used the code that Joffm posted as an example:
Code:
<div class="embed-responsive "><iframe allowfullscreen="" class="embed-responsive-item" frameborder="0" src="http://www.limesurvey.org"></iframe></div>
But it only worked for me without the div-class and without the "embed-responsite-item class".
Problem is now that I do not manage to show the website on fullscreen mode. When I put width and height to 100%, the width of the website is perfect but the height is rather small.
Any ideas why this worked out for you but not for me?
When I change the height from 100% to 500 (e.g.), it looks fine on my screen but does not adjust to a smaller screen.
Last edit: 5 years 11 months ago by Skowronski.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 11 months ago - 5 years 11 months ago #167844 by Joffm
Replied by Joffm on topic Embed website in Limesurvey (iframe?)
Hi,
1. till now you didn't tell us which version of LS you use.
Well, I think you show us the default template of the 2.50 branch.

I do not think that you will get a fullscreen mode.
You still embed the web page in the question container.

Two ideas:
1. Insert only a link to the game, which the repondents click.
Something like:
<span style="font-size:20px;"><em><a href=" www.limesurvey.org " target="_blank">Go to the Game

2. If you programmed the game you could use end-url
(Split your survey, after the first part the end-url links to the game and the game links to the second part orf the survey. you can passthrough some parameters)

Joffm


P.S.
I did not see any issues using the div; neither in v2.73 nor in v3.7.0

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 years 11 months ago by Joffm.
The topic has been locked.
  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 11 months ago - 5 years 11 months ago #167847 by Skowronski
Replied by Skowronski on topic Embed website in Limesurvey (iframe?)
Thank you for the quick reply.
I am using the version 2.52+160920.

Your ideas are very nice, but I did not program the game and I can't include a link to the game: I need to get my participants back to the survey after 30 minutes - so I thought of using the timer function offered by Limesurvey. If my participants simply click on a link, they can't be automatically redirected to limesurvey, can they?

Anyway, I do not need a "real" fullscreen mode. It would be enough if the question container adjusts to maximum width and height. Is that possible?
Right now, the question looks like this and this is too narrow:



It would be great if you could help.
Attachments:
Last edit: 5 years 11 months ago by Skowronski.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 11 months ago #167850 by Joffm
Replied by Joffm on topic Embed website in Limesurvey (iframe?)

they can't be automatically redirected to limesurvey, can they?

Well, they do not leave LS, because target="_blank".
If they close the game they are back.


The other issue.
I can only repeat:
I use Version 2.73.1+171220

and this code
Code:
<div class="embed-responsive embed-responsive-16by9"><iframe allowfullscreen="1" class="embed-responsive-item" frameborder="0" src="https://www.limesurvey.org"></iframe></div>
shows this


There is something else you can try:
<div class="embed-responsive embed-responsive-16by9"><object data=" www.limesurvey.org " style="overflow:auto;border:4px solid black" type="text/html">


But if I set the width and height to 100% I get your result ( the very small one)
Because of the responsive div the page adapts to the screen; think of smartphones or tablets.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Skowronski
  • Skowronski's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 11 months ago #168455 by Skowronski
Replied by Skowronski on topic Embed website in Limesurvey (iframe?)
The Limesurvey update did the trick and your code worked.
Thank you for your help!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose