survey read-only view?

More
3 years 1 month ago - 3 years 1 month ago #106727 by mawa85
mawa85 created the topic: survey read-only view?
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: 3 years 1 month ago by mawa85.

Please Log in to join the conversation.

More
3 years 1 month ago #106775 by tpartner
tpartner replied the topic: survey read-only view?
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.




.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #107001 by mawa85
mawa85 replied the topic: survey read-only view?
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: 3 years 1 month ago by mawa85.

Please Log in to join the conversation.

More
3 years 1 month ago #107011 by mfaber
mfaber replied the topic: survey read-only view?
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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now