survey read-only view?

More
3 years 4 days ago - 3 years 4 days ago #106727 by mawa85
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 4 days ago by mawa85.

Please Log in to join the conversation.

More
3 years 3 days ago #106775 by tpartner
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
2 years 11 months ago - 2 years 11 months ago #107001 by mawa85
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: 2 years 11 months ago by mawa85.

Please Log in to join the conversation.

More
2 years 11 months ago #107011 by mfaber
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.