Welcome, Guest
Username: Password: Remember me

TOPIC: survey read-only view?

survey read-only view? 6 months 3 weeks ago #106727

  • mawa85
  • mawa85's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hello,

is there a way to open a token-based survey with several pages in "view-only" mode?

My current approach is to replace all input elements and remove the submit button.

This works as long as there is only the editor or the viewer browsing in the survey.
For parallel usage there is the issue of data loss, as every next or back button of the viewer triggers a submit.

Is there a way to navigate trough the survey without submitting the result ?
Or as an alternative: to view the complete survey on one page in my "read-only mode" while showing page mode for the editor?

Thanks.
Last Edit: 6 months 3 weeks ago by mawa85.
The administrator has disabled public write access.

survey read-only view? 6 months 3 weeks ago #106775

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 806
  • Karma: 369
As far as I know, there is no way to do that with an activated survey.

With deactivated surveys, you can allow non-administrators to preview the survey.

Capture2_2014-03-27.png



.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

survey read-only view? 6 months 3 weeks ago #107001

  • mawa85
  • mawa85's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Thanks.

I ended up with the following solution for viewing survey results:

Before I open Limesurvey in an Iframe, I use PHP to select the current row in the survey table, modify the token, increase the id and insert the row again, then pointing the viewer to the modified token. Additionaly, I delete previous created "view-only" token rows and also insert the modified token in the token table.

With JQuery I disable all input elements or replace them with their values.
        $('#ls_frame').contents().find("*:not(.submit)").attr("onclick",'');
	$('#ls_frame').contents().find(".submit[value='Speichern'],.saveall").hide();
	$('#ls_frame').contents().find("#movesubmitbtn").hide();
	$('#ls_frame').contents().find("input[type='text']").attr("readonly",true);
	$('#ls_frame').contents().find("input[type='radio']:not(:checked)").hide().after('O');
	$('#ls_frame').contents().find("input[type='checkbox']:not(:checked)").hide().after('O');
	$('#ls_frame').contents().find("input[type='checkbox']:checked").hide().after('X');
	$('#ls_frame').contents().find("input[type='radio']:checked").hide().after('X');

Not fully parallel, but it works.
Last Edit: 6 months 3 weeks ago by mawa85.
The administrator has disabled public write access.

survey read-only view? 6 months 3 weeks ago #107011

  • mfaber
  • mfaber's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 85
  • Thank you received: 22
  • Karma: 4
You could maybe just copy your active survey and make this your public demo. Just discard the answers people leave when using it or, as tpartner suggested, leave it deactivated and set it to "preview for anyone" and share the link.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.113 seconds
Donation Image