Dear Limes,
I am using LS 3.8.0+180522, installed on our institutional servers.
So in the “Presentation” part of general settings, you can switch on and off “Participants may print answers”. When switched on, at the end of survey (after submitting) a text “print answers” is displayed and hyperlinked with/as something like
ourLSdomain.eu/index.php/printanswers/view?surveyid=845228
. Screenshot of where that Button/Link leads to looks like is attached.
Our aim: presenting that Button on every page (not just the pager after pressing submit), so respondents can print their answers on any point throughout the survey.
As a service unit, we are beyond the point of questioning that need. We are also aware of possible workarounds, e.g. that build forms with that display the variables used in the survey to print out etc.
[We are also aware that printing answers pulls those from the server, and that answers are saved on the server first when the according page was submitted (by clicking “next” or “submit”).]
Status quo: We copied the following code, which we found in theme editor, “completed” screen, “submit.twig”:
{# Link to Print Answer Preview #}
{% if (aSurveyInfo.aCompleted.aPrintAnswers.show == true) %}
<!-- Link to Print Answer Preview -->
<div class="{{ aSurveyInfo.class.submitwrapperdiva }}" {{ aSurveyInfo.attr.submitwrapperdiv }}>
<a href="{{ aSurveyInfo.aCompleted.aPrintAnswers.sUrl }}" class="{{ aSurveyInfo.class.submitwrapperdivaa }}" {{ aSurveyInfo.attr.submitwrapperdivaa }}>
{{ gT("Print your answers.") }}
</a>
</div>
{% endif %}
And pasted it at the end of “main.twig” in the “question” screen while replacing “true” with “false”. The text/link shows up, however upon clicking it seems to loop back to the same page, pretty much like I’d press F5. So I guess “aSurveyInfo.aCompleted.aPrintAnswers.sUrl”(the href tag content) does only successfully translate to “https://ourLSdomain.eu/index.php/printanswers/view?surveyid=845228” after the survey (answers) was(were) actually submitted. Deleting the “.aCompleted”-part didn’t help. In the copied and pasted code we then replaced “aSurveyInfo.aCompleted.aPrintAnswers.sUrl”(the href tag content) - being a variable - with “https://ourLSdomain.eu/index.php/printanswers/view?surveyid=845228” – the value this variable would have for this survey. But since this feature might be useful for other surveys to come in the future we want to have the clean variable-based solution, not the quick and dirty value-based one.
Can any of you help us from here? I hope I could explain everything clear enough.